/* ==========================================================================
   TITO CAKES & EVENTS — GLOBAL STYLES
   Design tokens, reset, typography, and shared components used sitewide.
   ========================================================================== */

/* ---- Design tokens -------------------------------------------------- */
:root {
  /* Brand colors */
  --pink: #E91E63;
  --pink-dark: #C2185B;
  --pink-soft: #FBE4EC;
  --white: #FFFFFF;
  --gold: #D4AF37;
  --gold-light: #E9CE7C;
  --gold-dark: #A9861F;
  --grey: #F8F8F8;
  --charcoal: #333333;
  --charcoal-soft: #6B6B6B;

  /* Typography */
  --font-display: 'Cormorant Garamond', serif;
  --font-body: 'Montserrat', sans-serif;

  /* Spacing scale */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.75rem;
  --space-lg: 3rem;
  --space-xl: 5rem;
  --space-2xl: 8rem;

  /* Layout */
  --max-width: 1280px;
  --radius-sm: 6px;
  --radius-md: 14px;
  --radius-lg: 28px;

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur-fast: 0.25s;
  --dur-med: 0.5s;
  --dur-slow: 0.9s;

  /* Shadows */
  --shadow-sm: 0 4px 16px rgba(51, 51, 51, 0.08);
  --shadow-md: 0 12px 40px rgba(51, 51, 51, 0.12);
  --shadow-gold: 0 8px 30px rgba(212, 175, 55, 0.25);
}

/* ---- Reset ------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; overflow-x: hidden; }

@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;
    scroll-behavior: auto !important;
  }
}

body {
  font-family: var(--font-body);
  color: var(--charcoal);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: inherit; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  color: var(--charcoal);
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

/* ---- Focus states (accessibility) ------------------------------------ */
a:focus-visible, button:focus-visible, input:focus-visible,
textarea:focus-visible, select:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--pink);
  color: var(--white);
  padding: 0.9rem 1.5rem;
  z-index: 1000;
  font-weight: 600;
  border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { left: 0; }

/* ---- Eyebrow label ------------------------------------------------------ */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--pink);
  margin-bottom: var(--space-sm);
}
.eyebrow::before { content: ''; width: 28px; height: 1px; background: var(--gold); }
.eyebrow-light { color: var(--gold-light); }
.eyebrow-light::before { background: var(--white); }

.section-heading { font-size: clamp(2rem, 4vw, 3rem); margin-bottom: var(--space-sm); }
.section-heading em { font-style: italic; color: var(--pink); }
.section-intro { max-width: 620px; color: var(--charcoal-soft); font-size: 1.05rem; }
.section-head { text-align: center; max-width: 700px; margin: 0 auto var(--space-xl); }
.section-head .section-intro { margin: 0 auto var(--space-sm); }

.section { padding: var(--space-2xl) 0; }
.section-alt { background: var(--grey); }
.section-dark { background: var(--charcoal); color: rgba(255,255,255,0.85); }

/* ---- Signature element: gold icing-swirl divider ---------------------- */
.swirl-divider {
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto var(--space-xl); width: fit-content; color: var(--gold);
}
.swirl-divider svg { width: 90px; height: 22px; }
.swirl-divider svg path {
  stroke: var(--gold); stroke-width: 1.6; fill: none; stroke-linecap: round;
  stroke-dasharray: 160; stroke-dashoffset: 160;
  transition: stroke-dashoffset 1.4s var(--ease);
}
.swirl-divider.in-view svg path { stroke-dashoffset: 0; }

/* ---- Buttons ------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.6rem;
  padding: 0.95rem 2rem; border-radius: 999px;
  font-size: 0.82rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease),
              background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
  white-space: nowrap;
}
.btn:hover { transform: translateY(-3px); }
.btn:active { transform: translateY(-1px); }

.btn-primary { background: var(--pink); color: var(--white); box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--pink-dark); box-shadow: var(--shadow-md); }

.btn-gold {
  background: linear-gradient(135deg, var(--gold-light), var(--gold) 60%, var(--gold-dark));
  color: var(--charcoal); box-shadow: var(--shadow-gold);
}
.btn-gold:hover { box-shadow: 0 12px 36px rgba(212, 175, 55, 0.4); }

.btn-outline { background: transparent; color: var(--white); border: 1.5px solid rgba(255,255,255,0.7); }
.btn-outline:hover { background: rgba(255,255,255,0.12); border-color: var(--white); }

.btn-outline-dark { background: transparent; color: var(--charcoal); border: 1.5px solid var(--charcoal); }
.btn-outline-dark:hover { background: var(--charcoal); color: var(--white); }

.btn-whatsapp { background: #25D366; color: var(--white); box-shadow: 0 8px 24px rgba(37,211,102,0.35); }
.btn-whatsapp:hover { background: #1ebc59; }

.btn-sm { padding: 0.65rem 1.3rem; font-size: 0.7rem; }

/* ---- Header / Navigation ---------------------------------------------- */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 500;
  padding: 0.7rem 0;
  /* Always-on dark fade behind the nav so it reads clearly over the hero
     image before the user scrolls, instead of sitting fully transparent
     on top of it. Replaced by a solid white bar once .scrolled is added. */
  background: linear-gradient(180deg, rgba(20,12,15,0.55) 0%, rgba(20,12,15,0.28) 65%, rgba(20,12,15,0) 100%);
  transition: background var(--dur-med) var(--ease), box-shadow var(--dur-med) var(--ease), padding var(--dur-med) var(--ease);
}
.site-header.scrolled {
  background: rgba(255,255,255,0.94); backdrop-filter: blur(10px);
  box-shadow: var(--shadow-sm); padding: 0.5rem 0;
}

.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: var(--space-sm); }

/* Logo: the image itself is the full "Tito Cakes & Events" wordmark, so it
   fills the header row height and there's no separate text beside it. */
.logo {
  display: flex; align-items: center; flex-shrink: 0;
}
.logo img {
  height: 128px; width: auto; object-fit: contain; display: block; flex-shrink: 0;
  transition: height var(--dur-med) var(--ease);
}
.site-header.scrolled .logo img { height: 92px; }

.main-nav { display: flex; align-items: center; gap: 1.15rem; min-width: 0; }
.nav-list { display: flex; align-items: center; gap: 1.05rem; flex-wrap: nowrap; }
.nav-list > li { position: relative; }

.nav-link {
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.045em; text-transform: uppercase;
  color: var(--white); padding: 0.5rem 0; position: relative; white-space: nowrap;
  transition: color var(--dur-fast) var(--ease);
}
.site-header.scrolled .nav-link { color: var(--charcoal); }
.nav-link::after {
  content: ''; position: absolute; left: 0; bottom: -2px; width: 0; height: 2px;
  background: var(--gold); transition: width var(--dur-fast) var(--ease);
}
.nav-link:hover::after, .nav-link[aria-expanded="true"]::after { width: 100%; }
.nav-link:hover { color: var(--gold); }

.has-dropdown > .nav-link { display: flex; align-items: center; gap: 0.3rem; }
.caret {
  width: 8px; height: 8px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg); transition: transform var(--dur-fast) var(--ease); margin-top: -3px;
}
.has-dropdown[aria-expanded="true"] .caret, .has-dropdown:hover .caret { transform: rotate(225deg); margin-top: 3px; }

.dropdown {
  position: absolute; top: 100%; left: 50%; transform: translateX(-50%) translateY(8px);
  min-width: 220px; background: var(--white); border-radius: var(--radius-md);
  box-shadow: var(--shadow-md); padding: 0.6rem; opacity: 0; visibility: hidden;
  transition: opacity var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease), visibility var(--dur-fast);
  border-top: 3px solid var(--gold);
}
.has-dropdown:hover .dropdown, .has-dropdown:focus-within .dropdown {
  opacity: 1; visibility: visible; transform: translateX(-50%) translateY(4px);
}
.dropdown li a {
  display: block; padding: 0.6rem 0.85rem; font-size: 0.8rem; font-weight: 500; color: var(--charcoal);
  border-radius: var(--radius-sm); white-space: nowrap;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), padding-left var(--dur-fast) var(--ease);
}
.dropdown li a:hover { background: var(--pink-soft); color: var(--pink-dark); padding-left: 1.1rem; }
.dropdown-all-link { font-weight: 700; color: var(--pink) !important; border-bottom: 1px solid rgba(51,51,51,0.08); border-radius: 0 !important; margin-bottom: 0.3rem; padding-bottom: 0.85rem !important; }

.nav-cta { display: flex; align-items: center; gap: 0.4rem; flex-shrink: 0; }

.nav-toggle {
  display: none; flex-direction: column; gap: 5px; z-index: 501; flex-shrink: 0;
  padding: 10px 8px; border-radius: 8px; background: rgba(20,12,15,0.5);
  transition: background var(--dur-med) var(--ease);
}
.nav-toggle span { width: 22px; height: 2px; background: var(--white); border-radius: 2px; transition: transform var(--dur-fast) var(--ease), opacity var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease); }
.site-header.scrolled .nav-toggle { background: transparent; padding: 10px 8px; }
.site-header.scrolled .nav-toggle span { background: var(--charcoal); }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---- Mobile / tablet accordion nav --------------------------------------
   Collapses to a hamburger below 1180px — nine nav items plus two CTA
   buttons don't comfortably fit a laptop viewport otherwise, so we hand
   off to the off-canvas menu earlier rather than letting items clip. */
@media (max-width: 1120px) {
  .nav-toggle { display: flex; }
  .main-nav {
    position: fixed; top: 0; right: 0; height: 100vh; width: min(85vw, 360px);
    background: var(--white); flex-direction: column; align-items: stretch;
    padding: 6.5rem var(--space-lg) var(--space-lg);
    transform: translateX(100%); transition: transform var(--dur-med) var(--ease);
    box-shadow: -10px 0 40px rgba(0,0,0,0.15); overflow-y: auto;
  }
  .main-nav.open { transform: translateX(0); }
  .nav-list { flex-direction: column; align-items: stretch; gap: 0; width: 100%; flex-wrap: wrap; }
  .nav-list > li { border-bottom: 1px solid rgba(51,51,51,0.08); }
  .nav-link { color: var(--charcoal) !important; padding: 1rem 0; width: 100%; justify-content: space-between; display: flex; font-size: 0.8rem; }
  .dropdown {
    position: static; transform: none; opacity: 1; visibility: visible; box-shadow: none; border-top: none;
    max-height: 0; overflow: hidden; padding: 0;
    transition: max-height var(--dur-med) var(--ease), padding var(--dur-med) var(--ease);
  }
  .has-dropdown[aria-expanded="true"] .dropdown { max-height: 500px; padding: 0.4rem 0 0.8rem; }
  .nav-cta { flex-direction: column; align-items: stretch; margin-top: var(--space-md); gap: 0.7rem; }
  .nav-cta .btn { width: 100%; }
}

@media (max-width: 768px) {
  .logo img { height: 84px; }
  .site-header.scrolled .logo img { height: 64px; }
}

@media (max-width: 480px) {
  .logo img { height: 62px; }
  .site-header.scrolled .logo img { height: 50px; }
}

/* ---- Floating WhatsApp button ------------------------------------------ */
.whatsapp-float {
  position: fixed; bottom: 24px; right: 24px; z-index: 400;
  width: 60px; height: 60px; border-radius: 50%; background: #25D366;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 30px rgba(37,211,102,0.45);
  animation: float-pulse 2.6s ease-in-out infinite;
  transition: transform var(--dur-fast) var(--ease);
}
.whatsapp-float:hover { transform: scale(1.08); }
.whatsapp-float svg { width: 30px; height: 30px; fill: var(--white); }
@keyframes float-pulse {
  0%, 100% { box-shadow: 0 10px 30px rgba(37,211,102,0.45); }
  50% { box-shadow: 0 10px 30px rgba(37,211,102,0.75), 0 0 0 10px rgba(37,211,102,0.12); }
}

/* ---- Back to top -------------------------------------------------------- */
.back-to-top {
  position: fixed; bottom: 24px; left: 24px; z-index: 400;
  width: 48px; height: 48px; border-radius: 50%; background: var(--charcoal); color: var(--white);
  display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-md);
  opacity: 0; visibility: hidden; transform: translateY(10px);
  transition: all var(--dur-fast) var(--ease); font-size: 1.1rem;
}
.back-to-top.visible { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { background: var(--pink); }

/* ---- Reveal-on-scroll utility -------------------------------------------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity var(--dur-slow) var(--ease), transform var(--dur-slow) var(--ease); }
.reveal.in-view { opacity: 1; transform: translateY(0); }
.reveal-delay-1.in-view { transition-delay: 0.1s; }
.reveal-delay-2.in-view { transition-delay: 0.2s; }
.reveal-delay-3.in-view { transition-delay: 0.3s; }
.reveal-delay-4.in-view { transition-delay: 0.4s; }

/* ---- Footer -------------------------------------------------------------- */
.site-footer { background: var(--charcoal); color: rgba(255,255,255,0.75); padding-top: var(--space-2xl); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: var(--space-lg); padding-bottom: var(--space-xl); border-bottom: 1px solid rgba(255,255,255,0.1); }
.footer-brand .logo { color: var(--white); margin-bottom: var(--space-sm); }
.footer-brand p { max-width: 320px; font-size: 0.9rem; line-height: 1.7; }
.footer-social { display: flex; gap: 0.7rem; margin-top: var(--space-md); }
.footer-social a { width: 40px; height: 40px; border: 1px solid rgba(255,255,255,0.25); border-radius: 50%; display: flex; align-items: center; justify-content: center; transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease); }
.footer-social a:hover { background: var(--pink); border-color: var(--pink); }
.footer-social svg { width: 18px; height: 18px; fill: var(--white); }

.footer-col h4 { font-family: var(--font-body); font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); margin-bottom: var(--space-md); }
.footer-col ul li { margin-bottom: 0.7rem; }
.footer-col ul li a { font-size: 0.9rem; transition: color var(--dur-fast) var(--ease), padding-left var(--dur-fast) var(--ease); display: inline-block; }
.footer-col ul li a:hover { color: var(--gold); padding-left: 4px; }
.footer-col address { font-style: normal; font-size: 0.9rem; line-height: 1.8; }
.footer-hours-row { display: flex; justify-content: space-between; font-size: 0.88rem; margin-bottom: 0.4rem; gap: 1rem; }

.footer-bottom { display: flex; justify-content: space-between; align-items: center; padding: var(--space-md) 0; font-size: 0.82rem; flex-wrap: wrap; gap: 0.6rem; }
.footer-bottom a { text-decoration: underline; text-underline-offset: 3px; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
