/* ═══════════════════════════════════════════════════════════════════
   Twins Royal Cakes — Design System (Warm Cream/Royal Theme)
   Server-rendered site — ported from the React app's globals.css.
   Fonts are loaded via <link> tags in includes/header.php, not @import
   here — @import is render-blocking in a way <link> isn't.
   ═══════════════════════════════════════════════════════════════════ */

/* ── Brand Tokens ───────────────────────────────────────────────── */
:root {
  --cream:   #FFF9F5;
  --royal:   #5C1A1A;
  --caramel: #C87941;
  --blush:   #FCF0E8;
  --dark:    #1A0A08;
  --muted:   #9B7B6E;
  --white:   #FFFFFF;
  --green-wa: #25D366;

  /* Alias tokens — some older page templates use these names */
  --choc:        #1A0A08;
  --choc-mid:    #5C1A1A;
  --choc-light:  #9B7B6E;
  --gold:        #C87941;
  --gold-light:  #D4945A;
  --gold-pale:   #FCF0E8;
  --text-dark:   #1A0A08;
  --text-mid:    #9B7B6E;
  --text-light:  #9B7B6E;

  --bs-primary: #5C1A1A;
  --bs-primary-rgb: 92, 26, 26;
  --bs-link-color: #5C1A1A;
  --bs-link-hover-color: #C87941;
  --bs-body-bg: #FFF9F5;
  --bs-body-color: #1A0A08;
  --bs-body-font-family: 'DM Sans', sans-serif;
  --bs-border-color: rgba(92, 26, 26, 0.1);
  --bs-border-radius: 20px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'DM Sans', sans-serif;
  font-weight: 400;
  color: var(--dark);
  background-color: var(--cream);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Typography ─────────────────────────────────────────────────── */
h1, h2, h3, h4, h5 {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  line-height: 1.15;
  color: var(--dark);
}
h1 { font-size: clamp(2rem, 5vw, 3rem); }
h2 { font-size: clamp(1.75rem, 4vw, 2.7rem); }
h3 { font-size: 1.6rem; }
h4 { font-size: 1.3rem; }
h5 { font-size: 1.1rem; }
.display-serif, .display-serif-bold { font-family: 'Playfair Display', serif; font-weight: 700; }

a { color: var(--royal); text-decoration: none; transition: color 0.3s ease; }
a:hover { color: var(--caramel); }

/* ── Section Utilities ──────────────────────────────────────────── */
section { padding: 5.5rem 0; }
.section-tag {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--caramel);
  margin-bottom: 0.5rem;
}
.section-dark { background-color: var(--dark); color: var(--blush); }
.section-blush { background-color: var(--blush); }

/* ── Buttons ──────────────────────────────────────────────────────── */
.btn {
  border-radius: 50px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  letter-spacing: 0.02em;
  font-size: 0.92rem;
  padding: 0.65rem 1.7rem;
  transition: all 0.25s ease;
}
.btn-primary, .btn-gold {
  background-color: var(--royal);
  border-color: var(--royal);
  color: var(--white);
  border: 2px solid var(--royal);
}
.btn-primary:hover, .btn-gold:hover {
  background-color: var(--dark);
  border-color: var(--dark);
  color: var(--white);
  transform: translateY(-2px);
}
.btn-outline-gold { border: 2px solid var(--royal); color: var(--royal); background: transparent; }
.btn-outline-gold:hover { background-color: var(--royal); color: var(--white); transform: translateY(-2px); }
.btn-whatsapp { background-color: var(--green-wa); border-color: var(--green-wa); color: var(--white); }
.btn-whatsapp:hover { background-color: #1da851; border-color: #1da851; color: var(--white); }

/* ── Cards ────────────────────────────────────────────────────────── */
.card { border: none; border-radius: 20px; background: var(--white); overflow: hidden; transition: all 0.3s ease; }
.card:hover { transform: translateY(-7px); box-shadow: 0 20px 50px rgba(92, 26, 26, 0.11); }

/* Product card — used in Bestsellers, Shop page */
.product-card:hover { transform: translateY(-7px); box-shadow: 0 20px 50px rgba(92,26,26,0.1); }
.product-card:hover .card-overlay { opacity: 1 !important; }
.product-card:hover img { transform: scale(1.06); }

/* ── Forms ────────────────────────────────────────────────────────── */
.form-control, .form-select {
  border-color: rgba(92, 26, 26, 0.14);
  border-radius: 12px;
  background-color: var(--cream);
  color: var(--dark);
  font-family: 'DM Sans', sans-serif;
  padding: 0.65rem 0.9rem;
  font-size: 0.9rem;
}
.form-control:focus, .form-select:focus {
  border-color: var(--caramel);
  box-shadow: 0 0 0 3px rgba(200, 121, 65, 0.1);
  background-color: var(--cream);
}
.form-label { font-size: 0.82rem; font-weight: 600; color: var(--dark); margin-bottom: 0.4rem; }

/* ── Navbar ───────────────────────────────────────────────────────── */
.navbar { transition: all 0.3s ease; }
.nav-link {
  font-size: 0.88rem !important;
  font-weight: 500;
  color: var(--dark) !important;
  padding: 0.4rem 1rem !important;
}
.nav-link:hover, .nav-link.active { color: var(--royal) !important; }

/* ── Scroll reveal (progressive enhancement — content is already in the
   HTML either way, this just animates it in; see assets/js/main.js) ── */
.reveal { opacity: 0; transform: translateY(30px); transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1); }
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal-children > * { opacity: 0; transform: translateY(20px); transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1); }
.reveal-children.visible > *:nth-child(1) { transition-delay: 0s;    opacity: 1; transform: translateY(0); }
.reveal-children.visible > *:nth-child(2) { transition-delay: 0.1s;  opacity: 1; transform: translateY(0); }
.reveal-children.visible > *:nth-child(3) { transition-delay: 0.15s; opacity: 1; transform: translateY(0); }
.reveal-children.visible > *:nth-child(4) { transition-delay: 0.2s;  opacity: 1; transform: translateY(0); }
.reveal-children.visible > *:nth-child(5) { transition-delay: 0.25s; opacity: 1; transform: translateY(0); }
.reveal-children.visible > *:nth-child(6) { transition-delay: 0.3s;  opacity: 1; transform: translateY(0); }

.gold-divider { width: 60px; height: 2px; background: var(--caramel); margin: 1rem 0; }

/* ── Skeleton shimmer ─────────────────────────────────────────────── */
/* Matches the warm palette — blush base, slightly darker shimmer sweep. */
@keyframes shimmer {
  0%   { background-position: -600px 0; }
  100% { background-position:  600px 0; }
}
.skeleton {
  display: block;
  background: linear-gradient(90deg,
    var(--blush) 25%,
    #f0e0d2 50%,
    var(--blush) 75%
  );
  background-size: 600px 100%;
  animation: shimmer 1.4s ease-in-out infinite;
  border-radius: 8px;
}

/* Image loading wrapper — skeleton shimmer while img is loading */
.img-wrap {
  position: relative;
  overflow: hidden;
  display: block;
}
.img-wrap > img,
.img-wrap > .prod-img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* When skeleton is removed the shimmer stops and background is transparent */
.img-wrap:not(.skeleton) { background: none; animation: none; }

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--cream); }
::-webkit-scrollbar-thumb { background: var(--muted); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--royal); }

.img-placeholder {
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--blush), var(--cream));
  color: var(--muted);
  font-family: 'Playfair Display', serif;
  font-size: 0.85rem; font-weight: 600; letter-spacing: 0.05em;
  border-radius: 16px;
}

.hide-scrollbar { scrollbar-width: none; -ms-overflow-style: none; }
.hide-scrollbar::-webkit-scrollbar { display: none; }

/* Gallery tile hover (see pages/gallery.php) */
.gallery-tile:hover img { transform: scale(1.08); }
.gallery-tile:hover .gallery-overlay { background: rgba(26,8,0,0.3) !important; }
.gallery-tile:hover .gallery-overlay svg { opacity: 0.8 !important; }
.gallery-filter-btn:hover { color: var(--gold) !important; }

@media (max-width: 768px) {
  h1 { font-size: 2rem; } h2 { font-size: 1.6rem; } h3 { font-size: 1.3rem; }
  section { padding: 3.5rem 0; }
}
@media (max-width: 480px) {
  h1 { font-size: 1.7rem; } h2 { font-size: 1.4rem; }
  .btn { padding: 0.55rem 1.3rem; font-size: 0.85rem; }
}
@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal-children > * { transition: none; }
}

/* ── Hero Slider Animations (mirror HeroSlider.jsx @keyframes) ──── */
@keyframes blobFloat {
  0%,  100% { border-radius: 60% 40% 55% 45% / 50% 55% 45% 50%; transform: translateY(0);     }
  50%        { border-radius: 45% 55% 40% 60% / 55% 45% 55% 45%; transform: translateY(-12px); }
}
@keyframes imgFloat {
  0%, 100% { transform: translateY(0);     }
  50%       { transform: translateY(-12px); }
}
.hero-blob { animation: blobFloat 8s ease-in-out infinite; }
.hero-img  { animation: imgFloat  8s ease-in-out infinite; transition: opacity 0.6s ease; }

/* ── Category card image zoom on hover ─────────────────────────── */
.col-6 a:hover img, .col-md-3 a:hover img { transform: scale(1.06); }
.cat-card:hover img { transform: scale(1.06); }

/* ── Card inner image zoom on hover ────────────────────────────── */
.card:hover img { transform: scale(1.05); }
.card img { transition: transform 0.5s ease; }

/* ── TopBar social icon hover ───────────────────────────────────── */
.topbar-social {
  color: rgba(255,255,255,0.55);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
}
.topbar-social:hover { color: var(--caramel); }

/* ── Mobile Cart FAB (mirrors MobileCartButton.jsx) ─────────────── */
.mobile-cart-fab {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 1000;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--royal);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(92,26,26,0.35);
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.mobile-cart-fab:hover { transform: scale(1.1); color: var(--white); }
/* Hidden on desktop — the navbar cart link is enough there */
@media (min-width: 992px) {
  .mobile-cart-fab { display: none !important; }
}
