@import url('theme.css');
@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@600;700&family=Inter:wght@300;400;500;600;700;800&family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200&display=swap');

/* Google Material Symbols Outlined Support */
.material-symbols-outlined {
  font-family: 'Material Symbols Outlined', sans-serif !important;
  font-weight: normal;
  font-style: normal;
  font-size: 24px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-smoothing: antialiased;
}

/* Global Reset & Base Styles */
*, ::before, ::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-family: var(--font-sans);
  height: auto;
  overflow-x: clip;
  overflow-y: visible;
}

body {
  background-color: var(--color-bg-main);
  color: var(--color-text-primary);
  min-height: 100vh;
  height: auto;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow-x: clip;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
}

/* Responsive Image & Media Reset */
img, video, canvas {
  max-width: 100%;
  height: auto;
}

/* Flexible Container Boundaries */
div, section, article, a, button, main, header, footer {
  min-width: 0;
}

/* Typography Helpers */
.font-cursive {
  font-family: var(--font-cursive);
}

/* Custom Scrollbar Utility */
.scrollbar-none::-webkit-scrollbar,
.custom-scrollbar::-webkit-scrollbar {
  display: none;
}

.scrollbar-none,
.custom-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Mobile Horizontal Scroll Snap */
.snap-x-container {
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.snap-x-item {
  scroll-snap-align: start;
}

/* Interactive Hover Animations */
.hover-lift {
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease;
}

@media (min-width: 768px) {
  .hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-card);
  }
}

/* Brand Badge Utilities */
.badge-orange {
  background-color: var(--color-primary-light);
  color: var(--color-primary);
  font-weight: 700;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.badge-navy {
  background-color: var(--color-navy-light);
  color: var(--color-text-white);
  font-weight: 600;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

/* Global Toast Notification Banner */
#shopever-toast-container {
  position: fixed;
  bottom: 80px;
  right: 16px;
  left: 16px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

@media (min-width: 640px) {
  #shopever-toast-container {
    bottom: 24px;
    right: 24px;
    left: auto;
    max-width: 380px;
  }
}

.shopever-toast {
  pointer-events: auto;
  background-color: var(--color-navy);
  color: #ffffff;
  padding: 12px 18px;
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 30px rgba(12, 30, 54, 0.25);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  font-weight: 500;
  transform: translateY(20px);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  border-left: 4px solid var(--color-primary);
}

.shopever-toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* Button & Popup Animations */
@keyframes cartBtnSuccess {
  0% { transform: scale(1); }
  40% { transform: scale(0.92); }
  75% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

.animate-btn-pop {
  animation: cartBtnSuccess 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes badgePop {
  0% { transform: scale(1); }
  50% { transform: scale(1.4); }
  100% { transform: scale(1); }
}

.animate-badge-pop {
  animation: badgePop 0.4s ease-in-out forwards;
}

@keyframes popupSlideIn {
  from {
    transform: translateY(-20px) scale(0.92);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.animate-popup-slide {
  animation: popupSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes popupProgress {
  from { width: 100%; }
  to { width: 0%; }
}

/* App shell: phone layout reads as a native shopping app */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

#mobile-bottom-nav a {
  cursor: pointer;
  border-radius: 14px;
  transition: color 0.2s ease, background-color 0.2s ease;
}

header nav a {
  flex-shrink: 0;
}

/* Keep the search button inside the pill, vertically centered */
header form button[aria-label="Search"] {
  position: absolute !important;
  top: 50% !important;
  right: 4px !important;
  bottom: auto !important;
  left: auto !important;
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  min-height: 36px !important;
  margin: 0 !important;
  padding: 0 !important;
  transform: translateY(-50%) !important;
}

header form input[type="text"],
header form input[type="search"] {
  min-height: 44px;
  padding-right: 48px !important;
}

#mobile-bottom-nav a.is-active {
  color: var(--color-primary);
  background: var(--color-primary-light);
}

@media (max-width: 767px) {
  html {
    -webkit-text-size-adjust: 100%;
  }

  body {
    background-color: #f3f5f8;
    align-items: stretch;
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
    overflow-y: visible;
    padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px));
  }

  main,
  header,
  footer {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  main > * {
    max-width: 100%;
    min-width: 0;
  }


  header {
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.06);
  }

  header .text-\[7px\],
  header .text-\[8px\] {
    display: none;
  }

  /* Category row becomes a horizontal chip scroller */
  header nav {
    display: block !important;
  }

  header nav > div {
    gap: 8px !important;
    padding: 10px 16px !important;
  }

  header nav a {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0 14px !important;
    border-radius: 999px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #0c1e36;
  }

  header nav a[class*="bg-"] {
    background: #f95f00 !important;
    border-color: transparent;
    color: #ffffff !important;
  }

  main {
    padding-top: 12px !important;
    padding-bottom: 8px !important;
  }

  input,
  select,
  textarea {
    font-size: 16px !important;
  }

  header button[aria-label]:not([aria-label="Search"]),
  header a[aria-label="Wishlist"],
  header a[aria-label="Cart"],
  header a[aria-label="Toggle Mobile Menu"] {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  #mobile-bottom-nav {
    min-height: calc(64px + env(safe-area-inset-bottom, 0px));
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px)) !important;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid #e2e8f0;
    box-shadow: 0 -8px 28px rgba(12, 30, 54, 0.08);
  }

  #mobile-bottom-nav > a {
    flex: 1;
    min-height: 48px;
    justify-content: center;
    gap: 2px;
    padding: 4px 2px;
  }

  #mobile-bottom-nav svg {
    width: 22px;
    height: 22px;
  }

  #shopever-toast-container {
    bottom: calc(84px + env(safe-area-inset-bottom, 0px));
    left: 12px;
    right: 12px;
  }

  #shopever-whatsapp-float {
    bottom: calc(88px + env(safe-area-inset-bottom, 0px)) !important;
    right: 14px !important;
    width: 52px;
    height: 52px;
    padding: 0 !important;
  }

  body:has(#checkout-form) #shopever-whatsapp-float {
    display: none;
  }

  #product-cta-bar button,
  #place-whatsapp-order-btn,
  #cart-checkout-btn {
    min-height: 48px;
    font-size: 14px;
  }

  #home-products-grid h3,
  #todays-deals-grid h3,
  #you-may-also-like-grid h3,
  #similar-products-grid h3 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    white-space: normal;
    min-height: 2.5em;
  }

  #home-products-grid .grid button,
  #home-products-grid .grid > a,
  #todays-deals-grid .grid button,
  #todays-deals-grid .grid > a,
  #you-may-also-like-grid .grid button,
  #you-may-also-like-grid .grid > a,
  #similar-products-grid .grid button,
  #similar-products-grid .grid > a,
  #cart-items-list button {
    min-height: 44px;
  }

  #cart-items-list button {
    min-width: 44px;
  }

  .grid.grid-cols-2 > .border-l {
    border-left-width: 0 !important;
    padding-left: 0 !important;
  }

  footer a.rounded-full,
  form + div a.rounded-full {
    width: 40px;
    height: 40px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
