/* ============================================
   NOVA STORE — Page-specific Styles
   Cart, Checkout, Orders, Auth, Product Detail
   ============================================ */

/* ── PRODUCT DETAIL PAGE ── */
.product-detail {
  padding: var(--space-2xl) 0;
}

.product-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3xl);
  align-items: start;
}

.product-gallery {
  position: sticky;
  top: 96px;
}

.gallery-main {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--color-bg-secondary);
  margin-bottom: var(--space-md);
}

.gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-thumbs {
  display: flex;
  gap: var(--space-sm);
}

.gallery-thumb {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--duration-fast) var(--ease-out-quart);
  opacity: 0.6;
}

.gallery-thumb:hover,
.gallery-thumb.active {
  border-color: var(--color-accent);
  opacity: 1;
}

.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }

.product-info { }

.detail-category {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-accent);
  margin-bottom: var(--space-sm);
}

.detail-title {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  margin-bottom: var(--space-md);
  letter-spacing: -0.02em;
}

.detail-rating-row {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
}

.detail-price-block {
  display: flex;
  align-items: baseline;
  gap: var(--space-md);
  padding: var(--space-lg) 0;
  border-top: 1px solid var(--color-border-light);
  border-bottom: 1px solid var(--color-border-light);
  margin-bottom: var(--space-lg);
}

.detail-price {
  font-family: var(--font-display);
  font-size: var(--text-4xl);
  font-weight: var(--weight-bold);
  color: var(--color-text-primary);
}

.detail-original-price {
  font-size: var(--text-xl);
  color: var(--color-text-tertiary);
  text-decoration: line-through;
}

.discount-tag {
  padding: 0.25em 0.6em;
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  color: white;
  background: var(--color-error);
  border-radius: var(--radius-sm);
}

.stock-info {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-sm);
  color: var(--color-success);
}

.stock-info.low { color: #D97706; }
.stock-info.out { color: var(--color-error); }

.detail-desc {
  color: var(--color-text-secondary);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-lg);
}

.features-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: var(--space-xl);
}

.feature-item-text {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}

.feature-check { color: var(--color-success); font-size: 15px; flex-shrink: 0; }

.quantity-selector {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  width: fit-content;
}

.qty-btn {
  width: 42px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-lg);
  color: var(--color-text-secondary);
  transition: all var(--duration-fast);
  background: transparent;
}

.qty-btn:hover { background: var(--color-bg-tertiary); color: var(--color-text-primary); }

.qty-input {
  width: 52px;
  height: 44px;
  text-align: center;
  font-weight: var(--weight-semibold);
  font-size: var(--text-base);
  border-inline: 1.5px solid var(--color-border);
  background: transparent;
}

.qty-input::-webkit-inner-spin-button,
.qty-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

.action-buttons {
  display: flex;
  gap: var(--space-md);
  margin-top: var(--space-xl);
  flex-wrap: wrap;
}

.action-buttons .btn-primary {
  padding-inline: 2.5em;
  font-size: var(--text-base);
}

.specs-table {
  margin-top: var(--space-2xl);
  padding-top: var(--space-xl);
  border-top: 1px solid var(--color-border-light);
}

.specs-table h3 {
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  margin-bottom: var(--space-md);
}

.specs-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px;
  background: var(--color-border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.spec-key {
  padding: 10px 16px;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text-secondary);
  background: var(--color-bg-secondary);
}

.spec-value {
  padding: 10px 16px;
  font-size: var(--text-sm);
  background: var(--color-surface);
  font-weight: var(--weight-medium);
}

/* ── CART PAGE ── */
.cart-page { padding: var(--space-2xl) 0; }

.cart-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: var(--space-2xl);
  align-items: start;
}

.cart-items {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.cart-item {
  display: flex;
  gap: var(--space-lg);
  padding: var(--space-lg);
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border-light);
  transition: box-shadow var(--duration-normal) var(--ease-out-quart);
}

.cart-item:hover { box-shadow: var(--shadow-sm); }

.cart-item-img-wrap {
  width: 120px;
  height: 120px;
  border-radius: var(--radius-md);
  overflow: hidden;
  flex-shrink: 0;
  background: var(--color-bg-secondary);
}

.cart-item-img { width: 100%; height: 100%; object-fit: cover; }

.cart-item-info { flex: 1; min-width: 0; }

.cart-item-name {
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  margin-bottom: 4px;
}

.cart-item-variant {
  font-size: var(--text-sm);
  color: var(--color-text-tertiary);
  margin-bottom: var(--space-sm);
}

.cart-item-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: var(--space-md);
}

.item-total {
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
}

.remove-item-btn {
  font-size: var(--text-sm);
  color: var(--color-text-tertiary);
  cursor: pointer;
  transition: color var(--duration-fast);
  background: none;
  border: none;
  font-weight: var(--weight-medium);
}

.remove-item-btn:hover { color: var(--color-error); }

/* Cart Summary Sidebar */
.cart-summary {
  position: sticky;
  top: 96px;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border-light);
  padding: var(--space-xl);
}

.summary-title {
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  margin-bottom: var(--space-lg);
}

.summary-row {
  display: flex;
  justify-content: space-between;
  padding: var(--space-sm) 0;
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}

.summary-divider {
  height: 1px;
  background: var(--color-border-light);
  margin: var(--space-sm) 0;
}

.summary-total {
  display: flex;
  justify-content: space-between;
  padding: var(--space-md) 0 0;
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  color: var(--color-text-primary);
}

.coupon-input-group {
  display: flex;
  gap: var(--space-xs);
  margin: var(--space-lg) 0;
}

.coupon-input-group .input-field {
  flex: 1;
  font-size: var(--text-sm);
}

.checkout-btn {
  width: 100%;
  margin-top: var(--space-md);
  padding: 1em;
  font-size: var(--text-base);
}

/* Empty cart */
.empty-cart {
  text-align: center;
  padding: var(--space-3xl) var(--space-lg);
}

.empty-cart-icon {
  font-size: 64px;
  margin-bottom: var(--space-lg);
  opacity: 0.3;
}

.empty-cart h2 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  margin-bottom: var(--space-sm);
}

.empty-cart p {
  color: var(--color-text-secondary);
  max-width: 360px;
  margin: 0 auto var(--space-xl);
}

/* ── COUPONS PAGE ── */
.coupons-page { padding: var(--space-2xl) 0; }

.coupon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-lg);
}

.coupon-card {
  position: relative;
  display: flex;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border-light);
  overflow: hidden;
  transition: transform var(--duration-normal) var(--ease-out-quart),
              box-shadow var(--duration-normal) var(--ease-out-quart);
}

.coupon-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.coupon-card.disabled {
  opacity: 0.5;
}

.coupon-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 110px;
  padding: var(--space-lg);
  background: linear-gradient(135deg, var(--color-accent), #E5A840);
  color: white;
  text-align: center;
}

.coupon-discount {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  line-height: 1.1;
}

.coupon-type-label {
  font-size: var(--text-xs);
  opacity: 0.85;
  margin-top: 2px;
}

.coupon-notch {
  position: absolute;
  left: 107px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  background: var(--color-bg);
  border-radius: 50%;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.06);
}

.coupon-right {
  flex: 1;
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.coupon-code {
  font-family: var(--font-mono);
  font-size: var(--text-base);
  font-weight: var(--weight-bold);
  color: var(--color-accent);
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.coupon-description {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-sm);
}

.coupon-meta {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  font-size: var(--text-xs);
  color: var(--color-text-tertiary);
}

.coupon-used-badge {
  margin-left: auto;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: var(--weight-semibold);
  background: var(--color-bg-tertiary);
  border-radius: var(--radius-full);
  color: var(--color-text-tertiary);
}

/* ── ORDERS PAGE ── */
.orders-page { padding: var(--space-2xl) 0; }

.order-tabs {
  display: flex;
  gap: var(--space-xs);
  margin-bottom: var(--space-xl);
  border-bottom: 1px solid var(--color-border-light);
  padding-bottom: var(--space-sm);
}

.order-tab {
  padding: 0.6em 1.25em;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text-secondary);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out-quart);
  background: none;
  border: none;
}

.order-tab:hover { color: var(--color-text-primary); background: var(--color-bg-tertiary); }
.order-tab.active { background: var(--color-text-primary); color: white; }

.order-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.order-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: box-shadow var(--duration-normal) var(--ease-out-quart);
}

.order-card:hover { box-shadow: var(--shadow-md); }

.order-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  background: var(--color-bg-secondary);
  border-bottom: 1px solid var(--color-border-light);
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.order-id-label {
  font-size: var(--text-xs);
  color: var(--color-text-tertiary);
}

.order-id-value {
  font-family: var(--font-mono);
  font-weight: var(--weight-semibold);
  font-size: var(--text-sm);
}

.order-date {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}

.order-status-pill {
  padding: 0.3em 0.85em;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  border-radius: var(--radius-full);
}

.status-processing { background: rgba(59,130,182,0.1); color: var(--color-info); }
.status-shipped { background: rgba(196,130,42,0.12); color: var(--color-accent); }
.status-delivered { background: rgba(45,139,111,0.1); color: var(--color-success); }
.status-cancelled { background: rgba(196,69,54,0.08); color: var(--color-error); }

.order-body { padding: var(--space-lg); }

.order-products {
  display: flex;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
}

.order-product-thumb {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-bg-secondary);
  flex-shrink: 0;
}

.order-product-thumb img { width: 100%; height: 100%; object-fit: cover; }

.order-summary-row {
  display: flex;
  justify-content: space-between;
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  padding: 4px 0;
}

.order-final-total {
  display: flex;
  justify-content: space-between;
  font-size: var(--text-base);
  font-weight: var(--weight-bold);
  color: var(--color-text-primary);
  margin-top: var(--space-sm);
  padding-top: var(--space-sm);
  border-top: 1px dashed var(--color-border);
}

.order-actions {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
}

/* Empty orders */
.empty-orders {
  text-align: center;
  padding: var(--space-3xl) var(--space-lg);
}

.empty-orders-icon { font-size: 56px; opacity: 0.25; margin-bottom: var(--space-lg); }
.empty-orders h2 { font-family: var(--font-display); font-size: var(--text-2xl); margin-bottom: var(--space-sm); }
.empty-orders p { color: var(--color-text-secondary); margin-bottom: var(--space-xl); }

/* ── AUTH PAGES ── */
.auth-page {
  min-height: calc(100vh - 72px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl) var(--content-padding);
}

.auth-container {
  width: 100%;
  max-width: 420px;
}

.auth-header {
  text-align: center;
  margin-bottom: var(--space-2xl);
}

.auth-header h1 {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: var(--weight-bold);
  margin-bottom: var(--space-sm);
}

.auth-header p {
  color: var(--color-text-secondary);
  font-size: var(--text-base);
}

.auth-form {
  background: var(--color-surface);
  padding: var(--space-2xl);
  border-radius: var(--radius-xl);
  border: 1px solid var(--color-border-light);
  box-shadow: var(--shadow-sm);
}

.form-group {
  margin-bottom: var(--space-lg);
}

.form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text-primary);
  margin-bottom: 6px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}

.form-footer {
  text-align: center;
  margin-top: var(--space-lg);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}

.form-footer a {
  color: var(--color-accent);
  font-weight: var(--weight-semibold);
}

.form-footer a:hover { text-decoration: underline; }

.divider {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin: var(--space-lg) 0;
  font-size: var(--text-sm);
  color: var(--color-text-tertiary);
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--color-border);
}

.social-login {
  display: flex;
  gap: var(--space-sm);
}

.social-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: 0.75em 1em;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: all var(--duration-fast) var(--ease-out-quart);
  background: var(--color-surface);
  color: var(--color-text-primary);
}

.social-btn:hover {
  border-color: var(--color-text-tertiary);
  background: var(--color-bg-secondary);
}

.user-menu-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--space-sm);
  z-index: var(--z-dropdown);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition: all var(--duration-normal) var(--ease-out-quart);
}

.user-menu-dropdown.open {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}

.dropdown-user-info {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-sm);
  border-bottom: 1px solid var(--color-border-light);
  margin-bottom: var(--space-xs);
}

.user-avatar-placeholder {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--color-accent-surface);
  color: var(--color-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--weight-bold);
  font-size: var(--text-sm);
  flex-shrink: 0;
}

.dropdown-name { font-size: var(--text-sm); font-weight: var(--weight-semibold); }
.dropdown-email { font-size: var(--text-xs); color: var(--color-text-tertiary); }

.dropdown-link {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 0.55em 0.75em;
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  border-radius: var(--radius-sm);
  transition: all var(--duration-fast);
  cursor: pointer;
  width: 100%;
  background: none;
  border: none;
  text-align: left;
}

.dropdown-link:hover { background: var(--color-bg-tertiary); color: var(--color-text-primary); }
.dropdown-link.danger { color: var(--color-error); }

/* ── TOAST NOTIFICATIONS ── */
.toast-container {
  position: fixed;
  bottom: var(--space-lg);
  right: var(--space-lg);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 14px 20px;
  background: #1A1816;
  color: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  animation: slideInRight var(--duration-normal) var(--ease-out-quart) both;
  min-width: 280px;
  max-width: 400px;
}

.toast.success { border-left: 3px solid var(--color-success); }
.toast.error { border-left: 3px solid var(--color-error); }
.toast.info { border-left: 3px solid var(--color-info); }

/* ── MODAL / OVERLAY ── */
.overlay-backdrop {
  position: fixed;
  inset: 0;
  background: var(--color-overlay);
  z-index: var(--z-modal);
  animation: fadeIn var(--duration-normal) var(--ease-out-quart) both;
}

.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  z-index: calc(var(--z-modal) + 1);
  width: 90%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  animation: scaleIn var(--duration-normal) var(--ease-out-quart) both;
}

.modal-close {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  font-size: 18px;
  color: var(--color-text-tertiary);
  cursor: pointer;
  transition: all var(--duration-fast);
}
.modal-close:hover { background: var(--color-bg-tertiary); color: var(--color-text-primary); }

/* ── RESPONSIVE DESIGN ── */
@media (max-width: 1024px) {
  .hero-content { max-width: 100%; text-align: center; }
  .hero-title { font-size: clamp(2rem, 1.6rem + 3vw, 3rem); }
  .hero-description { max-width: 100%; margin-inline: auto; }
  .hero-actions { justify-content: center; }
  .hero-stats { justify-content: center; flex-wrap: wrap; }
  .hero-image-col { display: none; }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
  .features-bar { grid-template-columns: repeat(2, 1fr); }
  .product-detail-grid { grid-template-columns: 1fr; gap: var(--space-xl); }
  .product-gallery { position: static; }
  .cart-layout { grid-template-columns: 1fr; }
  .cart-summary { position: static; }
  .specs-grid { grid-template-columns: auto 1fr; }
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  .search-bar-header { display: none; }
  .mobile-menu-btn { display: flex; }
  .mobile-nav.open { display: block; }
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--space-md); }
  .footer-grid { grid-template-columns: 1fr; gap: var(--space-xl); }
  .features-bar { grid-template-columns: 1fr 1fr; gap: var(--space-md); }
  .features-bar .feature-item { flex-direction: column; text-align: center; }
  .newsletter-form { flex-direction: column; }
  .form-row { grid-template-columns: 1fr; }
  .coupon-grid { grid-template-columns: 1fr; }
  .order-header-bar { flex-direction: column; align-items: flex-start; }
  .auth-form { padding: var(--space-lg); }
  .section-spacing { padding-block: var(--space-xl); }
  .hero { min-height: auto; padding: var(--space-2xl) 0; }
  .hero-stats { gap: var(--space-lg); }
}

@media (max-width: 480px) {
  .product-grid { grid-template-columns: 1fr; }
  .cart-item { flex-direction: column; }
  .cart-item-img-wrap { width: 100%; height: 180px; }
  .coupon-card { flex-direction: column; }
  .coupon-notch { left: 50%; top: 0; transform: translateX(-50%); }
  .coupon-left { flex-direction: row; min-width: unset; }
  .social-login { flex-direction: column; }
}
