:root {
  --bg-color: #f8fafc;
  --card-bg: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --primary-btn: #2563eb;
  --primary-btn-hover: #1d4ed8;
  --radius-lg: 16px;
  --radius-md: 12px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.05);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  min-height: 100vh;
  width: 100%;
  overflow-x: hidden;
}

/* Force light theme always */
@media (prefers-color-scheme: dark) {
  body {
    background-color: var(--bg-color);
    color: var(--text-main);
  }
}

.screen {
  width: 100%;
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

/* ==========================================
   Screen 1: 403 Access Denied Placeholder
   ========================================== */
#access-denied-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background-color: var(--bg-color);
}

.denied-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 48px 32px;
  text-align: center;
  max-width: 340px;
  width: 100%;
  box-shadow: var(--shadow-md);
}

.denied-code {
  font-size: 64px;
  font-weight: 700;
  color: #94a3b8;
  line-height: 1;
  margin-bottom: 16px;
}

.denied-title {
  font-size: 22px;
  font-weight: 600;
  color: var(--text-main);
}

/* ==========================================
   Screen 2: Main Application
   ========================================== */
#app-screen {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px;
  position: relative;
}

.view {
  width: 100%;
}

/* Header (Optional User Greeting only, NO title) */
.header {
  margin-bottom: 16px;
}

.header:empty {
  display: none;
}

.user-greeting {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
}

/* Product List (Exactly 2 Product Cards) */
.product-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.product-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.product-card:active {
  transform: scale(0.98);
  box-shadow: var(--shadow-sm);
}

.card-img-wrapper {
  width: 100%;
  height: 180px;
  border-radius: var(--radius-md);
  background-color: var(--bg-color);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.card-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.card-price {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
  text-align: center;
}

/* Detail View */
.detail-nav {
  margin-bottom: 16px;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: var(--text-main);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 0;
}

.detail-container {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 80px;
}

.detail-image-wrapper {
  width: 100%;
  height: 220px;
  border-radius: var(--radius-md);
  background-color: var(--bg-color);
  overflow: hidden;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.detail-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.detail-price {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 12px;
}

.detail-description {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
}

.detail-actions {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 448px;
}

.buy-btn {
  width: 100%;
  background-color: var(--primary-btn);
  color: #ffffff;
  border: none;
  padding: 16px;
  border-radius: var(--radius-lg);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
  transition: background-color 0.15s ease, transform 0.15s ease;
}

.buy-btn:active {
  background-color: var(--primary-btn-hover);
  transform: scale(0.98);
}

/* Toast Modal */
.toast-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}

.toast-content {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 320px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-md);
}

.toast-content p {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-main);
  margin-bottom: 20px;
}

.toast-btn {
  background: var(--primary-btn);
  color: white;
  border: none;
  padding: 10px 24px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}
