/* =========================================================
   MamaMia's Blooms — styles
   Palette: warm cream, botanical green, terracotta, plum, blush
   Fonts: Fraunces (display) + Nunito Sans (body)
   ========================================================= */

:root {
  --cream: #FBF6EE;
  --cream-2: #F5ECDF;
  --surface: #FFFFFF;
  --ink: #2E2A26;
  --muted: #6F675E;
  --green: #3E5540;
  --green-deep: #2C3E2E;
  --terracotta: #C25B46;
  --terracotta-dark: #A8452F;
  --plum: #6D4C68;
  --blush: #EFCDC5;
  --gold: #E7A83C;
  --border: #E7DCCB;
  --shadow: 0 18px 40px -24px rgba(46, 42, 38, 0.45);
  --shadow-sm: 0 8px 22px -16px rgba(46, 42, 38, 0.5);
  --radius: 18px;
  --radius-lg: 26px;
  --maxw: 1180px;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Nunito Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

/* The [hidden] attribute must always win, even over class rules that set
   `display` (overlays, mobile nav, cart badge). Without this, elements meant
   to start hidden — like the checkout overlay — render on top of the page. */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; scroll-padding-top: 90px; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }

a { color: var(--green); text-decoration: none; }
a:hover { color: var(--terracotta); }

h1, h2, h3 { font-family: var(--font-display); font-weight: 500; line-height: 1.08; color: var(--ink); margin: 0 0 .5em; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.4rem, 6vw, 4.1rem); }
h2 { font-size: clamp(1.8rem, 3.8vw, 2.9rem); }
h3 { font-size: 1.25rem; }
em { font-style: italic; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

.eyebrow {
  text-transform: uppercase;
  letter-spacing: .18em;
  font-size: .72rem;
  font-weight: 700;
  color: var(--terracotta);
  margin: 0 0 .8em;
}

.section-head { margin-bottom: 2.4rem; }
.section-head.center { text-align: center; max-width: 640px; margin-left: auto; margin-right: auto; }
.section-sub, .section-head p:not(.eyebrow) { color: var(--muted); font-size: 1.05rem; margin: .2rem 0 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  font-family: var(--font-body); font-weight: 700; font-size: .98rem;
  padding: .85em 1.6em; border-radius: 999px; border: 1.5px solid transparent;
  cursor: pointer; transition: transform .15s ease, background .2s ease, color .2s ease, box-shadow .2s ease;
  line-height: 1; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--terracotta); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--terracotta-dark); color: #fff; }
.btn-ghost { background: transparent; color: var(--green-deep); border-color: var(--green); }
.btn-ghost:hover { background: var(--green); color: #fff; }
.btn-block { width: 100%; }

/* ---------- Announcement ---------- */
.announce {
  background: var(--green-deep); color: #F3ECDD;
  font-size: .82rem; text-align: center; padding: .55rem 0; letter-spacing: .01em;
}
.announce .wrap { padding: 0 16px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(251, 246, 238, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 74px; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: .55rem; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand-mark { display: inline-flex; }
.brand-name { font-family: var(--font-display); font-size: 1.4rem; font-weight: 600; letter-spacing: -0.01em; }
.brand-name em { color: var(--terracotta); font-style: italic; font-weight: 500; }

.main-nav { display: flex; gap: 2rem; }
.main-nav a { color: var(--ink); font-weight: 600; font-size: .96rem; position: relative; }
.main-nav a::after { content: ""; position: absolute; left: 0; bottom: -6px; width: 0; height: 2px; background: var(--terracotta); transition: width .2s ease; }
.main-nav a:hover { color: var(--terracotta); }
.main-nav a:hover::after { width: 100%; }

.header-actions { display: flex; align-items: center; gap: .5rem; }
.cart-btn { position: relative; background: none; border: none; color: var(--ink); cursor: pointer; padding: 8px; border-radius: 12px; display: inline-flex; }
.cart-btn:hover { background: var(--cream-2); color: var(--terracotta); }
.cart-count {
  position: absolute; top: 0; right: 0; min-width: 18px; height: 18px; padding: 0 5px;
  background: var(--terracotta); color: #fff; border-radius: 999px; font-size: .68rem; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; line-height: 1;
}
.nav-toggle { display: none; background: none; border: none; color: var(--ink); cursor: pointer; padding: 6px; }

.mobile-nav { display: flex; flex-direction: column; padding: 8px 24px 18px; gap: 4px; border-bottom: 1px solid var(--border); background: var(--cream); }
.mobile-nav a { padding: 12px 6px; font-weight: 600; color: var(--ink); border-bottom: 1px solid var(--border); }
.mobile-nav a:last-child { border-bottom: none; }

/* ---------- Hero ---------- */
.hero { background: linear-gradient(180deg, var(--cream) 0%, var(--cream-2) 100%); padding: clamp(2.5rem, 6vw, 5rem) 0 clamp(3rem, 7vw, 6rem); }
.hero-inner { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
.hero-copy h1 { margin-bottom: .35em; }
.hero-copy h1 em { color: var(--terracotta); }
.lede { font-size: 1.18rem; color: var(--muted); max-width: 34ch; margin: 0 0 1.8rem; }
.hero-cta { display: flex; gap: .8rem; flex-wrap: wrap; margin-bottom: 1.4rem; }
.hero-note { font-size: .9rem; color: var(--muted); }
.hero-media { position: relative; }
.hero-media img { width: 100%; height: auto; border-radius: var(--radius-lg); box-shadow: var(--shadow); object-fit: cover; aspect-ratio: 4 / 5; }
.hero-badge {
  position: absolute; bottom: -18px; left: -18px;
  background: var(--green); color: #fff; font-family: var(--font-display); font-style: italic;
  font-size: 1rem; line-height: 1.15; text-align: center; padding: 1rem 1.2rem; border-radius: 50%;
  width: 110px; height: 110px; display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-sm); transform: rotate(-8deg);
}

/* ---------- Bloom Bar ---------- */
.bloom-bar { padding: clamp(3rem, 6vw, 5rem) 0; }
.occasions { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; }
.occasion {
  border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius);
  padding: 1.4rem 1rem; text-align: center; cursor: pointer; transition: transform .15s ease, box-shadow .2s ease, border-color .2s ease;
  display: flex; flex-direction: column; align-items: center; gap: .5rem; color: var(--ink); font-family: var(--font-body);
}
.occasion:hover { transform: translateY(-4px); box-shadow: var(--shadow-sm); border-color: var(--blush); }
.occasion .emoji { font-size: 1.9rem; line-height: 1; }
.occasion .oc-name { font-family: var(--font-display); font-size: 1.02rem; font-weight: 500; }
.occasion .oc-count { font-size: .76rem; color: var(--muted); }

/* ---------- Shop ---------- */
.shop { padding: clamp(2rem, 4vw, 3rem) 0 clamp(3.5rem, 7vw, 6rem); }
.shop-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; }
.filters { display: flex; gap: .5rem; flex-wrap: wrap; }
.filter {
  border: 1.4px solid var(--border); background: var(--surface); color: var(--ink);
  padding: .5em 1.1em; border-radius: 999px; font-family: var(--font-body); font-weight: 600; font-size: .88rem;
  cursor: pointer; transition: all .18s ease;
}
.filter:hover { border-color: var(--green); }
.filter.active { background: var(--green); color: #fff; border-color: var(--green); }

.product-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 26px; margin-top: 2rem; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column; transition: transform .18s ease, box-shadow .2s ease;
}
.card:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
.card-media { position: relative; aspect-ratio: 3 / 4; overflow: hidden; background: var(--cream-2); }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.card:hover .card-media img { transform: scale(1.05); }
.card-tag {
  position: absolute; top: 12px; left: 12px; background: rgba(255,255,255,.92); color: var(--green-deep);
  font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
  padding: .35em .7em; border-radius: 999px; backdrop-filter: blur(4px);
}
.card-body { padding: 1.1rem 1.15rem 1.25rem; display: flex; flex-direction: column; flex: 1; }
.card-name { font-family: var(--font-display); font-size: 1.22rem; font-weight: 500; margin: 0 0 .25rem; }
.card-desc { font-size: .9rem; color: var(--muted); margin: 0 0 1rem; flex: 1; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.card-price { font-family: var(--font-display); font-size: 1.15rem; font-weight: 600; }
.card-price small { font-size: .72rem; color: var(--muted); font-family: var(--font-body); font-weight: 600; }
.add-btn {
  background: var(--cream-2); color: var(--green-deep); border: 1.4px solid transparent;
  border-radius: 999px; padding: .55em 1.1em; font-family: var(--font-body); font-weight: 700; font-size: .86rem;
  cursor: pointer; transition: all .18s ease;
}
.add-btn:hover { background: var(--terracotta); color: #fff; }
.shop-foot { text-align: center; color: var(--muted); font-size: .92rem; margin-top: 2.6rem; max-width: 60ch; margin-left: auto; margin-right: auto; }
.empty { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 3rem 0; }

/* ---------- Editorial ---------- */
.editorial { background: var(--green-deep); color: #F3ECDD; padding: clamp(3rem, 6vw, 5.5rem) 0; }
.editorial-inner { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.editorial-media img { border-radius: var(--radius-lg); box-shadow: var(--shadow); aspect-ratio: 4/5; object-fit: cover; width: 100%; }
.editorial-copy h2 { color: #fff; }
.editorial-copy p { color: #DCD3C2; font-size: 1.05rem; }
.editorial-copy .eyebrow { color: var(--gold); }
.ticks { list-style: none; padding: 0; margin: 1.2rem 0 1.8rem; display: grid; gap: .6rem; }
.ticks li { padding-left: 1.8rem; position: relative; color: #EDE5D5; }
.ticks li::before { content: "✿"; position: absolute; left: 0; color: var(--gold); }

/* ---------- How ---------- */
.how { padding: clamp(3rem, 6vw, 5rem) 0; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.step { text-align: center; padding: 2rem 1.5rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.step-icon { display: inline-flex; align-items: center; justify-content: center; width: 60px; height: 60px; border-radius: 50%; background: var(--cream-2); color: var(--terracotta); margin-bottom: 1rem; }
.step h3 { margin-bottom: .35rem; }
.step p { color: var(--muted); margin: 0; font-size: .95rem; }

/* ---------- Story ---------- */
.story { padding: clamp(2rem, 4vw, 3rem) 0 clamp(3.5rem, 7vw, 6rem); }
.story-inner { display: grid; grid-template-columns: .85fr 1.15fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.story-media img { border-radius: var(--radius-lg); box-shadow: var(--shadow); aspect-ratio: 3/4; object-fit: cover; width: 100%; }
.story-copy p { color: var(--muted); font-size: 1.05rem; }

/* ---------- Gallery strip ---------- */
.gallery { overflow: hidden; padding-bottom: 4px; }
.gallery-track { display: flex; gap: 4px; }
.gallery-track img { width: 12.5%; aspect-ratio: 1; object-fit: cover; flex: 0 0 auto; }

/* ---------- Contact ---------- */
.contact { padding: clamp(3.5rem, 7vw, 6rem) 0; background: var(--cream-2); }
.contact-inner { display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.contact-list { list-style: none; padding: 0; margin: 1.6rem 0 0; display: grid; gap: 1.1rem; }
.contact-list li { color: var(--muted); font-size: .95rem; }
.contact-list strong { color: var(--ink); font-weight: 700; }
.contact-form { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: clamp(1.4rem, 3vw, 2.2rem); display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; box-shadow: var(--shadow-sm); }
.field { display: flex; flex-direction: column; gap: .4rem; }
.field-full { grid-column: 1 / -1; }
label, legend { font-weight: 700; font-size: .85rem; color: var(--ink); }
input, select, textarea {
  font-family: var(--font-body); font-size: .98rem; color: var(--ink);
  padding: .7em .85em; border: 1.4px solid var(--border); border-radius: 12px; background: var(--cream);
  transition: border-color .18s ease, box-shadow .18s ease; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(62,85,64,.12); }
textarea { resize: vertical; }
.contact-form .btn { grid-column: 1 / -1; }
.form-status { grid-column: 1/-1; margin: 0; font-size: .9rem; font-weight: 600; min-height: 1.2em; }
.form-status.ok { color: var(--green); }
.form-status.err { color: var(--terracotta-dark); }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #E8E0D3; padding: 3.5rem 0 1.8rem; }
.footer-inner { display: grid; grid-template-columns: 1.5fr 1fr 1.2fr; gap: 2rem; padding-bottom: 2.5rem; border-bottom: 1px solid rgba(255,255,255,.12); }
.footer-brand .brand-name { color: #fff; font-size: 1.5rem; }
.footer-brand .brand-name em { color: var(--blush); }
.footer-brand p { color: #B9B0A2; margin: .6rem 0 0; max-width: 30ch; }
.footer-nav { display: flex; flex-direction: column; gap: .6rem; }
.footer-nav a { color: #E8E0D3; }
.footer-nav a:hover { color: var(--blush); }
.footer-contact a { color: #fff; font-weight: 600; }
.footer-contact .socials { color: #B9B0A2; font-size: .9rem; margin-top: .6rem; }
.footer-bottom { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding-top: 1.5rem; color: #9C9384; font-size: .82rem; }

/* ---------- Cart drawer ---------- */
.cart-overlay, .modal-overlay { position: fixed; inset: 0; background: rgba(46,42,38,.45); z-index: 90; }
.cart-drawer {
  position: fixed; top: 0; right: 0; height: 100%; width: min(420px, 92vw); background: var(--cream);
  z-index: 100; transform: translateX(100%); transition: transform .32s cubic-bezier(.4,0,.2,1);
  display: flex; flex-direction: column; box-shadow: -20px 0 50px -30px rgba(0,0,0,.5);
}
.cart-drawer.open { transform: translateX(0); }
.cart-header, .modal-head { display: flex; align-items: center; justify-content: space-between; padding: 1.3rem 1.5rem; border-bottom: 1px solid var(--border); }
.cart-header h2, .modal-head h2 { margin: 0; font-size: 1.4rem; }
.icon-btn { background: none; border: none; cursor: pointer; color: var(--ink); padding: 6px; border-radius: 10px; display: inline-flex; }
.icon-btn:hover { background: var(--cream-2); color: var(--terracotta); }
.cart-body { flex: 1; overflow-y: auto; padding: 1.2rem 1.5rem; }
.cart-empty { text-align: center; color: var(--muted); padding: 3rem 1rem; }
.cart-empty .emoji { font-size: 2.4rem; display: block; margin-bottom: .6rem; }
.cart-item { display: grid; grid-template-columns: 64px 1fr auto; gap: .9rem; padding: 1rem 0; border-bottom: 1px solid var(--border); }
.cart-item img { width: 64px; height: 80px; object-fit: cover; border-radius: 10px; }
.ci-name { font-family: var(--font-display); font-size: 1.02rem; margin: 0 0 .1rem; }
.ci-price { color: var(--muted); font-size: .86rem; }
.ci-controls { display: flex; align-items: center; gap: .4rem; margin-top: .5rem; }
.qty-btn { width: 26px; height: 26px; border-radius: 8px; border: 1.3px solid var(--border); background: var(--surface); cursor: pointer; font-weight: 700; color: var(--ink); display: inline-flex; align-items: center; justify-content: center; }
.qty-btn:hover { border-color: var(--green); color: var(--green); }
.ci-qty { min-width: 22px; text-align: center; font-weight: 700; }
.ci-right { text-align: right; display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; }
.ci-line { font-family: var(--font-display); font-weight: 600; }
.ci-remove { background: none; border: none; color: var(--muted); cursor: pointer; font-size: .8rem; text-decoration: underline; padding: 0; }
.ci-remove:hover { color: var(--terracotta-dark); }
.cart-foot { padding: 1.3rem 1.5rem; border-top: 1px solid var(--border); background: var(--cream-2); }
.cart-lines { display: grid; gap: .3rem; margin-bottom: .6rem; padding-bottom: .6rem; border-bottom: 1px solid var(--border); }
.cart-line { display: flex; justify-content: space-between; font-size: .9rem; color: var(--muted); }
.cart-subtotal { display: flex; justify-content: space-between; font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; margin-bottom: .4rem; }
.cart-fineprint { font-size: .8rem; color: var(--muted); margin: 0 0 1rem; }

/* ---------- Modal ---------- */
.modal-overlay { z-index: 110; display: flex; align-items: center; justify-content: center; padding: 20px; overflow-y: auto; }
.modal { background: var(--cream); border-radius: var(--radius-lg); width: min(560px, 100%); max-height: 92vh; overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.modal-body { padding: 1.5rem; overflow-y: auto; }
.modal-intro { color: var(--muted); font-size: .95rem; margin: 0 0 1.2rem; }
.order-review { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.2rem; margin-bottom: 1.4rem; }
.or-item { display: flex; justify-content: space-between; padding: .35rem 0; font-size: .92rem; border-bottom: 1px dashed var(--border); }
.or-item:last-of-type { border-bottom: none; }
.or-total { display: flex; justify-content: space-between; font-family: var(--font-display); font-weight: 600; font-size: 1.1rem; padding-top: .7rem; margin-top: .4rem; border-top: 1.5px solid var(--border); }
.checkout-form { display: grid; gap: 1rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
fieldset.field { border: none; padding: 0; margin: 0; }
fieldset.field legend { margin-bottom: .5rem; }
.radio { display: inline-flex; align-items: center; gap: .4rem; font-weight: 600; font-size: .95rem; margin-right: 1.2rem; }
.radio input { width: auto; }
.muted { color: var(--muted); font-weight: 400; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--green-deep); color: #fff; padding: .85rem 1.4rem; border-radius: 999px;
  font-weight: 600; font-size: .92rem; box-shadow: var(--shadow); z-index: 200; opacity: 0;
  transition: opacity .25s ease, transform .25s ease; pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Payment methods ---------- */
.pay-methods { display: flex; flex-wrap: wrap; gap: .5rem; }
.pay {
  display: inline-flex; align-items: center; gap: .5em; color: var(--ink);
  font-family: var(--font-body); font-weight: 700; font-size: .85rem; line-height: 1;
  padding: .38em .85em .38em .42em; border-radius: 999px; border: 1.5px solid var(--border); background: #fff;
  transition: box-shadow .18s ease, transform .15s ease, border-color .18s ease;
}
.pay-ico { width: 1.55em; height: 1.55em; flex: 0 0 auto; border-radius: 5px; display: block; }
.pay:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); border-color: #cfc7ba; color: var(--ink); }
.pay-note { display: flex; align-items: center; gap: .6rem .8rem; flex-wrap: wrap; margin: 0 0 1.4rem; }
.pay-lead { margin: 0; font-size: .92rem; font-weight: 600; color: var(--muted); }
.pay-lead strong, #pay-amount { color: var(--ink); font-family: var(--font-display); font-weight: 600; }
.pay-label { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.footer-pay { margin-top: 1.1rem; }
.footer-pay .pay-label { display: block; margin-bottom: .5rem; color: #B9B0A2; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-media { order: -1; max-width: 460px; }
  .lede { max-width: none; }
  .occasions { grid-template-columns: repeat(3, 1fr); }
  .product-grid { grid-template-columns: repeat(3, 1fr); }
  .editorial-inner, .story-inner, .contact-inner { grid-template-columns: 1fr; }
  .editorial-media, .story-media { max-width: 480px; }
  .steps { grid-template-columns: 1fr; }
  .gallery-track img { width: 25%; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 620px) {
  .main-nav { display: none; }
  .nav-toggle { display: inline-flex; }
  .occasions { grid-template-columns: repeat(2, 1fr); }
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .contact-form { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
  .gallery-track img { width: 33.33%; }
  .hero-badge { width: 92px; height: 92px; font-size: .85rem; }
  .card-body { padding: .9rem; }
  .card-foot { flex-direction: column; align-items: stretch; gap: .6rem; }
  .add-btn { width: 100%; }
}

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