/* ===========================================================
   Cocoa & Crumb — custom styles
   (Tailwind handles utility classes; this file covers
   animation, glassmorphism, and components Tailwind can't.)
=========================================================== */

:root {
  --chocolate: #4A2C2A;
  --cream: #FFF8F0;
  --caramel: #D4A373;
  --accent: #8B4513;
  --fudge: #2A1715;
}

* {
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
}

body {
  overflow-x: hidden;
}

/* ---------- Accessibility ---------- */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--chocolate);
  color: var(--cream);
  padding: 10px 18px;
  border-radius: 0 0 12px 0;
  z-index: 100;
  font-weight: 700;
  font-size: 14px;
}
.skip-link:focus {
  left: 0;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Header ---------- */
#site-header {
  background: transparent;
}
#site-header.scrolled {
  background: rgba(255, 248, 240, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 rgba(74, 44, 42, 0.08), 0 8px 24px -8px rgba(74,44,42,0.1);
}

.nav-link {
  position: relative;
  transition: color 0.2s ease;
}
.nav-link::after {
  content: '';
  position: absolute;
  left: 0; bottom: -6px;
  width: 0; height: 2px;
  background: var(--caramel);
  transition: width 0.25s ease;
  border-radius: 2px;
}
.nav-link:hover {
  color: var(--accent);
}
.nav-link:hover::after {
  width: 100%;
}

/* ---------- Glassmorphism card ---------- */
.glass-card {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px) saturate(160%);
  -webkit-backdrop-filter: blur(12px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.6);
}

/* ---------- Signature drip divider ---------- */
.drip-divider {
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  line-height: 0;
  pointer-events: none;
}

/* ---------- Scroll reveal ---------- */
[data-animate] {
  opacity: 0;
  will-change: transform, opacity;
}
[data-animate="fade-up"] {
  transform: translateY(28px);
  transition: opacity 0.7s cubic-bezier(0.16,1,0.3,1), transform 0.7s cubic-bezier(0.16,1,0.3,1);
  transition-delay: var(--delay, 0ms);
}
[data-animate="fade-in"] {
  transform: scale(0.96);
  transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.16,1,0.3,1);
  transition-delay: var(--delay, 0ms);
}
[data-animate].in-view {
  opacity: 1;
  transform: translateY(0) scale(1);
}

@media (prefers-reduced-motion: reduce) {
  [data-animate] {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ---------- Product Cards ---------- */
.product-card {
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(74, 44, 42, 0.07);
  box-shadow: 0 4px 12px rgba(74, 44, 42, 0.02), 0 1px 3px rgba(74, 44, 42, 0.01);
  transition: transform 0.4s cubic-bezier(0.16,1,0.3,1), box-shadow 0.4s ease, border-color 0.4s ease;
  display: flex;
  flex-direction: column;
}
@media (min-width: 640px) {
  .product-card {
    border-radius: 18px;
    box-shadow: 0 8px 20px rgba(74, 44, 42, 0.03), 0 2px 5px rgba(74, 44, 42, 0.02);
  }
}
.product-card:hover {
  transform: translateY(-5px);
  border-color: rgba(74, 44, 42, 0.16);
  box-shadow: 0 12px 28px -4px rgba(74, 44, 42, 0.1), 0 4px 12px -2px rgba(74, 44, 42, 0.04);
}
.product-card .img-wrap {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4/3;
}
.product-card .img-wrap img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.16,1,0.3,1);
}
.product-card:hover .img-wrap img {
  transform: scale(1.06);
}
.product-badge {
  position: absolute;
  top: 8px; left: 8px;
  background: rgba(255,248,240,0.94);
  backdrop-filter: blur(6px);
  color: var(--accent);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 4px 8px;
  border-radius: 999px;
  text-transform: uppercase;
}
@media (min-width: 640px) {
  .product-badge {
    top: 12px; left: 12px;
    font-size: 11px;
    padding: 5px 11px;
  }
}

/* Qty stepper */
.qty-stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(74,44,42,0.12);
  border-radius: 10px;
  overflow: hidden;
}
@media (min-width: 640px) {
  .qty-stepper {
    border-width: 1.5px;
    border-radius: 14px;
  }
}
.qty-stepper button {
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 11px;
  color: var(--chocolate);
  background: transparent;
  transition: background 0.2s ease;
}
@media (min-width: 640px) {
  .qty-stepper button {
    width: 32px; height: 32px;
    font-size: 13px;
  }
}
.qty-stepper button:hover {
  background: rgba(74,44,42,0.06);
}
.qty-stepper button:active {
  transform: scale(0.9);
}
.qty-stepper span {
  width: 20px;
  text-align: center;
  font-weight: 700;
  font-size: 11px;
  color: var(--chocolate);
}
@media (min-width: 640px) {
  .qty-stepper span {
    width: 28px;
    font-size: 13px;
  }
}

/* ---------- Feature cards (Why Us) ---------- */
.feature-card {
  background: rgba(255,248,240,0.06);
  border: 1px solid rgba(255,248,240,0.1);
  border-radius: 22px;
  padding: 28px 22px;
  transition: transform 0.4s cubic-bezier(0.16,1,0.3,1), background 0.3s ease;
  text-align: left;
}
.feature-card:hover {
  transform: translateY(-6px);
  background: rgba(255,248,240,0.1);
}
.feature-icon {
  font-size: 30px;
  width: 56px; height: 56px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(212,163,115,0.18);
  border-radius: 16px;
  margin-bottom: 16px;
}
.feature-card h3 { color: var(--cream) !important; }

/* ---------- Review cards ---------- */
.review-card {
  background: #fff;
  border-radius: 22px;
  padding: 26px;
  box-shadow: 0 2px 8px rgba(74,44,42,0.06), 0 1px 2px rgba(74,44,42,0.04);
  transition: transform 0.35s cubic-bezier(0.16,1,0.3,1), box-shadow 0.35s ease;
}
.review-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 16px 30px -8px rgba(74,44,42,0.18);
}
.review-stars {
  color: var(--caramel);
  letter-spacing: 2px;
  font-size: 14px;
}

/* ---------- Timeline ---------- */
.timeline {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
}
@media (min-width: 768px) {
  .timeline {
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
  }
  .timeline::before {
    content: '';
    position: absolute;
    top: 26px;
    left: 5%;
    right: 5%;
    height: 2px;
    background: repeating-linear-gradient(to right, rgba(74,44,42,0.2) 0, rgba(74,44,42,0.2) 8px, transparent 8px, transparent 16px);
    z-index: 0;
  }
}
.timeline-step {
  position: relative;
  display: flex;
  flex-direction: row;
  gap: 16px;
  z-index: 1;
}
@media (min-width: 768px) {
  .timeline-step {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
}
.timeline-marker {
  flex-shrink: 0;
  width: 52px; height: 52px;
  border-radius: 16px;
  background: var(--chocolate);
  color: var(--cream);
  display: flex; align-items: center; justify-content: center;
  font-family: inherit;
  font-weight: 800;
  font-size: 18px;
  box-shadow: 0 8px 18px -4px rgba(74,44,42,0.4);
  position: relative;
}
.timeline-content {
  flex: 1;
}
@media (min-width: 768px) {
  .timeline-content { padding: 0 4px; }
}

/* ---------- Buttons / Ripple ---------- */
.btn-ripple {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.ripple-circle {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.45);
  transform: scale(0);
  animation: ripple-anim 0.6s ease-out;
  pointer-events: none;
}
@keyframes ripple-anim {
  to {
    transform: scale(3.2);
    opacity: 0;
  }
}

/* ---------- Social / footer links ---------- */
.social-icon {
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 16px;
  background: rgba(255,248,240,0.08);
  color: var(--cream);
  transition: background 0.25s ease, transform 0.25s ease, color 0.25s ease;
}
.social-icon:hover {
  background: var(--caramel);
  color: var(--fudge);
  transform: translateY(-2px);
}
.footer-link {
  color: inherit;
  transition: color 0.2s ease;
}
.footer-link:hover {
  color: var(--caramel);
}

/* ---------- Cart Drawer ---------- */
.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(42, 23, 21, 0.55);
  backdrop-filter: blur(2px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
  z-index: 60;
}
.cart-overlay.open {
  opacity: 1;
  visibility: visible;
}

.cart-drawer {
  position: fixed;
  top: 0; right: 0;
  height: 100%;
  width: 100%;
  max-width: 420px;
  background: var(--cream);
  z-index: 70;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.16,1,0.3,1);
  box-shadow: -10px 0 40px rgba(0,0,0,0.15);
}
.cart-drawer.open {
  transform: translateX(0);
}

.cart-line-item {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 2px 6px rgba(74,44,42,0.05);
  animation: item-in 0.35s cubic-bezier(0.16,1,0.3,1);
}
@keyframes item-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.cart-line-item img {
  width: 60px; height: 60px;
  object-fit: cover;
  border-radius: 16px;
  flex-shrink: 0;
}
.cart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  height: 100%;
  padding: 40px 20px;
  color: rgba(74,44,42,0.5);
}

/* ---------- Checkout Modal ---------- */
.checkout-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  visibility: hidden;
  pointer-events: none;
}
@media (min-width: 768px) {
  .checkout-modal {
    align-items: center;
  }
}
.checkout-modal.open {
  visibility: visible;
  pointer-events: auto;
}
.checkout-modal-inner {
  background: var(--cream);
  width: 100%;
  max-width: 560px;
  max-height: 92vh;
  overflow-y: auto;
  border-radius: 24px 24px 0 0;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.16,1,0.3,1);
}
@media (min-width: 768px) {
  .checkout-modal-inner {
    border-radius: 24px;
    transform: translateY(24px) scale(0.97);
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.16,1,0.3,1), opacity 0.35s ease;
  }
}
.checkout-modal.open .checkout-modal-inner {
  transform: translateY(0) scale(1);
  opacity: 1;
}

/* ---------- Form ---------- */
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--chocolate);
  margin-bottom: 6px;
}
.form-input {
  width: 100%;
  padding: 13px 16px;
  border-radius: 16px;
  border: 1.5px solid rgba(74,44,42,0.14);
  background: #fff;
  font-size: 14.5px;
  color: var(--chocolate);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.form-input::placeholder {
  color: rgba(74,44,42,0.35);
}
.form-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(139,69,19,0.1);
}
.form-input.invalid {
  border-color: #C0392B;
}
.form-error {
  color: #C0392B;
  font-size: 12px;
  margin-top: 5px;
  min-height: 0;
  display: none;
}
.form-error.show {
  display: block;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translate(-50%, 20px);
  background: var(--chocolate);
  color: var(--cream);
  padding: 14px 22px;
  border-radius: 16px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 10px 30px -5px rgba(0,0,0,0.3);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 90vw;
  text-align: center;
}
.toast.show {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

/* ---------- Misc ---------- */
select.form-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%234A2C2A' stroke-width='2.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19.5 8.25l-7.5 7.5-7.5-7.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 16px;
  padding-right: 40px;
}

::selection {
  background: var(--caramel);
  color: var(--fudge);
}

img {
  -webkit-user-drag: none;
}

/* ---------- Category Tabs & Variants ---------- */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.sticky-tabs-container {
  position: sticky;
  top: 64px;
  z-index: 30;
  background: rgba(255, 248, 240, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1.5px solid rgba(74, 44, 42, 0.05);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
@media (min-width: 768px) {
  .sticky-tabs-container {
    top: 80px;
  }
}
.menu-tab {
  white-space: nowrap;
  padding: 8px 18px;
  border-radius: 20px;
  border: 1.5px solid rgba(74, 44, 42, 0.12);
  background: transparent;
  color: var(--chocolate);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  outline: none;
}
.menu-tab.active {
  background: var(--chocolate);
  color: var(--cream);
  border-color: var(--chocolate);
  box-shadow: 0 4px 12px rgba(74, 44, 42, 0.15);
}
.menu-tab:hover:not(.active) {
  border-color: var(--chocolate);
  background: rgba(74, 44, 42, 0.04);
}
.menu-tab:active:not(.active) {
  transform: scale(0.97);
}

.menu-category-section {
  scroll-margin-top: 132px; /* Offset for sticky header and tabs on mobile */
}
@media (min-width: 768px) {
  .menu-category-section {
    scroll-margin-top: 162px; /* Offset on desktop */
  }
}

.variant-select-wrap {
  position: relative;
  width: 100%;
}
select.variant-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%238B4513' stroke-width='2.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19.5 8.25l-7.5 7.5-7.5-7.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px;
  padding-right: 28px;
  padding-top: 6px;
  padding-bottom: 6px;
  padding-left: 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid rgba(74, 44, 42, 0.12);
  background-color: var(--cream);
  color: var(--chocolate);
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  width: 100%;
  outline: none;
}
@media (min-width: 640px) {
  select.variant-select {
    background-position: right 12px center;
    background-size: 14px;
    padding-right: 32px;
    padding-top: 9px;
    padding-bottom: 9px;
    padding-left: 12px;
    font-size: 13px;
    border-radius: 12px;
    border-width: 1.5px;
  }
}
select.variant-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(139, 69, 19, 0.08);
}

/* ===========================================================
   Modern Food-Commerce Redesign Styles
   =========================================================== */

/* Shift WhatsApp CTA when Sticky Cart Bar is active */
#whatsapp-float {
  transition: bottom 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.25s ease, background-color 0.2s ease !important;
}
body.cart-bar-active #whatsapp-float {
  bottom: 84px !important;
}
@media (min-width: 768px) {
  body.cart-bar-active #whatsapp-float {
    bottom: 112px !important;
  }
}

/* Added feedback badge animation */
@keyframes pop-added-feedback {
  0% {
    opacity: 0;
    transform: translate(-50%, 8px) scale(0.9);
  }
  15% {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
  80% {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -8px) scale(0.95);
  }
}
.animate-added-feedback {
  animation: pop-added-feedback 1.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Make product card images have slightly less height on mobile for compact layout */
@media (max-width: 640px) {
  .product-card .img-wrap {
    aspect-ratio: 16/11;
  }
}

