/* ═══════════════════════════════════════
   RESET & GLOBAL DESIGN SYSTEM
═══════════════════════════════════════ */
* { 
  margin: 0; 
  padding: 0; 
  box-sizing: border-box; 
}

body {
  background: #FFF7F8; /* 60% Dominant Color */
  font-family: 'Nunito', sans-serif;
  padding: 12px;
  padding-bottom: 100px; /* Clearance for Floating Nav */
  color: #111111;
  -webkit-tap-highlight-color: transparent;
}

/* Material Symbols Standard Utility */
.material-symbols-outlined {
  font-family: 'Material Symbols Outlined';
  font-weight: normal;
  font-style: normal;
  font-size: 20px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-smoothing: antialiased;
}

/* ═══════════════════════════════════════
   SCROLL-LINKED HEADER & TITLE ANIMATION
═══════════════════════════════════════ */
:root {
  --header-bg-opacity: 0;
  --header-shadow-opacity: 0;
  --header-pad-top: 36px;
  --header-pad-bottom: 16px;
  --title-scale: 1.77; 
  --scroll-progress: 0;
}

.header {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: rgba(255, 247, 248, var(--header-bg-opacity)); 
  padding: var(--header-pad-top) 14px var(--header-pad-bottom) 14px;
  border-radius: 0 0 24px 24px;
  margin: -12px -12px 16px -12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, var(--header-shadow-opacity));
}

.sticky-header {
  position: sticky;
  top: 0;
  z-index: 900;
}

.title-wrapper { 
  display: flex; 
  align-items: center; 
  justify-content: space-between; 
}

.title { 
  color: #000000; 
  font-family: 'Montserrat', sans-serif;
  font-size: 18px; 
  line-height: 1.2;
  
  /* UX Principle: Allow natural wrapping only if it exceeds screen limits */
  white-space: normal; 
  word-wrap: break-word; 
  
  /* Scroll Animation strictly restricted to scaling size */
  transform: scale(var(--title-scale));
  transform-origin: left center;
  will-change: transform;
  margin-left: 8px;
}

.title-main {
  font-weight: 800; /* Bold primary text */
}

.title-store {
  font-weight: 300; /* Thin secondary text */
  text-transform: lowercase;
  opacity: 0.85;
    font-size: 12px; 

}

/* SEARCH BAR */
.header-actions { display: flex; align-items: center; width: 100%; }
.search-bar-container {
  display: flex; 
  align-items: center; 
  flex: 1; 
  background: #FFFFFF; 
  border-radius: 14px; 
  padding: 6px 14px; 
  height: 44px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  border: 1px solid rgba(0,0,0,0.05);
}
.search-icon { 
  font-size: 20px; 
  color: #777777; 
  margin-right: 8px; 
}
.search-bar-inner { 
  flex: 1; 
  border: none; 
  background: transparent; 
  outline: none; 
  font-size: 14px; 
  font-family: 'Nunito', sans-serif; 
  font-weight: 600; 
  color: #111;
}

/* ═══════════════════════════════════════
   FLOATING BOTTOM NAVIGATION BAR
═══════════════════════════════════════ */
.bottom-nav {
  position: fixed;
  bottom: 20px; 
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 440px;
  height: 64px;
  background: rgba(247, 200, 208, 0.95); /* Floating Dark Glass */
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex; 
  justify-content: space-around; 
  align-items: center;
  border-radius: 32px;
  box-shadow: 0 10px 28px rgba(0,0,0,0.25);
  z-index: 1000;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.nav-btn {
  background: transparent; 
  border: none; 
  outline: none;
  display: flex; 
  flex-direction: column; 
  align-items: center; 
  gap: 3px;
  color: #888888; 
  cursor: pointer; 
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 8px 16px;
  border-radius: 100px;
}

.nav-btn.active { 
  color: #FFFFFF; 
  background: rgba(255, 255, 255, 0.1);
}

.nav-btn.active .nav-icon {
  color: #7A2942; /* Accent Highlight */
  transform: scale(1.1);
}

.nav-icon { 
  font-size: 22px; 
  transition: transform 0.2s ease;
}

.nav-text { 
  font-size: 10px; 
  font-weight: 800; 
  letter-spacing: 0.3px;
}

.nav-cart-wrapper { position: relative; display: flex; align-items: center; }

.cart-count {
  position: absolute; 
  top: -6px; 
  right: -10px;
  background: #7A2942; 
  color: white; 
  min-width: 18px; 
  height: 18px; 
  border-radius: 9px;
  font-size: 10px; 
  font-weight: 900;
  display: flex; 
  align-items: center; 
  justify-content: center;
  border: 2px solid #111111;
  padding: 0 4px;
}

/* ═══════════════════════════════════════
   CATEGORY CHIPS
═══════════════════════════════════════ */
.category-chips-section { display: flex; flex-direction: column; gap: 4px; margin-top: 2px; }
.chips-scroll-container { display: flex; align-items: center; gap: 6px; overflow-x: auto; scroll-behavior: smooth; }
.chips-scroll-container::-webkit-scrollbar { display: none; }
.chips-wrapper { display: flex; gap: 6px; flex-wrap: nowrap; }
.category-chip {
  padding: 6px 14px; 
  background: #FFFFFF; 
  border: 1px solid rgba(0,0,0,0.06); 
  border-radius: 18px;
  cursor: pointer; 
  font-size: 12px; 
  font-weight: 800; 
  white-space: nowrap; 
  color: #444; 
  height: 34px;
  display: flex; 
  align-items: center; 
  transition: all 0.2s ease;
}
.category-chip.active { 
  background: #7A2942; 
  color: white; 
  border-color: #7A2942;
  box-shadow: 0 4px 10px rgba(255, 0, 4, 0.25); 
}
.chips-expand-btn { 
  min-width: 34px; 
  height: 34px; 
  border-radius: 17px; 
  background: #FFFFFF; 
  border: 1px solid rgba(0,0,0,0.06); 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  cursor: pointer; 
  color: #333;
}
.chips-expand-btn.expanded #expandArrow { transform: rotate(180deg); }
#expandArrow { transition: transform 0.2s ease; }

.category-expanded-menu { 
  display: none; 
  background: #FFFFFF; 
  border-radius: 14px; 
  padding: 10px; 
  flex-wrap: wrap; 
  gap: 6px; 
  margin-top: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}
.category-expanded-menu.open { display: flex; }
.category-menu-item { 
  flex: 0 1 calc(50% - 3px); 
  padding: 10px; 
  background: #F8F8F8; 
  border-radius: 10px; 
  font-size: 12px; 
  font-weight: 800; 
  border: none; 
  cursor: pointer; 
  color: #333;
}
.category-menu-item.active { background: #7A2942; color: white; }

/* ═══════════════════════════════════════
   PRODUCT CARDS
═══════════════════════════════════════ */
.products {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
@media (min-width: 768px) {
  .products { grid-template-columns: repeat(4, 1fr); gap: 16px; }
}

.card {
  background: #FFFFFF;
  border-radius: 18px;
  overflow: hidden; 
  position: relative;
  box-shadow: 0 4px 14px rgba(0,0,0,0.04);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid rgba(0,0,0,0.03);
  transition: transform 0.2s ease;
}
.card:active { transform: scale(0.98); }

.card-image-wrapper { position: relative; width: 100%; overflow: hidden; background: #f0f0f0; }
.card-img {
  width: 100%; aspect-ratio: 1 / 1;
  object-fit: cover; display: block;
}
.card-content { padding: 12px; flex-grow: 1; display: flex; flex-direction: column; justify-content: space-between; }
.product-name { font-size: 14px; font-weight: 800; line-height: 1.25; margin-bottom: 4px; color: #111; }
.description { font-size: 11px; color: #666; margin-bottom: 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.price-container { margin-top: auto; display: flex; align-items: baseline; gap: 4px; }
.price { color: #0a8a0a; font-size: 16px; font-weight: 900; }
.initial-price { text-decoration: line-through; color: #aaa; font-size: 11px; }

/* TAGS */
.product-tags { position: absolute; top: 8px; right: 8px; display: flex; flex-direction: column; gap: 4px; z-index: 10; align-items: flex-end; }
.tag-badge { background: #111111; color: #FFFFFF; padding: 4px 8px; border-radius: 8px; font-size: 9px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.5px; }

/* ACTION BUTTONS */
.add-btn, .checkout-btn, .done-btn {
  background: #7A2942; 
  color: #FFFFFF; 
  border: none; 
  border-radius: 12px;
  font-weight: 900; 
  font-family: 'Nunito', sans-serif; 
  cursor: pointer; 
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: opacity 0.2s, transform 0.1s;
}
.add-btn:active, .checkout-btn:active, .done-btn:active { opacity: 0.88; transform: scale(0.98); }
.add-btn { width: 100%; padding: 11px; font-size: 13px; margin-top: 10px; }
.checkout-btn { padding: 14px; font-size: 15px; }
.dispatch-btn { background: #0a8a0a; }

.quantity-box { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 10px; }
.qty-btn { 
  width: 32px; 
  height: 32px; 
  border: none; 
  border-radius: 8px; 
  background: #7A2942; 
  color: #fff; 
  cursor: pointer; 
  display: flex; 
  align-items: center; 
  justify-content: center;
}

/* ═══════════════════════════════════════
   MODAL & DRAWERS DESIGN
═══════════════════════════════════════ */
.modal-overlay { 
  position: fixed; inset: 0; 
  background: rgba(0,0,0,0.55); 
  display: flex; z-index: 9999; 
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s ease;
}
.modal-overlay.open { opacity: 1; pointer-events: auto; }

.cart-overlay { align-items: flex-end; padding: 0; }

.cart-slide-box {
  background: #FFFFFF; width: 100%; max-width: 600px; margin: 0 auto;
  border-radius: 28px 28px 0 0; padding: 24px; max-height: 85vh; overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.modal-overlay.open .cart-slide-box { transform: translateY(0); }

.register-box, .variant-box {
  background: #FFFFFF; width: 100%; max-width: 480px; 
  border-radius: 24px; padding: 24px; 
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  transform: scale(0.92); transition: transform 0.25s ease;
}
.modal-overlay.open .register-box, .modal-overlay.open .variant-box { transform: scale(1); }

.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.modal-title { font-size: 18px; font-weight: 900; color: #111; display: flex; align-items: center; gap: 8px; }
.modal-icon { font-size: 22px; color: #111; }
.modal-subtitle { font-size: 13px; color: #666; margin-bottom: 18px; line-height: 1.4; }
.close-modal { 
  width: 32px; 
  height: 32px; 
  border: none; 
  border-radius: 50%; 
  background: #F0F0F0; 
  cursor: pointer; 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  color: #333;
}

/* ═══════════════════════════════════════
   FORM LAYOUTS
═══════════════════════════════════════ */
.form-group { display: flex; flex-direction: column; gap: 6px; text-align: left; }
.form-group label { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px; color: #555; }
.form-group input { padding: 12px 14px; border: 1.5px solid #E2E2E2; border-radius: 12px; font-family: 'Nunito', sans-serif; font-weight: 700; outline: none; transition: border-color 0.2s; }
.form-group input:focus { border-color: #000000; }
.required { color: #7A2942; }
.validation-msg { font-size: 11px; color: #7A2942; display: none; margin-top: 2px; }

/* ═══════════════════════════════════════
   VARIANTS MODAL ROW
═══════════════════════════════════════ */
.variant-rows-container { 
  display: flex; 
  flex-direction: column; 
  gap: 12px; 
  margin-top: 14px; 
  max-height: 60vh; 
  overflow-y: auto; 
}

.variant-row {
  display: flex; 
  align-items: center; 
  justify-content: space-between; 
  gap: 12px;
  background: #FFFFFF; 
  border: 1px solid rgba(0, 0, 0, 0.08); 
  padding: 10px; 
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

/* Image on the left */
.variant-img {
  width: 65px;
  height: 65px;
  object-fit: cover;
  border-radius: 10px;
  background: #F0F0F0;
  flex-shrink: 0;
}

/* Details in the middle */
.variant-info { 
  flex: 1; 
  display: flex; 
  flex-direction: column; 
  justify-content: center;
  min-width: 0;
}

.variant-info .product-name {
  font-size: 13px;
  font-weight: 800;
  color: #111111;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.variant-info .description {
  font-size: 11px;
  color: #666666;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.variant-info .price-container {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

/* Add button / Quantity on the right */
.variant-action { 
  min-width: 75px; 
  display: flex; 
  justify-content: flex-end; 
  align-items: center;
  flex-shrink: 0;
}
/* ═══════════════════════════════════════
   CART DETAILS
═══════════════════════════════════════ */
.cart-item-row { display: flex; gap: 12px; margin-bottom: 16px; align-items: center; border-bottom: 1px solid #EEEEEE; padding-bottom: 16px; }
.cart-item-row img { width: 60px; height: 60px; object-fit: cover; border-radius: 12px; background: #f0f0f0; }
.cart-item-info { flex: 1; }
.summary-box { margin-top: 16px; background: #FFF7F8; padding: 16px; border-radius: 14px; font-size: 16px; font-weight: 800; border: 1px solid rgba(0,0,0,0.06); }

.empty-state { text-align: center; padding: 40px 20px; font-weight: 800; color: #666; }
.empty-state .material-symbols-outlined { font-size: 48px; color: #AAA; display: block; margin: 0 auto 10px; }

.verified-card { background: #FFF7F8; border: 1px solid #111111; padding: 16px; }
.verified-badge { font-size: 11px; font-weight: 900; color: #0a8a0a; margin-bottom: 12px; text-transform: uppercase; display: flex; align-items: center; gap: 4px; }

/* ═══════════════════════════════════════
   DETAILS VIEW
═══════════════════════════════════════ */
.details-container { padding: 8px; }
.details-container h2 { font-size: 24px; font-weight: 900; color: #111; margin-bottom: 16px; }
.details-card { background: #FFFFFF; border-radius: 20px; padding: 20px; box-shadow: 0 4px 12px rgba(0,0,0,0.03); border: 1px solid #EEEEEE; }
.info-row { display: flex; flex-direction: column; margin-bottom: 16px; }
.info-row:last-child { margin-bottom: 0; }
.info-row .label { font-size: 11px; color: #777; font-weight: 800; text-transform: uppercase; margin-bottom: 4px; letter-spacing: 0.5px; }
.info-row .value { font-size: 16px; font-weight: 900; color: #111; }

/* BANNERS */
#bannerCarousel { width: 100%; overflow: hidden; margin-bottom: 16px; border-radius: 16px; background: #fff; }
.banner-track-outer { position: relative; }
.banner-track { display: flex; transition: transform 0.4s ease-out; }
.banner-slide { flex: 0 0 100%; width: 100%; cursor: default; }
.banner-slide.clickable { cursor: pointer; }
.banner-img { width: 100%; height: auto; border-radius: 16px; display: block; }

.banner-dots { display: flex; justify-content: center; gap: 6px; margin: 8px 0; }
.banner-dot { width: 8px; height: 8px; background: #ddd; border-radius: 50%; cursor: pointer; }
.banner-dot.active { background: #7A2942; width: 18px; border-radius: 4px; }

/* LOADER & UTILITIES */
#loadingOverlay { position: fixed; z-index: 999999; inset: 0; background: rgba(255,255,255,0.85); display: flex; align-items: center; justify-content: center; }
.loader { border: 5px solid #F3F3F3; border-top: 5px solid #7A2942; border-radius: 50%; width: 44px; height: 44px; animation: spin 0.8s linear infinite; }
@keyframes spin { 0% { transform: rotate(0deg);} 100% { transform: rotate(360deg);} }