/* ════════════════════════════════════════════════════
   BEAUTY ZONE — UPGRADE FEATURES CSS
   Flash Deals · Bottom Nav · Search AC · Stock Badge
   ════════════════════════════════════════════════════ */

/* ══════════════════════════════════════════════
   1. FLASH DEALS SECTION
   ══════════════════════════════════════════════ */
.flash-deals-section {
  background: linear-gradient(135deg, #1a0028 0%, #2d0042 40%, #4a1060 100%);
  padding: 20px 0 24px;
  position: relative;
  overflow: hidden;
}

.flash-deals-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 80% 50%, rgba(201,168,76,0.08) 0%, transparent 70%);
}

.fd-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px 16px;
  direction: rtl;
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.fd-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.fd-fire {
  font-size: 2rem;
  animation: flicker 1.2s ease-in-out infinite alternate;
  filter: drop-shadow(0 0 12px rgba(255,180,0,0.8));
}

@keyframes flicker {
  0%   { transform: scale(1) rotate(-3deg); }
  100% { transform: scale(1.1) rotate(3deg); }
}

.fd-eyebrow {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #c9a84c;
  margin: 0 0 2px;
}

.fd-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  color: #fff;
  margin: 0;
}

/* Countdown */
.fd-countdown {
  display: flex;
  align-items: center;
  gap: 4px;
  direction: ltr;
}

.fd-unit {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(201,168,76,0.3);
  border-radius: 8px;
  padding: 6px 10px;
  text-align: center;
  min-width: 46px;
}

.fd-unit span {
  display: block;
  font-family: 'DM Sans', sans-serif;
  font-size: 1.3rem;
  font-weight: 800;
  color: #c9a84c;
  line-height: 1;
}

.fd-unit small {
  font-size: 0.6rem;
  color: rgba(255,255,255,0.5);
  margin-top: 2px;
  display: block;
}

.fd-colon {
  font-size: 1.2rem;
  color: #c9a84c;
  font-weight: 800;
  margin-bottom: 4px;
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.2; }
}

/* Deal cards track */
.fd-track-wrap {
  position: relative;
}

.fd-track {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 4px 20px 8px;
  direction: rtl;
}

.fd-track::-webkit-scrollbar { display: none; }

/* Deal card */
.fd-card {
  flex: 0 0 160px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(201,168,76,0.25);
  border-radius: 16px;
  overflow: hidden;
  scroll-snap-align: start;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s;
  position: relative;
}

.fd-card:hover {
  transform: translateY(-3px);
  border-color: rgba(201,168,76,0.6);
}

.fd-card-img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  display: block;
}

.fd-card-body {
  padding: 10px 12px;
}

.fd-card-name {
  font-family: 'Tajawal', sans-serif;
  font-size: 0.78rem;
  color: rgba(255,255,255,0.9);
  margin: 0 0 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}

.fd-card-prices {
  display: flex;
  align-items: center;
  gap: 6px;
}

.fd-card-new {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  font-weight: 800;
  color: #c9a84c;
}

.fd-card-old {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.4);
  text-decoration: line-through;
}

.fd-discount-tag {
  position: absolute;
  top: 8px;
  inset-inline-start: 8px;
  background: #e84040;
  color: #fff;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 3px 7px;
  border-radius: 20px;
  letter-spacing: 0.04em;
}

.fd-stock-bar {
  margin-top: 8px;
  height: 4px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  overflow: hidden;
}

.fd-stock-fill {
  height: 100%;
  background: linear-gradient(90deg, #e84040, #c9a84c);
  border-radius: 2px;
  transition: width 0.8s ease;
}

.fd-sold-label {
  font-size: 0.6rem;
  color: rgba(255,255,255,0.4);
  margin-top: 3px;
  text-align: right;
  direction: rtl;
}

/* ══════════════════════════════════════════════
   2. UPGRADED BOTTOM NAV BAR
   ══════════════════════════════════════════════ */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9000;
  display: flex;
  align-items: flex-start;
  justify-content: space-around;
  background: rgba(255,248,244,0.96);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid rgba(107,45,78,0.12);
  box-shadow: 0 -8px 32px rgba(0,0,0,0.1);
  padding: 10px 0 max(10px, env(safe-area-inset-bottom));
  direction: rtl;
  transition: transform 0.3s ease;
}

body.luxury .mobile-bottom-nav {
  background: rgba(16,6,10,0.96);
  border-top-color: rgba(201,168,76,0.15);
  box-shadow: 0 -8px 32px rgba(0,0,0,0.4);
}

/* Autohide on scroll down */
.mobile-bottom-nav.hidden-nav {
  transform: translateY(100%);
}

.mbn-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-decoration: none;
  padding: 4px 14px;
  border-radius: 12px;
  transition: color 0.2s;
  position: relative;
  color: rgba(90,48,72,0.5);
  min-width: 52px;
}

body.luxury .mbn-item {
  color: rgba(255,235,220,0.4);
}

.mbn-item.active {
  color: var(--plum);
}

body.luxury .mbn-item.active {
  color: #c9a84c;
}

.mbn-icon {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  transition: stroke 0.2s;
}

.mbn-label {
  font-family: 'Tajawal', sans-serif;
  font-size: 0.65rem;
  font-weight: 600;
  white-space: nowrap;
}

/* Active indicator dot */
.mbn-item.active::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 3px;
  background: var(--plum);
  border-radius: 0 0 3px 3px;
}

body.luxury .mbn-item.active::before {
  background: #c9a84c;
}

/* Cart item — raised bubble */
.mbn-cart {
  margin-top: -18px;
}

.mbn-cart-bubble {
  width: 52px;
  height: 52px;
  background: var(--plum);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(107,45,78,0.45);
  position: relative;
  border: 3px solid rgba(255,248,244,0.95);
  transition: transform 0.2s, box-shadow 0.2s;
}

body.luxury .mbn-cart-bubble {
  background: #c9a84c;
  border-color: rgba(16,6,10,0.95);
  box-shadow: 0 8px 24px rgba(201,168,76,0.45);
}

.mbn-cart:active .mbn-cart-bubble {
  transform: scale(0.93);
}

.mbn-cart-bubble .mbn-icon {
  color: #fff;
  width: 24px;
  height: 24px;
}

body.luxury .mbn-cart-bubble .mbn-icon {
  color: #1a0a12;
}

.mbn-badge {
  position: absolute;
  top: -4px;
  inset-inline-start: -4px;
  background: #e84040;
  color: #fff;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.65rem;
  font-weight: 800;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
}

.mbn-badge[data-count="0"] { display: none; }

/* body padding for bottom nav */
body {
  padding-bottom: calc(70px + env(safe-area-inset-bottom));
}

/* ══════════════════════════════════════════════
   3. SEARCH AUTOCOMPLETE DROPDOWN
   ══════════════════════════════════════════════ */
.search-box-wrap {
  position: relative;
}

.search-autocomplete {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid rgba(107,45,78,0.15);
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.15);
  z-index: 9999;
  max-height: 320px;
  overflow-y: auto;
  display: none;
  scrollbar-width: thin;
}

.search-autocomplete.open {
  display: block;
  animation: acDrop 0.15s ease;
}

@keyframes acDrop {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

body.luxury .search-autocomplete {
  background: #1e0c16;
  border-color: rgba(201,168,76,0.2);
}

.ac-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  transition: background 0.15s;
  direction: rtl;
}

.ac-item:last-child { border-bottom: none; }

.ac-item:hover {
  background: rgba(107,45,78,0.06);
}

body.luxury .ac-item:hover {
  background: rgba(201,168,76,0.08);
}

.ac-thumb {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  background: rgba(0,0,0,0.05);
}

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

.ac-name {
  font-family: 'Tajawal', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.luxury .ac-name { color: #fff; }

.ac-price {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.78rem;
  color: var(--gold);
  font-weight: 700;
}

.ac-cat {
  font-size: 0.65rem;
  color: var(--text-mid);
  opacity: 0.6;
}

.ac-empty {
  padding: 20px;
  text-align: center;
  font-family: 'Tajawal', sans-serif;
  color: var(--text-mid);
  font-size: 0.9rem;
  opacity: 0.6;
}

/* ══════════════════════════════════════════════
   4. STOCK SCARCITY BADGE ON CARDS
   ══════════════════════════════════════════════ */
.stock-scarcity {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(0deg, rgba(232,64,64,0.95) 0%, rgba(232,64,64,0.7) 100%);
  color: #fff;
  font-family: 'Tajawal', sans-serif;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 4px 8px;
  text-align: center;
  letter-spacing: 0.04em;
  backdrop-filter: blur(4px);
}

/* ══════════════════════════════════════════════
   5. SCROLL-TO-TOP BUTTON
   ══════════════════════════════════════════════ */
#scroll-top-btn {
  position: fixed;
  bottom: 90px;
  inset-inline-end: 16px;
  width: 42px;
  height: 42px;
  background: var(--plum);
  color: #fff;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 8000;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s, transform 0.3s;
  box-shadow: 0 4px 16px rgba(107,45,78,0.4);
  pointer-events: none;
}

#scroll-top-btn.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

#scroll-top-btn svg {
  width: 18px;
  height: 18px;
}

body.luxury #scroll-top-btn {
  background: #c9a84c;
  color: #1a0a12;
}

/* ══════════════════════════════════════════════
   6. PROMO STRIP BETWEEN SECTIONS
   ══════════════════════════════════════════════ */
.promo-strip {
  background: linear-gradient(90deg, var(--plum) 0%, #8b3a5a 50%, var(--plum) 100%);
  background-size: 200% 100%;
  animation: promoSlide 4s linear infinite;
  padding: 10px 0;
  overflow: hidden;
  white-space: nowrap;
  direction: rtl;
}

@keyframes promoSlide {
  0%   { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

.promo-strip-inner {
  display: inline-flex;
  gap: 0;
  animation: marquee 12s linear infinite;
}

@keyframes marquee {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.promo-strip-item {
  font-family: 'Tajawal', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  color: rgba(255,255,255,0.95);
  padding: 0 32px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.02em;
}

.promo-strip-dot {
  width: 4px;
  height: 4px;
  background: rgba(201,168,76,0.8);
  border-radius: 50%;
  display: inline-block;
}

/* ══════════════════════════════════════════════
   7. LIVE SOCIAL PROOF BADGE
   ══════════════════════════════════════════════ */
.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(232,64,64,0.1);
  border: 1px solid rgba(232,64,64,0.3);
  border-radius: 20px;
  padding: 4px 10px;
  font-family: 'Tajawal', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  color: #e84040;
  position: fixed;
  bottom: 90px;
  inset-inline-start: 16px;
  z-index: 7999;
  animation: liveIn 0.5s ease;
  backdrop-filter: blur(8px);
  background: rgba(255,255,255,0.95);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

@keyframes liveIn {
  from { opacity: 0; transform: translateX(-20px); }
  to   { opacity: 1; transform: translateX(0); }
}

.live-dot {
  width: 7px;
  height: 7px;
  background: #e84040;
  border-radius: 50%;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%,100% { transform: scale(1); opacity: 1; }
  50%     { transform: scale(1.4); opacity: 0.6; }
}

body.luxury .live-badge {
  background: rgba(16,6,10,0.95);
  color: #ff6b6b;
  border-color: rgba(232,64,64,0.3);
}

/* ══════════════════════════════════════════════
   RESPONSIVE ADJUSTMENTS
   ══════════════════════════════════════════════ */
@media (min-width: 769px) {
  .mobile-bottom-nav {
    display: none;
  }
  body {
    padding-bottom: 0;
  }
  #scroll-top-btn {
    bottom: 24px;
  }
  .live-badge {
    bottom: 24px;
  }
}
