/* ============================================
   MuscleUp E-Commerce Pages — Styles
   (Auth, Checkout, Dashboard)
   ============================================ */

/* ---------- Auth Forms ---------- */
.auth-page {
  padding: var(--space-5xl) 0;
  background: var(--color-bg-warm);
  min-height: calc(100vh - var(--header-height));
  display: flex;
  align-items: center;
  position: relative;
}

.auth-page .section-bg-image {
  position: absolute;
  inset: 0;
  background: url('../images/hero_bg_botanical.jpg') center/cover no-repeat;
  opacity: 0.15;
  pointer-events: none;
  z-index: 0;
}

.auth-container {
  max-width: 500px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.auth-box {
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  padding: var(--space-2xl);
  border: 1px solid var(--color-border-light);
}

.auth-header {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.auth-header h1 {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--color-text);
  margin-bottom: var(--space-xs);
}

.auth-header p {
  color: var(--color-text-secondary);
  font-size: 0.95rem;
}

.form-group {
  margin-bottom: var(--space-lg);
}

.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--color-text);
  margin-bottom: 8px;
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text);
  transition: all var(--transition-fast);
}

.form-control:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px rgba(26,107,60,0.08);
}

.form-row {
  display: flex;
  gap: var(--space-md);
}

.form-row .form-group {
  flex: 1;
}

.form-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-xl);
  font-size: 0.9rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--color-text-secondary);
}

.auth-link {
  color: var(--color-primary);
  font-weight: 600;
  text-decoration: none;
}

.auth-link:hover {
  text-decoration: underline;
}

.auth-box .btn {
  width: 100%;
  justify-content: center;
}

.auth-footer {
  text-align: center;
  margin-top: var(--space-xl);
  font-size: 0.95rem;
  color: var(--color-text-secondary);
}

.auth-toggle {
  display: none;
}
.auth-toggle.active {
  display: block;
}

/* ---------- Checkout Page ---------- */
.checkout-page {
  padding: var(--space-4xl) 0;
  background: var(--color-bg);
  min-height: 100vh;
}

.checkout-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: var(--space-3xl);
  align-items: start;
}

.checkout-section {
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border-light);
  margin-bottom: var(--space-xl);
}

.checkout-section h2 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--color-text);
  margin-bottom: var(--space-lg);
  display: flex;
  align-items: center;
  gap: 12px;
}

.checkout-section h2 span {
  width: 28px;
  height: 28px;
  background: var(--color-primary);
  color: white;
  border-radius: var(--radius-circle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

.order-summary {
  background: var(--color-bg-green);
  border: 1px solid var(--color-primary-lighter);
  position: sticky;
  top: 100px;
}

.summary-items {
  margin-bottom: var(--space-xl);
}

.summary-item {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid rgba(26,107,60,0.1);
}

.summary-item-img {
  width: 64px;
  height: 64px;
  background: white;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.summary-item-img img {
  max-width: 80%;
  max-height: 80%;
}

.summary-item-qty {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 20px;
  height: 20px;
  background: var(--color-secondary);
  color: var(--color-text);
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: var(--radius-circle);
  display: flex;
  align-items: center;
  justify-content: center;
}

.summary-item-details {
  flex: 1;
}

.summary-item-title {
  font-weight: 600;
  font-size: 0.95rem;
}

.summary-item-price {
  font-weight: 700;
  color: var(--color-primary);
}

.summary-totals {
  margin-bottom: var(--space-xl);
}

.summary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  color: var(--color-text-secondary);
}

.summary-row.total {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 2px solid rgba(26,107,60,0.1);
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--color-text);
}

/* ---------- Dashboard ---------- */
.dashboard-page {
  padding: var(--space-4xl) 0;
  background: var(--color-bg-warm);
  min-height: 100vh;
}

.dashboard-header {
  margin-bottom: var(--space-2xl);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dashboard-header h1 {
  font-family: var(--font-display);
  font-size: 2.2rem;
  color: var(--color-text);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: var(--space-2xl);
}

.dashboard-nav {
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  padding: var(--space-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border-light);
}

.dashboard-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  color: var(--color-text-secondary);
  text-decoration: none;
  border-radius: var(--radius-md);
  font-weight: 600;
  transition: all var(--transition-fast);
}

.dashboard-nav a:hover,
.dashboard-nav a.active {
  background: var(--color-primary-lighter);
  color: var(--color-primary);
}

.dashboard-content {
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border-light);
}

.dashboard-content h2 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--color-text);
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--color-border-light);
}

.order-history-table {
  width: 100%;
  border-collapse: collapse;
}

.order-history-table th,
.order-history-table td {
  padding: 16px;
  text-align: left;
  border-bottom: 1px solid var(--color-border-light);
}

.order-history-table th {
  font-weight: 600;
  color: var(--color-text-secondary);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.order-history-table td {
  color: var(--color-text);
  font-weight: 500;
}

.status-badge {
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 700;
}

.status-processing { background: #fff3e0; color: #e65100; }
.status-shipped { background: #e3f2fd; color: #1565c0; }
.status-delivered { background: #e8f5e9; color: #2e7d32; }

/* ---------- Thank You Page ---------- */
.thank-you-page {
  padding: var(--space-5xl) 0;
  background: var(--color-bg);
  min-height: calc(100vh - var(--header-height));
  display: flex;
  align-items: center;
  justify-content: center;
}

.thank-you-box {
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: var(--space-4xl) var(--space-3xl);
  max-width: 600px;
  width: 100%;
  text-align: center;
  border: 1px solid var(--color-border-light);
}

.thank-you-icon {
  width: 80px;
  height: 80px;
  background: var(--color-primary-lighter);
  color: var(--color-primary);
  border-radius: var(--radius-circle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  margin: 0 auto var(--space-xl);
}

.thank-you-box h1 {
  font-family: var(--font-display);
  font-size: 2.2rem;
  margin-bottom: var(--space-sm);
}

.thank-you-box p {
  color: var(--color-text-secondary);
  font-size: 1.05rem;
  margin-bottom: var(--space-xl);
}

.order-info-box {
  background: var(--color-bg-warm);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  margin-bottom: var(--space-2xl);
  text-align: left;
}

.order-info-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 0.95rem;
}

.order-info-row:last-child {
  margin-bottom: 0;
}

.order-info-label {
  color: var(--color-text-secondary);
}

.order-info-val {
  font-weight: 600;
  color: var(--color-text);
}

/* Responsive */
@media (max-width: 900px) {
  .checkout-grid { grid-template-columns: 1fr; }
  .order-summary { position: static; }
  .dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .form-row { flex-direction: column; gap: 0; }
  .order-history-table { display: block; overflow-x: auto; white-space: nowrap; }
}

/* =============================================
   OFFER POPUP
   ============================================= */
.popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.popup-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.popup-box {
  background: white;
  padding: 40px;
  border-radius: 12px;
  max-width: 400px;
  width: 90%;
  text-align: center;
  position: relative;
  transform: translateY(20px);
  transition: transform 0.3s ease;
  box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

.popup-overlay.active .popup-box {
  transform: translateY(0);
}

.popup-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #999;
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s;
}

.popup-close:hover {
  color: #333;
}

.popup-box h3 {
  color: var(--color-primary);
  font-size: 2.2rem;
  margin-bottom: 10px;
  font-family: "Outfit", sans-serif;
  font-weight: 800;
  line-height: 1.1;
}

.popup-box p {
  font-size: 1.1rem;
  color: var(--color-text-secondary);
  margin-bottom: 20px;
}

.popup-box strong {
  display: block;
  font-size: 1.5rem;
  color: var(--color-accent);
  margin-top: 10px;
  background: #f9f9f9;
  padding: 10px;
  border: 1px dashed var(--color-border);
  border-radius: 6px;
}
