/* ============================================
   MASKABARI – Premium Tea Brand
   style.css – Custom styles on top of Tailwind
   ============================================ */

/* ---- CSS Variables ---- */
:root {
  --forest: #1a3a2a;
  --forest-light: #2d7a58;
  --cream: #f5f0e8;
  --cream-dark: #ede3d0;
  --gold: #b8973a;
  --gold-light: #d4b05a;
  --font-serif: 'Cormorant Garamond', serif;
  --font-sans: 'Jost', sans-serif;
}

/* ---- Base ---- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body { background-color: var(--cream); }

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--cream-dark); }
::-webkit-scrollbar-thumb { background: var(--forest-light); }
.scrollbar-none::-webkit-scrollbar { display: none; }
.scrollbar-none { -ms-overflow-style: none; scrollbar-width: none; }

/* ---- Selection ---- */
::selection { background: var(--gold); color: var(--cream); }

/* ============================================
   BUTTONS
   ============================================ */

.btn-gold {
  display: inline-block;
  background-color: var(--gold);
  color: var(--cream);
  letter-spacing: 0.2em;
  font-weight: 400;
  font-family: var(--font-sans);
  transition: background-color 0.25s ease, transform 0.15s ease;
  cursor: pointer;
  text-decoration: none;
}
.btn-gold:hover {
  background-color: var(--gold-light);
  transform: translateY(-1px);
}

.btn-outline-light {
  display: inline-block;
  border: 1px solid rgba(245, 240, 232, 0.5);
  color: var(--cream);
  font-family: var(--font-sans);
  font-weight: 400;
  transition: background-color 0.25s ease, border-color 0.25s ease;
  text-decoration: none;
}
.btn-outline-light:hover {
  background-color: rgba(245, 240, 232, 0.1);
  border-color: rgba(245, 240, 232, 0.8);
}

.btn-forest-outline {
  display: inline-block;
  border: 1px solid var(--forest);
  color: var(--forest);
  font-family: var(--font-sans);
  transition: background-color 0.25s ease, color 0.25s ease;
  text-decoration: none;
}
.btn-forest-outline:hover {
  background-color: var(--forest);
  color: var(--cream);
}

.btn-gold-outline {
  display: inline-block;
  border: 1px solid var(--gold);
  color: var(--gold);
  font-family: var(--font-sans);
  transition: background-color 0.25s ease, color 0.25s ease;
  text-decoration: none;
}
.btn-gold-outline:hover {
  background-color: var(--gold);
  color: var(--cream);
}

/* ============================================
   FILTER BUTTONS (Tab style)
   ============================================ */
.filter-btn {
  padding: 6px 18px;
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-weight: 400;
  color: #4d7062;
  border: 1px solid #c8baa0;
  background: transparent;
  cursor: pointer;
  transition: all 0.2s ease;
}
.filter-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
}
.filter-btn.active {
  background-color: var(--forest);
  border-color: var(--forest);
  color: var(--cream);
}

/* ============================================
   PRODUCT CARDS
   ============================================ */
.product-card {
  transition: box-shadow 0.3s ease;
}
.product-card:hover {
  box-shadow: 0 8px 40px rgba(26, 58, 42, 0.12);
}

/* Add to cart micro-feedback */
.add-to-cart-btn.added {
  background-color: var(--gold) !important;
}

/* ============================================
   LAZY IMAGES
   ============================================ */
.lazy-img {
  opacity: 0;
  transition: opacity 0.6s ease;
  background: #ede3d0;
}
.lazy-img.loaded {
  opacity: 1;
}

/* ============================================
   HERO ANIMATIONS
   ============================================ */
@keyframes revealUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

.reveal-up {
  opacity: 0;
  animation: revealUp 0.9s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes pulseSlow {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 0.3; }
}
.animate-pulse-slow { animation: pulseSlow 2.5s ease-in-out infinite; }

/* ============================================
   FADE-IN SECTIONS (Intersection Observer)
   ============================================ */
.fade-in-section {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.fade-in-section.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================
   REVIEW SLIDER
   ============================================ */
#reviewTrack {
  will-change: transform;
}

/* ============================================
   CART DRAWER
   ============================================ */
#cartDrawer {
  box-shadow: -4px 0 60px rgba(26, 58, 42, 0.2);
}
#cartDrawer.open {
  transform: translateX(0);
}

.cart-item-row {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #ede3d0;
  align-items: flex-start;
}
.cart-item-row img {
  width: 56px;
  height: 70px;
  object-fit: cover;
  flex-shrink: 0;
}
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 300;
  color: var(--forest);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cart-item-price {
  font-family: var(--font-serif);
  font-size: 14px;
  color: #4d7062;
}
.cart-item-qty {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}
.cart-qty-btn {
  width: 22px;
  height: 22px;
  border: 1px solid #c8baa0;
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  color: var(--forest);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s;
  font-family: var(--font-sans);
}
.cart-qty-btn:hover { border-color: var(--gold); color: var(--gold); }
.cart-qty-val {
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--forest);
  min-width: 16px;
  text-align: center;
}
.cart-remove-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #a09080;
  padding: 2px;
  transition: color 0.2s;
  flex-shrink: 0;
  margin-top: 2px;
}
.cart-remove-btn:hover { color: #c0392b; }

/* ============================================
   NAVBAR scroll state
   ============================================ */
#navbar.scrolled {
  box-shadow: 0 2px 20px rgba(26,58,42,0.08);
}

/* ============================================
   TOAST NOTIFICATION
   ============================================ */
#toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--forest);
  color: var(--cream);
  font-family: var(--font-sans);
  font-size: 12px;
  letter-spacing: 0.1em;
  padding: 12px 24px;
  z-index: 200;
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.22,1,0.36,1), opacity 0.4s ease;
  white-space: nowrap;
  pointer-events: none;
}
#toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ============================================
   GRAIN TEXTURE OVERLAY (subtle premium feel)
   ============================================ */
.hero-grain::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
  opacity: 0.04;
  pointer-events: none;
  z-index: 1;
}

/* ============================================
   FORM INPUTS – Focus gold ring
   ============================================ */
input:focus, select:focus, textarea:focus {
  outline: none;
  box-shadow: 0 0 0 1.5px var(--gold);
}

/* ============================================
   ACCORDION (product page)
   ============================================ */
.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}

/* ============================================
   UTILITIES
   ============================================ */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---- Transition for cart drawer ---- */
.transition-transform {
  transition-property: transform;
  transition-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
  transition-duration: 0.4s;
}

/* ---- Page Load Body fade-in ---- */
@keyframes bodyFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
body { animation: bodyFadeIn 0.4s ease forwards; }

/* ============================================
   RESPONSIVE OVERRIDES
   ============================================ */
@media (max-width: 640px) {
  .product-card .font-serif { font-size: 15px; }
  .filter-btn { padding: 5px 12px; font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
