/* ==========================================================================
   Sambal by Kazel - Master Stylesheet
   UI/UX Pro Max Architecture & Micro-Interactions
   Cloudflare Pages Edition
   ========================================================================== */

/* 1. Touch Targets & Accessibility Defaults */
.tap-target {
  min-height: 44px;
  min-width: 44px;
}

html {
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  color: #1d1b18;
  background-color: #fef9f3;
  overflow-x: hidden;
}

/* 2. Material Symbols Outlined */
.material-symbols-outlined {
  font-family: 'Material Symbols Outlined';
  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-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  user-select: none;
  vertical-align: middle;
}

.material-symbols-outlined.fill {
  font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* 3. Custom Scrollbars & Hide Scrollbar Utilities */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f8f3ed;
}

::-webkit-scrollbar-thumb {
  background: #e6bdb8;
  border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
  background: #916f6b;
}

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

.scrollbar-none::-webkit-scrollbar,
.no-scrollbar::-webkit-scrollbar {
  display: none;
}

/* 4. Top Marquee Promo Ticker Animation */
.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 25s linear infinite;
}

.marquee-track:hover {
  animation-play-state: paused;
}

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

/* 5. Mobile Drawer & Backdrop Overlay */
#drawer-overlay {
  transition: opacity 0.3s ease, visibility 0.3s ease;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

#drawer-overlay.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

#mobile-drawer {
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  transform: translateX(100%);
  will-change: transform;
}

#mobile-drawer.open {
  transform: translateX(0);
}

/* 6. Toast Notifications */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 16px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  max-width: calc(100vw - 32px);
}

@media (min-width: 768px) {
  #toast-container {
    bottom: 24px;
    right: 24px;
    max-width: 420px;
  }
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  background: #1d1b18;
  color: #ffffff;
  padding: 12px 18px;
  border-radius: 14px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.2);
  border-left: 4px solid #b70011;
  font-size: 0.875rem;
  font-weight: 500;
  animation: slideInUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast.fade-out {
  opacity: 0;
  transform: translateY(10px);
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 7. Product Image Card & Fallback Transitions */
.img-fallback-wrapper {
  position: relative;
  overflow: hidden;
  background: #f2ede7;
}

.img-fallback-wrapper img {
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.product-card:hover .img-fallback-wrapper img {
  transform: scale(1.05);
}

/* 8. Micro-Interactions & Stepper Buttons */
.qty-btn {
  min-width: 36px;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s ease, transform 0.1s ease;
}

.qty-btn:active {
  transform: scale(0.92);
}

/* 9. Accordion Transition */
.accordion-content {
  transition: max-height 0.35s cubic-bezier(0, 1, 0, 1), opacity 0.3s ease;
  max-height: 0;
  overflow: hidden;
}

.accordion-content.open {
  max-height: 600px;
  transition: max-height 0.45s ease-in-out, opacity 0.3s ease;
}

/* 10. Shimmer Loading placeholder */
.shimmer-bg {
  background: linear-gradient(90deg, #f2ede7 25%, #f8f3ed 50%, #f2ede7 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

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

/* 11. Blend mode utility for logo & graphics */
.mix-blend-multiply {
  mix-blend-mode: multiply;
}

/* 12. Shake animation for PIN & error feedback */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

.animate-shake {
  animation: shake 0.5s ease-in-out;
}
