/* ========================================
   Sokhari Plus - Customer Page Components
   ======================================== */

/* Skeleton loader */
.skeleton {
  background: #0b0b0b;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 0.75rem;
  overflow: hidden;
}

/* Fallback image */
.fallback-img {
  opacity: 0.4;
  background-color: #0a0a0a;
  object-fit: contain !important;
  padding: 12px;
}

/* ========================================
   Product Card — Flat Design with Responsive Typography
   ======================================== */

/* Card base */
.product-card {
  background-color: rgba(30, 30, 30, 0.4);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 0.875rem;
  overflow: hidden;
  position: relative;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease, z-index 0.3s ease;
  z-index: 1;
}

@media (min-width: 640px) {
  .product-card {
    border-radius: 1rem;
  }
}

.product-card:hover {
  transform: translateY(4px);
  border-color: rgba(245,158,11,0.3);
  box-shadow: 0 12px 32px rgba(0,0,0,0.4);
  z-index: 30;
}

/* Image: flush top, no overflow */
.product-card .product-card-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
}
.product-card .product-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}
.product-card:hover .product-card-img img {
  transform: scale(1.05);
}

/* Product card text responsive sizing */
.product-card h3 {
  font-size: clamp(0.875rem, 2vw, 1rem);
  line-height: 1.4;
}

.product-card p {
  font-size: clamp(0.75rem, 1.5vw, 0.875rem);
  line-height: 1.5;
}

.product-card .price {
  font-size: clamp(0.875rem, 2vw, 1rem);
}

/* Better touch targets for mobile */
.product-card button {
  min-height: 2.75rem;
  min-width: 2.75rem;
}

@media (min-width: 640px) {
  .product-card button {
    min-height: 2.5rem;
    min-width: 2.5rem;
  }
}

/* Favorite button in price row — no extra styling needed */

/* Card hover (generic fallback for non-product cards) */
.card-hover {
  transition: all 0.3s ease;
}

/* discount-shine removed — no red border on discounted cards */

/* +/- buttons styling */
button[data-inc], button[data-dec] {
  background-color: #2a2a2e !important;
  color: #f3f4f6 !important;
  border: 1px solid rgba(255,255,255,0.08);
}
button[data-inc]:hover, button[data-dec]:hover {
  background-color: #3a3a3e !important;
}

/* Disabled stock limit button */
button[data-inc].stock-limit,
button[data-mc-inc].stock-limit {
  opacity: 0.3 !important;
  cursor: not-allowed !important;
  pointer-events: none;
}

/* Mini cart horizontal scroll */
#mini-cart-list { overflow-x: auto; }
#mini-cart-list > div {
  flex: 0 0 auto;
  width: 9rem;
  background-color: #0a0a0a;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 0.75rem;
  display: flex;
  flex-direction: column;
}
#mini-cart-list > div img {
  width: 100%;
  height: 6rem;
  border-top-left-radius: 0.75rem;
  border-top-right-radius: 0.75rem;
  object-fit: cover;
}

/* Top selling horizontal scroll */
#top-selling-list {
  overflow-x: auto;
}
#top-selling-list > .top-selling-card {
  flex: 0 0 auto;
  width: 12rem;
}
@media (min-width: 640px) {
  #top-selling-list > .top-selling-card {
    width: 16rem;
  }
}

/* Flash discounts horizontal scroll */
#flash-discounts-list > .flash-discount-card {
  flex: 0 0 auto;
  width: 12rem;
}
@media (min-width: 640px) {
  #flash-discounts-list > .flash-discount-card {
    width: 16rem;
  }
}

/* +/- buttons for horizontal list sections (top-selling + flash discounts) */
button[data-ts-inc], button[data-ts-dec],
button[data-fd-inc], button[data-fd-dec] {
  background-color: #2a2a2e !important;
  color: #f3f4f6 !important;
  border: 1px solid rgba(255,255,255,0.08);
}
button[data-ts-inc]:hover, button[data-ts-dec]:hover,
button[data-fd-inc]:hover, button[data-fd-dec]:hover {
  background-color: #3a3a3e !important;
}
button[data-ts-inc].stock-limit,
button[data-fd-inc].stock-limit {
  opacity: 0.3 !important;
  cursor: not-allowed !important;
  pointer-events: none;
}

/* Prose styling for content pages */
.prose h2 { font-size: 1.25rem; font-weight: bold; margin: 1.5rem 0 0.75rem; color: #f59e0b; }
.prose h3 { font-size: 1.1rem; font-weight: 600; margin: 1rem 0 0.5rem; color: #fbbf24; }
.prose p { margin-bottom: 1rem; line-height: 1.8; color: #d1d5db; }
.prose ul, .prose ol { margin: 1rem 0; padding-right: 1.5rem; }
.prose li { margin-bottom: 0.5rem; color: #d1d5db; }
.prose strong { color: #fbbf24; }

/* Hero gradient */
.hero-gradient {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

/* ========================================
   Flash Discount Badge & Countdown
   ======================================== */
.flash-discount-badge {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  z-index: 5;
}

.flash-countdown {
  font-variant-numeric: tabular-nums;
  min-width: 70px;
  direction: ltr;
  letter-spacing: 0.03em;
}

/* ========================================
   RIP Ribbon — out of stock mourning band
   ======================================== */
.rip-ribbon {
  position: absolute;
  top: 18px;
  left: -38px;
  width: 140px;
  padding: 5px 0;
  background: #111;
  color: #888;
  text-align: center;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 2px;
  transform: rotate(-45deg);
  transform-origin: center center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.6);
  z-index: 10;
  border-top: 2px solid #333;
  border-bottom: 2px solid #333;
}

/* ========================================
   Order Timeline
   ======================================== */
.order-timeline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 0.75rem 0;
  direction: rtl;
  overflow-x: auto;
}
.timeline-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  flex: 1;
  min-width: 70px;
  transition: all 0.5s ease;
}
.timeline-step .tl-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  z-index: 1;
  transition: all 0.5s ease;
  border: 2px solid;
}
.timeline-step .tl-label {
  font-size: 0.65rem;
  margin-top: 6px;
  text-align: center;
  white-space: nowrap;
  direction: rtl;
}
/* Connector line between steps */
.timeline-step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 18px;
  right: 50%;
  width: 100%;
  height: 2px;
  z-index: 0;
  transition: background-color 0.5s ease;
}
/* States */
.timeline-step.completed .tl-icon {
  background-color: rgba(34,197,94,0.2);
  border-color: #22c55e;
  color: #22c55e;
}
.timeline-step.completed .tl-label { color: #22c55e; }
.timeline-step.completed:not(:last-child)::after { background-color: #22c55e; }

.timeline-step.current .tl-icon {
  background-color: rgba(245,158,11,0.2);
  border-color: #f59e0b;
  color: #f59e0b;
}
.timeline-step.current .tl-label { color: #f59e0b; font-weight: 600; }
.timeline-step.current:not(:last-child)::after { background-color: #3f3f46; }

.timeline-step.upcoming .tl-icon {
  background-color: rgba(63,63,70,0.3);
  border-color: #3f3f46;
  color: #52525b;
}
.timeline-step.upcoming .tl-label { color: #52525b; }
.timeline-step.upcoming:not(:last-child)::after { background-color: #27272a; }

/* ========================================
   Sticky Category Navigation
   ======================================== */
.sticky-category-nav {
  position: sticky;
  /* JS sets --header-h dynamically; fallback to 0 (fixed header sits above in z-index) */
  top: var(--header-h, 0px);
  z-index: 40;
  transition: box-shadow 0.2s ease;
}

/* Category nav icon SVG color inheritance */
.cat-nav-btn svg {
  width: 100%;
  height: 100%;
}
.cat-nav-btn .cat-nav-icon {
  transition: all 0.2s ease;
}

/* Category section scroll offset for sticky header + nav */
.category-section {
  scroll-margin-top: 13rem;
}

/* Force black text for header auth buttons on yellow background */
#header-auth-btn button,
#header-auth-btn .flex.items-center {
  color: black !important;
}

#header-auth-btn button:hover,
#header-auth-btn .flex.items-center:hover {
  color: #374151 !important; /* gray-800 */
}

#header-admin-link a {
  color: white !important;
}

#header-admin-link a:hover {
  color: yellow !important; /* gray-800 */
}

/* Header cart badge */
#header-cart-count {
  color: black !important;
}

/* ========================================
   Bottom Navigation (Mobile/Tablet)
   ======================================== */
.bottom-nav-bar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: #1a1a1a;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 9999px;
  padding: 8px 12px;
  box-shadow: 0 -4px 24px rgba(0,0,0,0.5);
}

/* Horizontal track line connecting icons */
.bottom-nav-track {
  position: absolute;
  top: 50%;
  left: 10%;
  right: 10%;
  height: 2px;
  background: rgba(255,255,255,0.08);
  transform: translateY(-50%);
  z-index: 0;
  border-radius: 1px;
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-decoration: none;
  position: relative;
  z-index: 1;
}

.bottom-nav-icon {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  background: #1a1a1a;
  border: 2px solid rgba(255,255,255,0.1);
  color: #9ca3af;
  transition: all 0.3s ease;
}

.bottom-nav-label {
  font-size: 0.75rem;
  color: #6b7280;
  transition: color 0.3s ease;
  white-space: nowrap;
}

/* Active state */
.bottom-nav-item.active .bottom-nav-icon {
  background: #f59e0b;
  border-color: #f59e0b;
  color: #000;
  box-shadow: 0 0 16px rgba(245,158,11,0.4);
}

.bottom-nav-item.active .bottom-nav-label {
  color: #f59e0b;
  font-weight: 600;
}

/* Hover state (non-active) */
.bottom-nav-item:not(.active):not(.bottom-nav-fab):hover .bottom-nav-icon {
  border-color: rgba(245,158,11,0.4);
  color: #fbbf24;
}
.bottom-nav-item:not(.active):not(.bottom-nav-fab):hover .bottom-nav-label {
  color: #fbbf24;
}

/* ---- FAB Cart Button (center) ---- */
.bottom-nav-fab {
  margin-top: -28px;
}

.bottom-nav-fab-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #000;
  border: 3px solid #1a1a1a;
  box-shadow: 0 4px 16px rgba(245,158,11,0.4), 0 0 0 3px rgba(245,158,11,0.15);
  transition: all 0.3s ease;
  position: relative;
}

.bottom-nav-fab:hover .bottom-nav-fab-icon,
.bottom-nav-fab.fab-open .bottom-nav-fab-icon {
  transform: scale(1.08);
  box-shadow: 0 6px 24px rgba(245,158,11,0.5), 0 0 0 4px rgba(245,158,11,0.2);
}

.bottom-nav-fab.fab-open .bottom-nav-fab-icon {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
}

.bottom-nav-fab .bottom-nav-label {
  color: #f59e0b;
  font-weight: 600;
}

/* Cart badge on FAB */
.bottom-nav-fab-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9999px;
  background: #ef4444;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #1a1a1a;
  line-height: 1;
}

/* ---- Cart Drawer (slides up above bottom nav) ---- */
.bnav-cart-drawer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 0 0;
}

.bnav-cart-drawer.open {
  max-height: 400px;
  padding-bottom: 8px;
}

/* Cart list items (same as mini-cart) */
#bnav-cart-list { overflow-x: auto; }
#bnav-cart-list > div {
  flex: 0 0 auto;
  width: 9rem;
  background-color: #0a0a0a;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 0.75rem;
  display: flex;
  flex-direction: column;
}
#bnav-cart-list > div img {
  width: 100%;
  height: 6rem;
  border-top-left-radius: 0.75rem;
  border-top-right-radius: 0.75rem;
  object-fit: cover;
}

