/* ============================================================
   BASE — design tokens + components shared by every page.
   Each page (home.css, cakes.css, about.css, contact.css)
   layers its own distinct look on top of this.
   ============================================================ */

:root{
  --cream:      #FBF3E7;
  --box-lid:    #F6E4D2;
  --choc:       #3D2B1F;
  --choc-soft:  #6B5544;
  --blush:      #F2B8C6;
  --blush-deep: #E497AC;
  --gold:       #C9973B;
  --berry:      #A63446;
  --paper:      #FFFDF9;
  --line:       #E4D3BE;
  --radius:     18px;
  --maxw:       1180px;
}

*{ box-sizing:border-box; }
html{ scroll-behavior:smooth; }
body{
  margin:0;
  background:var(--cream);
  color:var(--choc);
  font-family:'Work Sans', sans-serif;
  -webkit-font-smoothing:antialiased;
}
h1,h2,h3,.display{
  font-family:'Fraunces', serif;
  font-weight:600;
  letter-spacing:-0.01em;
  margin:0;
}
img{ max-width:100%; display:block; }
button{ font-family:inherit; cursor:pointer; }
a{ color:inherit; text-decoration:none; }
.wrap{ max-width:var(--maxw); margin:0 auto; padding:0 28px; }

@media(prefers-reduced-motion: reduce){
  *{ transition:none !important; scroll-behavior:auto !important; animation:none !important; }
}

/* ---------- Buttons (shared vocabulary, each page can restyle) ---------- */
.btn-primary{
  background:var(--berry); color:#fff; border:none;
  padding:14px 26px; border-radius:999px; font-weight:600; font-size:0.95rem;
  transition:transform .15s ease; display:inline-block;
}
.btn-primary:hover{ transform:translateY(-2px); }
.btn-ghost{
  background:transparent; border:1.5px solid var(--choc);
  padding:14px 26px; border-radius:999px; font-weight:600; font-size:0.95rem;
  display:inline-block;
}
.btn-add{
  background:var(--choc); color:var(--cream); border:none;
  padding:15px; border-radius:999px; font-weight:700; font-size:0.98rem; width:100%;
}
.btn-whatsapp{
  display:flex; align-items:center; justify-content:center; gap:9px;
  background:#25D366; color:#fff; border:none;
  padding:15px; border-radius:999px; font-weight:700; font-size:0.98rem; width:100%;
}
.btn-whatsapp svg{ width:20px; height:20px; fill:#fff; }

/* ---------- Top bar / nav ---------- */
.topbar{
  position:sticky; top:0; z-index:200;
  display:flex; align-items:center; justify-content:space-between;
  padding:16px 28px;
  background:rgba(251,243,231,0.92);
  backdrop-filter:blur(8px);
  border-bottom:1px solid var(--line);
}
.logo{
  font-family:'Fraunces', serif; font-size:1.5rem; font-weight:700;
  display:flex; align-items:center; gap:8px;
}
.logo .dot{ color:var(--berry); }

.navlinks{ display:flex; align-items:center; gap:6px; }
.navlinks a{
  font-size:0.92rem; font-weight:600; color:var(--choc-soft);
  padding:9px 14px; border-radius:999px;
}
.navlinks a:hover{ background:var(--box-lid); color:var(--choc); }
.navlinks a.active{ background:var(--choc); color:var(--cream); }

.topbar-actions{ display:flex; align-items:center; gap:14px; }
.icon-btn{
  position:relative;
  background:var(--paper); border:1px solid var(--line); border-radius:50%;
  width:44px; height:44px;
  display:flex; align-items:center; justify-content:center;
  transition:transform .15s ease, box-shadow .15s ease;
}
.icon-btn:hover{ transform:translateY(-2px); box-shadow:0 6px 14px rgba(61,43,31,0.12); }
.cart-count{
  position:absolute; top:-6px; right:-6px;
  background:var(--berry); color:#fff; font-size:0.68rem; font-weight:700;
  min-width:18px; height:18px; border-radius:9px;
  display:flex; align-items:center; justify-content:center; padding:0 4px;
}
.hamburger{
  display:none; background:none; border:none; width:44px; height:44px;
  flex-direction:column; align-items:center; justify-content:center; gap:5px;
}
.hamburger span{ display:block; width:22px; height:2px; background:var(--choc); border-radius:2px; }

.mobile-nav{
  display:none; flex-direction:column;
  position:fixed; top:76px; left:0; right:0; z-index:190;
  background:var(--paper); border-bottom:1px solid var(--line);
  padding:10px 20px 20px;
  box-shadow:0 14px 30px rgba(61,43,31,0.1);
}
.mobile-nav.open{ display:flex; }
.mobile-nav a{
  padding:14px 6px; font-weight:600; font-size:1.02rem;
  border-bottom:1px solid var(--line); color:var(--choc);
}
.mobile-nav a:last-child{ border-bottom:none; }

@media(max-width:860px){
  .navlinks{ display:none; }
  .hamburger{ display:flex; }
}

/* ---------- Footer ---------- */
footer.site-footer{
  margin-top:60px; border-top:1px solid var(--line);
  background:var(--box-lid);
}
.footer-grid{
  display:grid; grid-template-columns:1.3fr 1fr 1fr; gap:40px;
  padding:50px 28px 30px; max-width:var(--maxw); margin:0 auto;
}
.footer-grid h4{ font-family:'Fraunces',serif; font-size:1rem; margin-bottom:14px; }
.footer-grid p, .footer-grid a{ font-size:0.88rem; color:var(--choc-soft); line-height:1.9; display:block; }
.footer-grid a:hover{ color:var(--berry); }
.footer-bottom{
  text-align:center; padding:18px 20px 26px; font-size:0.8rem; color:var(--choc-soft);
  border-top:1px solid var(--line);
}
@media(max-width:760px){
  .footer-grid{ grid-template-columns:1fr; gap:28px; }
}

/* ---------- Product modal ---------- */
.overlay{
  position:fixed; inset:0; background:rgba(61,43,31,0.45);
  display:none; align-items:flex-end; justify-content:center;
  z-index:300;
}
.overlay.open{ display:flex; }
@media(min-width:760px){ .overlay{ align-items:center; padding:24px; } }

.modal{
  background:var(--paper); width:100%; max-width:860px;
  border-radius:24px 24px 0 0;
  max-height:92vh; overflow-y:auto;
  display:grid; grid-template-columns:1fr;
}
@media(min-width:760px){ .modal{ border-radius:24px; grid-template-columns:1fr 1fr; } }

.modal-photo{ aspect-ratio:1/1; background:var(--box-lid); overflow:hidden; position:relative; }
.modal-photo img{ width:100%; height:100%; object-fit:cover; }
.modal-close{
  position:absolute; top:14px; right:14px;
  background:var(--paper); border:none; border-radius:50%;
  width:36px; height:36px; font-size:1.1rem; font-weight:700;
  display:flex; align-items:center; justify-content:center;
  box-shadow:0 4px 10px rgba(0,0,0,0.15);
}
.modal-body{ padding:30px 28px 32px; display:flex; flex-direction:column; }
.modal-body h2{ font-size:1.6rem; font-style:italic; margin-bottom:6px; }
.modal-tags{ display:flex; gap:8px; flex-wrap:wrap; margin:10px 0 16px; }
.tag{
  background:var(--cream); border:1px solid var(--line);
  border-radius:999px; padding:5px 12px; font-size:0.78rem; font-weight:600; color:var(--choc-soft);
}
.modal-desc{ font-size:0.94rem; color:var(--choc-soft); line-height:1.6; margin-bottom:18px; }
.modal-price{ display:flex; align-items:baseline; gap:10px; margin-bottom:18px; }
.modal-price .now{ font-family:'Fraunces',serif; font-size:1.9rem; font-weight:700; color:var(--berry); }
.modal-price .was{ font-size:1rem; text-decoration:line-through; color:var(--choc-soft); }
.modal-price .save{ background:var(--berry); color:#fff; font-size:0.72rem; font-weight:700; padding:3px 9px; border-radius:6px; }

.field-label{ font-size:0.82rem; font-weight:700; color:var(--choc-soft); margin-bottom:8px; display:block; }
.select-row{ margin-bottom:18px; }
.weight-select{
  width:100%; padding:12px 14px; border-radius:12px; border:1.5px solid var(--line);
  font-family:inherit; font-size:0.95rem; background:var(--paper); color:var(--choc); font-weight:600;
}
.qty-row{ display:flex; align-items:center; gap:14px; margin-bottom:18px; }
.qty-row .field-label{ margin-bottom:0; }
.qty-control{ display:flex; align-items:center; border:1.5px solid var(--line); border-radius:999px; overflow:hidden; }
.qty-control button{ background:var(--cream); border:none; width:36px; height:36px; font-size:1.1rem; font-weight:700; }
.qty-control .qty-val{ width:38px; text-align:center; font-weight:700; }

.custom-textarea{
  width:100%; min-height:78px; padding:12px 14px; border-radius:14px;
  border:1.5px solid var(--line); font-family:inherit; font-size:0.9rem;
  resize:vertical; margin-bottom:20px; background:var(--paper); color:var(--choc);
}
.custom-textarea::placeholder{ color:#B7A793; }

.modal-actions{ display:flex; flex-direction:column; gap:10px; margin-top:auto; }

/* ---------- Cart drawer ---------- */
.drawer-overlay{ position:fixed; inset:0; background:rgba(61,43,31,0.4); display:none; z-index:310; }
.drawer-overlay.open{ display:block; }
.drawer{
  position:fixed; top:0; right:-420px; width:100%; max-width:420px; height:100%;
  background:var(--paper); z-index:320;
  transition:right .25s ease; display:flex; flex-direction:column;
  box-shadow:-10px 0 30px rgba(0,0,0,0.15);
}
.drawer.open{ right:0; }
.drawer-head{ padding:22px 22px 16px; border-bottom:2px dashed var(--line); display:flex; align-items:center; justify-content:space-between; }
.drawer-head h3{ font-size:1.4rem; font-style:italic; }
.drawer-items{ flex:1; overflow-y:auto; padding:10px 22px; }
.drawer-item{ display:flex; gap:12px; padding:16px 0; border-bottom:1px solid var(--line); }
.drawer-item img{ width:64px; height:64px; border-radius:10px; object-fit:cover; background:var(--box-lid); }
.drawer-item-info{ flex:1; }
.drawer-item-info h4{ font-family:'Work Sans'; font-size:0.93rem; font-weight:700; margin:0 0 2px; }
.drawer-item-info .meta{ font-size:0.76rem; color:var(--choc-soft); }
.drawer-item-row{ display:flex; align-items:center; justify-content:space-between; margin-top:8px; }
.remove-btn{ background:none; border:none; color:var(--berry); font-size:0.78rem; font-weight:600; text-decoration:underline; }
.empty-cart{ text-align:center; padding:60px 20px; color:var(--choc-soft); }
.drawer-foot{ padding:20px 22px 26px; border-top:2px dashed var(--line); background:var(--cream); }
.drawer-total{ display:flex; justify-content:space-between; align-items:baseline; font-family:'Fraunces',serif; font-size:1.25rem; font-weight:700; margin-bottom:14px; }
.drawer-total .label{ font-family:'Work Sans'; font-size:0.82rem; font-weight:600; color:var(--choc-soft); }
.drawer-note{ font-size:0.74rem; color:var(--choc-soft); margin-bottom:14px; line-height:1.5; }

/* ---------- Product card (shared by home + all-cakes grids) ---------- */
.card{
  background:var(--paper); border-radius:var(--radius); border:1px solid var(--line);
  overflow:hidden; cursor:pointer;
  transition:transform .18s ease, box-shadow .18s ease;
  display:flex; flex-direction:column;
}
.card:hover{ transform:translateY(-5px); box-shadow:0 16px 30px rgba(61,43,31,0.13); }
.card-photo{ position:relative; aspect-ratio:4/3; background:var(--box-lid); overflow:hidden; }
.card-photo img{ width:100%; height:100%; object-fit:cover; }
.ribbon{
  position:absolute; top:12px; left:-6px; background:var(--berry); color:#fff;
  font-size:0.72rem; font-weight:700; padding:5px 12px 5px 16px; border-radius:0 4px 4px 0;
}
.ribbon::after{ content:""; position:absolute; left:0; bottom:-6px; border-width:6px 6px 0 0; border-style:solid; border-color:#7a2233 transparent transparent transparent; }
.card-body{ padding:16px 16px 18px; display:flex; flex-direction:column; gap:5px; flex:1; }
.card-body h3{ font-size:1.08rem; font-weight:600; line-height:1.25; }
.card-meta{ font-size:0.8rem; color:var(--choc-soft); }
.card-price-row{ margin-top:auto; padding-top:12px; display:flex; align-items:center; justify-content:space-between; }
.price{ font-family:'Fraunces',serif; font-size:1.15rem; font-weight:700; }
.price .strike{ font-family:'Work Sans',sans-serif; font-size:0.82rem; color:var(--choc-soft); text-decoration:line-through; font-weight:500; margin-left:6px; }
.view-btn{ background:var(--cream); border:1px solid var(--line); border-radius:999px; padding:7px 14px; font-size:0.78rem; font-weight:600; }

/* ---------- Responsive grid used by both catalog pages ---------- */
.product-grid{
  display:grid; grid-template-columns:repeat(auto-fill, minmax(240px, 1fr)); gap:24px;
}
@media(max-width:520px){
  .product-grid{ grid-template-columns:repeat(auto-fill, minmax(160px, 1fr)); gap:14px; }
  .card-body{ padding:12px 12px 14px; }
  .card-body h3{ font-size:0.95rem; }
}
.signin-modal{ background:var(--paper); border-radius:22px; padding:36px 30px; max-width:380px; width:100%; text-align:center; }
.signin-modal h3{ font-size:1.4rem; font-style:italic; margin-bottom:8px; }
.signin-modal p{ font-size:0.88rem; color:var(--choc-soft); margin-bottom:20px; line-height:1.5; }
