:root {
  --cream: #fff8ec;
  --cream-deep: #f5ead8;
  --brown: #382315;
  --brown-soft: #6f4e37;
  --gold: #b88224;
  --gold-dark: #8f6424;
  --terracotta: #b9604b;
  --blush: #efd4ca;
  --white: #fffdf8;
  --shadow: 0 18px 50px rgba(72, 42, 19, 0.14);
  --small-shadow: 0 10px 26px rgba(72, 42, 19, 0.1);
  --radius: 8px;
  --max: 1180px;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--brown);
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
}

img {
  display: block;
  width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

:focus-visible {
  outline: 3px solid rgba(184, 130, 36, 0.55);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 1000;
  transform: translateY(-160%);
  background: var(--brown);
  color: var(--white);
  padding: 10px 14px;
  border-radius: var(--radius);
}

.skip-link:focus {
  transform: translateY(0);
}

.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;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 248, 236, 0.92);
  border-bottom: 1px solid rgba(111, 78, 55, 0.16);
  backdrop-filter: blur(18px);
}

.nav {
  width: min(var(--max), calc(100% - 32px));
  min-height: 78px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: max-content;
}

.brand-mark {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--brown);
  color: #f6d998;
  font-family: "Lora", Georgia, serif;
  font-weight: 700;
  letter-spacing: 0;
  box-shadow: inset 0 0 0 2px rgba(246, 217, 152, 0.28);
}

.brand-name,
.brand-subtitle {
  display: block;
  line-height: 1.1;
}

.brand-name {
  font-family: "Lora", Georgia, serif;
  font-size: 1.2rem;
  font-weight: 700;
}

.brand-subtitle {
  color: var(--brown-soft);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--brown-soft);
  font-weight: 700;
  font-size: 0.93rem;
}

.nav-links a {
  padding: 10px 0;
  transition: color 180ms ease;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--brown);
}

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(56, 35, 21, 0.2);
  background: var(--white);
  border-radius: var(--radius);
  cursor: pointer;
}

.menu-toggle span:not(.sr-only) {
  display: block;
  width: 20px;
  height: 2px;
  margin: 5px auto;
  background: var(--brown);
  transition: transform 180ms ease, opacity 180ms ease;
}

.menu-open .menu-toggle span:nth-child(2) {
  transform: translateY(7px) rotate(45deg);
}

.menu-open .menu-toggle span:nth-child(3) {
  opacity: 0;
}

.menu-open .menu-toggle span:nth-child(4) {
  transform: translateY(-7px) rotate(-45deg);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 12px 18px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 800;
  transition: transform 180ms ease, box-shadow 180ms ease, background-color 180ms ease, border-color 180ms ease;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--small-shadow);
}

.btn-primary {
  background: var(--gold-dark);
  color: var(--white);
}

.btn-primary:hover {
  background: #78511d;
}

.btn-secondary {
  background: rgba(255, 253, 248, 0.92);
  color: var(--brown);
  border-color: rgba(255, 253, 248, 0.72);
}

.section-anchor {
  scroll-margin-top: 92px;
}

.hero {
  position: relative;
  min-height: 690px;
  display: grid;
  align-items: center;
  overflow: hidden;
  color: var(--white);
}

.hero picture,
.hero-image,
.hero-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-image {
  object-fit: cover;
}

.hero-overlay {
  background: linear-gradient(90deg, rgba(42, 25, 13, 0.82), rgba(42, 25, 13, 0.54) 46%, rgba(42, 25, 13, 0.15));
}

.hero-content {
  position: relative;
  width: min(760px, calc(100% - 32px));
  margin-left: max(16px, calc((100vw - var(--max)) / 2));
  padding: 124px 0 98px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--gold);
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: #f8d995;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: "Lora", Georgia, serif;
  line-height: 1.12;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(2.55rem, 5.2vw, 5.35rem);
  max-width: 860px;
}

h2 {
  font-size: clamp(2rem, 3.7vw, 3.35rem);
}

h3 {
  font-size: 1.28rem;
}

.hero-content p:not(.eyebrow) {
  max-width: 620px;
  font-size: clamp(1.06rem, 2vw, 1.25rem);
  color: rgba(255, 253, 248, 0.9);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 28px;
}

.intro-strip {
  width: min(var(--max), calc(100% - 32px));
  margin: -46px auto 0;
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  overflow: hidden;
  border-radius: var(--radius);
  background: rgba(111, 78, 55, 0.16);
  box-shadow: var(--shadow);
}

.intro-strip div {
  background: var(--white);
  padding: 24px;
}

.intro-strip strong,
.intro-strip span {
  display: block;
}

.intro-strip strong {
  font-family: "Lora", Georgia, serif;
  font-size: 1.14rem;
}

.intro-strip span {
  margin-top: 4px;
  color: var(--brown-soft);
}

.section {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
  padding: 96px 0;
}

.section-heading {
  max-width: 760px;
  margin-bottom: 34px;
}

.section-heading p:not(.eyebrow) {
  color: var(--brown-soft);
  font-size: 1.05rem;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.product-card,
.review-card,
.form-card,
.contact-card,
.cake-cta,
.cake-events article {
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--small-shadow);
  border: 1px solid rgba(111, 78, 55, 0.12);
}

.product-card {
  overflow: hidden;
  transition: transform 200ms ease, box-shadow 200ms ease;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow);
}

.product-card img {
  height: 225px;
  object-fit: cover;
}

.product-card div {
  padding: 22px;
}

.product-card p,
.review-card p,
.cake-events p,
.cake-cta p,
.about-copy p,
.contact-card p,
.contact-card address {
  color: var(--brown-soft);
}

.product-card span {
  display: inline-block;
  margin-top: 14px;
  color: var(--terracotta);
  font-weight: 900;
}

.about {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  align-items: center;
  gap: 54px;
}

.about-image img {
  min-height: 520px;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.about-copy p {
  font-size: 1.05rem;
}

.about-points {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

.about-points span {
  padding: 9px 12px;
  border-radius: 999px;
  background: var(--cream-deep);
  color: var(--brown);
  font-weight: 800;
  font-size: 0.9rem;
}

.cakes {
  width: 100%;
  max-width: none;
  background: #f8ecdf;
  padding-inline: max(16px, calc((100vw - var(--max)) / 2));
}

.cake-layout {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 24px;
}

.cake-events {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.cake-events article {
  padding: 24px;
}

.cake-events article:first-child {
  grid-column: span 2;
  background: var(--brown);
  color: var(--white);
}

.cake-events article:first-child p {
  color: rgba(255, 253, 248, 0.8);
}

.cake-cta {
  overflow: hidden;
  align-self: start;
}

.cake-cta img {
  height: 330px;
  object-fit: cover;
}

.cake-cta div {
  padding: 24px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 230px;
  gap: 16px;
}

.gallery-grid img {
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--small-shadow);
}

.gallery-grid .tall {
  grid-row: span 2;
}

.gallery-grid .wide {
  grid-column: span 2;
}

.reviews {
  padding-top: 28px;
}

.review-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.review-card {
  padding: 28px;
}

.review-card p {
  margin-top: 0;
  font-size: 1.04rem;
}

.review-card h3 {
  margin-top: 22px;
}

.review-card span {
  color: var(--terracotta);
  font-weight: 800;
  font-size: 0.92rem;
}

.contact {
  padding-top: 72px;
}

.contact-layout {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 24px;
  align-items: start;
}

.contact-card,
.form-card {
  padding: 28px;
}

.contact-card address {
  margin: 14px 0;
  font-style: normal;
}

.contact-card a {
  font-weight: 800;
  color: var(--brown);
  text-decoration: underline;
  text-decoration-color: rgba(184, 130, 36, 0.45);
  text-underline-offset: 4px;
}

.contact-card h4 {
  margin-top: 24px;
  font-size: 1.08rem;
}

.hours {
  margin: 12px 0 24px;
}

.hours div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid rgba(111, 78, 55, 0.13);
}

.hours dt {
  font-weight: 900;
}

.hours dd {
  margin: 0;
  color: var(--brown-soft);
}

.map-placeholder {
  min-height: 210px;
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, rgba(56, 35, 21, 0.08) 1px, transparent 1px),
    linear-gradient(rgba(56, 35, 21, 0.08) 1px, transparent 1px),
    #ead8c4;
  background-size: 38px 38px;
  display: grid;
  place-items: center;
  align-content: center;
  text-align: center;
  padding: 24px;
  color: var(--brown);
}

.map-pin {
  width: 24px;
  height: 24px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  background: var(--terracotta);
  margin-bottom: 12px;
}

.map-placeholder small {
  display: block;
  margin-top: 4px;
  color: var(--brown-soft);
}

.form-card h3 {
  margin-bottom: 18px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.form-row {
  margin-bottom: 15px;
}

label {
  display: block;
  margin-bottom: 7px;
  font-weight: 900;
  color: var(--brown);
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(111, 78, 55, 0.28);
  border-radius: var(--radius);
  background: #fffefa;
  color: var(--brown);
  padding: 12px 13px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

textarea {
  resize: vertical;
}

input:hover,
select:hover,
textarea:hover {
  border-color: rgba(184, 130, 36, 0.72);
}

.field-error input,
.field-error select,
.field-error textarea {
  border-color: #a94436;
  box-shadow: 0 0 0 3px rgba(169, 68, 54, 0.12);
}

.error-message {
  display: block;
  min-height: 18px;
  margin-top: 4px;
  color: #8f3027;
  font-size: 0.82rem;
  font-weight: 700;
}

.form-success {
  min-height: 24px;
  margin: 14px 0 0;
  color: #345b34;
  font-weight: 900;
}

.form-note {
  margin: 0 0 14px;
  color: var(--brown-soft);
  font-size: 0.86rem;
}

.site-footer {
  background: var(--brown);
  color: var(--white);
  padding: 54px max(16px, calc((100vw - var(--max)) / 2)) 24px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 30px;
  align-items: start;
}

.footer-brand .brand-mark {
  background: #f8d995;
  color: var(--brown);
}

.site-footer p,
.site-footer a,
.site-footer .brand-subtitle {
  color: rgba(255, 253, 248, 0.76);
}

.site-footer nav,
.social-links {
  display: grid;
  gap: 10px;
}

.site-footer a:hover {
  color: #f8d995;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 42px;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 253, 248, 0.18);
  color: rgba(255, 253, 248, 0.68);
  font-size: 0.9rem;
}

.footer-bottom a {
  margin-left: 16px;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  place-items: center;
  padding: 18px;
}

.modal.is-open {
  display: grid;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(29, 17, 10, 0.62);
  backdrop-filter: blur(6px);
}

.modal-panel {
  position: relative;
  width: min(720px, 100%);
  max-height: min(92vh, 820px);
  overflow-y: auto;
  background: var(--white);
  border-radius: var(--radius);
  padding: 34px;
  box-shadow: 0 30px 90px rgba(28, 15, 8, 0.42);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(111, 78, 55, 0.18);
  border-radius: 50%;
  background: var(--cream);
  color: var(--brown);
  font-size: 1.55rem;
  line-height: 1;
  cursor: pointer;
}

.modal-description {
  margin: 10px 46px 22px 0;
  color: var(--brown-soft);
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 650ms ease, transform 650ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

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

@media (max-width: 1020px) {
  .menu-toggle {
    display: block;
  }

  .nav-links {
    position: absolute;
    left: 16px;
    right: 16px;
    top: 86px;
    display: grid;
    gap: 0;
    padding: 12px;
    background: var(--white);
    border: 1px solid rgba(111, 78, 55, 0.16);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transform-origin: top;
    transform: scaleY(0.94);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 160ms ease, transform 160ms ease, visibility 160ms ease;
  }

  .menu-open .nav-links {
    transform: scaleY(1);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .nav-links a,
  .nav-order {
    width: 100%;
  }

  .nav-links a {
    padding: 13px 10px;
  }

  .product-grid,
  .review-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .about,
  .cake-layout,
  .contact-layout {
    grid-template-columns: 1fr;
  }

  .about-image img {
    min-height: 390px;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 680px) {
  .nav {
    min-height: 70px;
  }

  .brand-name {
    font-size: 1.05rem;
  }

  .brand-mark {
    width: 40px;
    height: 40px;
  }

  .hero {
    min-height: 660px;
  }

  .hero-overlay {
    background: linear-gradient(180deg, rgba(42, 25, 13, 0.82), rgba(42, 25, 13, 0.54));
  }

  .hero-content {
    padding: 104px 0 92px;
  }

  .hero-actions,
  .hero-actions .btn {
    width: 100%;
  }

  .intro-strip,
  .product-grid,
  .review-grid,
  .cake-events,
  .form-grid,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .intro-strip {
    margin-top: -32px;
  }

  .section {
    padding: 72px 0;
  }

  .cake-events article:first-child,
  .gallery-grid .wide {
    grid-column: auto;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: 260px;
  }

  .gallery-grid .tall {
    grid-row: auto;
  }

  .contact-card,
  .form-card,
  .modal-panel {
    padding: 22px;
  }

  .hours div,
  .footer-bottom {
    display: grid;
  }

  .footer-bottom a {
    margin: 0 16px 0 0;
  }
}

/* Storefront enhancements: cart, cake builder, gallery lightbox, and polish */
body.overlay-open {
  overflow: hidden;
}

.site-header::after {
  content: "";
  position: absolute;
  inset: auto 0 -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(184, 130, 36, 0.45), transparent);
}

.cart-button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(56, 35, 21, 0.2);
  border-radius: 999px;
  padding: 8px 10px 8px 13px;
  background: var(--white);
  color: var(--brown);
  font-weight: 800;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.cart-button:hover {
  transform: translateY(-2px);
  border-color: var(--gold);
  box-shadow: var(--small-shadow);
}

.cart-button svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.cart-count {
  min-width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--terracotta);
  color: var(--white);
  font-size: 0.75rem;
  line-height: 1;
}

.product-card > div {
  padding: 22px;
}

.product-card .product-purchase {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  padding: 0;
}

.product-card .product-purchase span {
  margin: 0;
}

.add-to-cart {
  flex: 0 0 auto;
  border: 1px solid rgba(143, 100, 36, 0.35);
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(184, 130, 36, 0.08);
  color: var(--gold-dark);
  font-size: 0.82rem;
  font-weight: 900;
  cursor: pointer;
  transition: background-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.add-to-cart:hover {
  transform: translateY(-1px);
  background: var(--gold-dark);
  color: var(--white);
}

.product-card-featured {
  background: linear-gradient(145deg, var(--white), #fff2d8);
}

.cake-builder {
  display: grid;
  grid-template-columns: minmax(0, 0.78fr) minmax(0, 1.22fr);
  gap: 0;
  margin-top: 28px;
  overflow: hidden;
  border: 1px solid rgba(111, 78, 55, 0.16);
  border-radius: 14px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.builder-copy {
  position: relative;
  min-height: 570px;
  padding: 34px;
  overflow: hidden;
  background: var(--brown);
  color: var(--white);
}

.builder-copy h3 {
  max-width: 380px;
  font-size: clamp(2rem, 4vw, 3.4rem);
}

.builder-copy > p:not(.eyebrow) {
  max-width: 440px;
  color: rgba(255, 253, 248, 0.78);
}

.builder-copy img {
  position: absolute;
  inset: auto 0 0;
  height: 300px;
  object-fit: cover;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 22%);
  mask-image: linear-gradient(to bottom, transparent, #000 22%);
}

.builder-form {
  display: grid;
  align-content: center;
  padding: 34px;
}

.builder-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.builder-fields label {
  margin: 0;
}

.builder-fields select {
  margin-top: 7px;
}

.toppings-fieldset {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 24px 0;
  padding: 0;
  border: 0;
}

.toppings-fieldset legend {
  width: 100%;
  margin-bottom: 9px;
  font-weight: 900;
}

.toppings-fieldset label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 12px;
  border: 1px solid rgba(111, 78, 55, 0.2);
  border-radius: var(--radius);
  background: var(--cream);
  cursor: pointer;
  font-size: 0.88rem;
}

.toppings-fieldset label:has(input:checked) {
  border-color: var(--gold);
  background: #fff0cf;
}

.toppings-fieldset input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--gold-dark);
}

.toppings-fieldset span {
  margin-left: auto;
  color: var(--terracotta);
}

.builder-summary {
  padding: 20px;
  border-radius: var(--radius);
  background: var(--cream-deep);
}

.builder-summary > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.builder-summary > div > span {
  color: var(--brown-soft);
  font-weight: 800;
}

.builder-summary strong {
  color: var(--terracotta);
  font-family: "Lora", Georgia, serif;
  font-size: 2rem;
}

.builder-summary p {
  margin: 8px 0 18px;
  color: var(--brown-soft);
}

.builder-summary small {
  display: block;
  margin-top: 10px;
  color: var(--brown-soft);
}

.gallery-grid button {
  position: relative;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: var(--radius);
  background: var(--cream-deep);
  box-shadow: var(--small-shadow);
  cursor: zoom-in;
}

.gallery-grid button img {
  transition: transform 360ms ease, filter 360ms ease;
}

.gallery-grid button span {
  position: absolute;
  inset: auto 12px 12px auto;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(56, 35, 21, 0.86);
  color: var(--white);
  font-size: 0.78rem;
  font-weight: 800;
  opacity: 0;
  transform: translateY(5px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.gallery-grid button:hover img,
.gallery-grid button:focus-visible img {
  transform: scale(1.04);
  filter: saturate(1.08);
}

.gallery-grid button:hover span,
.gallery-grid button:focus-visible span {
  opacity: 1;
  transform: translateY(0);
}

.drawer-shell,
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  visibility: hidden;
  pointer-events: none;
}

.drawer-shell.is-open,
.lightbox.is-open {
  visibility: visible;
  pointer-events: auto;
}

.drawer-backdrop,
.lightbox-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  border: 0;
  background: rgba(29, 17, 10, 0.66);
  opacity: 0;
  cursor: default;
  backdrop-filter: blur(5px);
  transition: opacity 220ms ease;
}

.drawer-shell.is-open .drawer-backdrop,
.lightbox.is-open .lightbox-backdrop {
  opacity: 1;
}

.cart-drawer {
  position: absolute;
  inset: 0 0 0 auto;
  width: min(460px, 100%);
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: var(--white);
  box-shadow: -24px 0 70px rgba(28, 15, 8, 0.3);
  transform: translateX(100%);
  transition: transform 260ms ease;
}

.drawer-shell.is-open .cart-drawer {
  transform: translateX(0);
}

.cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 24px;
  border-bottom: 1px solid rgba(111, 78, 55, 0.14);
}

.cart-header .eyebrow,
.cart-header h2 {
  margin: 0;
}

.icon-button {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border: 1px solid rgba(111, 78, 55, 0.2);
  border-radius: 50%;
  background: var(--cream);
  color: var(--brown);
  font-size: 1.55rem;
  line-height: 1;
  cursor: pointer;
}

.cart-items {
  overflow-y: auto;
  padding: 10px 24px;
}

.cart-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 18px 0;
  border-bottom: 1px solid rgba(111, 78, 55, 0.13);
}

.cart-item h3,
.cart-item p {
  margin: 0;
}

.cart-item h3 {
  font-size: 1.02rem;
}

.cart-item p {
  margin-top: 4px;
  color: var(--brown-soft);
  font-size: 0.82rem;
}

.cart-item-price {
  font-weight: 900;
}

.cart-item-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 12px;
}

.quantity-control {
  display: inline-grid;
  grid-template-columns: 34px 30px 34px;
  align-items: center;
  overflow: hidden;
  border: 1px solid rgba(111, 78, 55, 0.22);
  border-radius: 999px;
}

.quantity-control button {
  height: 32px;
  border: 0;
  background: var(--cream);
  color: var(--brown);
  cursor: pointer;
  font-weight: 900;
}

.quantity-control span {
  text-align: center;
  font-size: 0.86rem;
  font-weight: 900;
}

.text-button {
  border: 0;
  padding: 7px;
  background: transparent;
  color: var(--terracotta);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  font-weight: 800;
}

.cart-empty {
  align-self: center;
  padding: 40px 28px;
  text-align: center;
}

.cart-empty > span {
  display: block;
  font-size: 3.2rem;
}

.cart-empty h3 {
  margin: 12px 0 4px;
}

.cart-empty p {
  margin: 0 0 22px;
  color: var(--brown-soft);
}

.btn-secondary-dark {
  border-color: rgba(56, 35, 21, 0.22);
  background: transparent;
  color: var(--brown);
}

.cart-footer {
  padding: 22px 24px;
  border-top: 1px solid rgba(111, 78, 55, 0.14);
  background: var(--cream);
}

.cart-footer[hidden] {
  display: none;
}

.cart-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
}

.cart-total span {
  font-weight: 800;
}

.cart-total strong {
  font-family: "Lora", Georgia, serif;
  font-size: 1.65rem;
}

.cart-footer p {
  margin: 6px 0 16px;
  color: var(--brown-soft);
  font-size: 0.8rem;
}

.cart-footer .btn {
  width: 100%;
}

.cart-footer > .text-button {
  display: block;
  margin: 8px auto 0;
}

.lightbox {
  display: grid;
  place-items: center;
  padding: 24px;
}

.lightbox-panel {
  position: relative;
  width: min(1040px, 100%);
  opacity: 0;
  transform: scale(0.97);
  transition: opacity 220ms ease, transform 220ms ease;
}

.lightbox.is-open .lightbox-panel {
  opacity: 1;
  transform: scale(1);
}

.lightbox figure {
  margin: 0;
}

.lightbox figure img {
  max-height: 78vh;
  object-fit: contain;
  border-radius: 12px;
  background: #1d110a;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.42);
}

.lightbox figcaption {
  margin-top: 12px;
  color: var(--white);
  text-align: center;
  font-weight: 700;
}

.lightbox-close {
  position: absolute;
  z-index: 1;
  top: 12px;
  right: 12px;
}

.lightbox-arrow {
  position: absolute;
  z-index: 1;
  top: 50%;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 50%;
  background: rgba(56, 35, 21, 0.78);
  color: var(--white);
  cursor: pointer;
  transform: translateY(-50%);
}

.lightbox-arrow.previous {
  left: 12px;
}

.lightbox-arrow.next {
  right: 12px;
}

.toast {
  position: fixed;
  z-index: 500;
  right: 22px;
  bottom: 22px;
  max-width: min(360px, calc(100% - 44px));
  padding: 13px 17px;
  border-radius: 999px;
  background: var(--brown);
  color: var(--white);
  box-shadow: var(--shadow);
  font-weight: 800;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1020px) {
  .nav-links .cart-button {
    width: 100%;
    justify-content: center;
    margin-top: 8px;
    border-radius: var(--radius);
  }

  .cake-builder {
    grid-template-columns: 1fr;
  }

  .builder-copy {
    min-height: 400px;
  }
}

@media (max-width: 680px) {
  .product-card .product-purchase,
  .builder-summary > div {
    align-items: flex-start;
  }

  .builder-form,
  .builder-copy {
    padding: 24px;
  }

  .builder-fields,
  .toppings-fieldset {
    grid-template-columns: 1fr;
  }

  .builder-copy {
    min-height: 420px;
  }

  .gallery-grid button.wide {
    grid-column: auto;
  }

  .gallery-grid button.tall {
    grid-row: auto;
  }

  .lightbox {
    padding: 10px;
  }

  .lightbox-arrow {
    top: auto;
    bottom: 50px;
  }

  .toast {
    right: 14px;
    bottom: 14px;
    max-width: calc(100% - 28px);
  }
}
