@font-face {
  font-family: "Brunson Rough";
  src: url("fuentes/brunson/Brunson Rough.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: Steelfish;
  src: url("fuentes/steelfish (1)/Steelfish Rg.otf") format("opentype");
  font-display: swap;
}

:root {
  --ink: #1c344e;
  --display: "Brunson Rough", Steelfish, sans-serif;
  --gutter: clamp(16px, 7vw, 104px);
  --checker: url("assets/7-44-DameroAzulYBlanco2.svg");
  color: var(--ink);
  font-family: Steelfish, sans-serif;
  scroll-behavior: smooth;
}

* { box-sizing: border-box; }
body, h1, h2, h3, p { margin: 0; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; color: inherit; font: inherit; }
button, a { touch-action: manipulation; }
button:focus-visible, a:focus-visible {
  outline: 3px solid #d98934;
  outline-offset: 3px;
}
.brand, h1, h2, h3, footer {
  font: inherit;
  font-family: var(--display);
  text-transform: uppercase;
}

header {
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: clamp(420px, 48.9vw, 780px);
  padding: clamp(16px, 3vw, 44px) 0 8%;
  background: url("assets/6-15-Image7.webp") center / cover,
    url("assets/6-15-Background.webp") center / cover;
  color: white;
}

nav {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  width: min(80%, 1280px);
  margin-inline: auto;
  padding: 10px clamp(16px, 5vw, 80px) 24px;
  border-radius: 20px;
  background: #1c344ecc;
  backdrop-filter: blur(10px);
}

nav::after, section::before, .cta::before {
  content: "";
  display: block;
  height: clamp(9px, 1.11vw, 20px);
  background: var(--checker) center / auto 100% repeat-x;
}

nav::after {
  position: absolute;
  inset: auto 0 0;
  border-radius: 0 0 20px 20px;
  background-image: url("assets/6-15-DameroAzulYBlanco1.svg");
}

nav div, .controls, #dots, .cta a {
  display: flex;
  align-items: center;
}

nav div { flex-wrap: wrap; gap: 0 clamp(8px, 1.4vw, 24px); }
nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  white-space: nowrap;
  font-size: clamp(18px, 1.4vw, 24px);
}
nav a:hover, footer a:hover { text-decoration: underline; }
.brand { font-size: clamp(20px, 2.1vw, 34px); }
.contact {
  padding-inline: 12px;
  border: 2px solid #ffffff50;
  border-radius: 18px;
  text-transform: uppercase;
}

.hero-copy {
  align-self: center;
  text-align: center;
}

#menu-toggle { display: none; }

h1 {
  margin: 0 16px;
  text-align: center;
  font-size: clamp(38px, 4.86vw, 80px);
  line-height: 1;
}

h1 span { display: flex; align-items: center; justify-content: center; }
h1 i {
  position: relative;
  width: clamp(156px, 18.75vw, 300px);
  aspect-ratio: 270 / 63;
  overflow: hidden;
}

h1 img {
  position: absolute;
  left: -36.84%;
  top: -180.04%;
  width: 145.61%;
  height: 440.08%;
  max-width: none;
}

h2 { font-size: clamp(40px, 8.68vw, 125px); line-height: 1; }
h3 { font-size: clamp(40px, 7vw, 112px); line-height: 1; }
.banner {
  padding: .2em 12px;
  background: var(--ink);
  color: white;
  font-size: clamp(32px, 4.86vw, 75px);
  text-align: center;
}

.selector {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-areas: "copy preview" "choices preview";
  grid-template-rows: auto 1fr;
  gap: 8px clamp(16px, 3vw, 48px);
  width: min(calc(100% - 2 * var(--gutter)), 1360px);
  margin: clamp(24px, 3vw, 48px) auto 0;
}

.pizza-copy { grid-area: copy; }
#ingredients {
  min-height: 2.3em;
  max-width: 34ch;
  margin-block: .35em;
  font-size: clamp(20px, 2.1vw, 34px);
  line-height: 1.15;
}

#price {
  margin-block: 0 .5em;
  color: #8a4a03;
  font-family: var(--display);
  font-size: clamp(22px, 2.2vw, 36px);
  line-height: 1.15;
}

.choices { grid-area: choices; }
#options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  width: min(100%, 390px);
}

#options button, .controls button { border: 0; background: none; padding: 0; }
#options img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  transition: transform .22s ease;
}
#options button {
  position: relative;
  border: 2px solid transparent;
  border-radius: 50%;
}
#options button[aria-pressed="true"] { border-color: var(--ink); }
#options button:hover img, #options button:focus-visible img {
  transform: rotate(-7deg) scale(1.06);
}
.choices small { display: block; margin-top: 10px; font-size: clamp(18px, 1.6vw, 24px); }

.preview { grid-area: preview; }
#large { width: 100%; aspect-ratio: 1; object-fit: contain; border-radius: 20px; }
.controls { justify-content: center; }
.controls button { width: 40px; height: 44px; font: 28px Arial, sans-serif; }
.controls .dot { width: clamp(26px, 3vw, 40px); font-size: 0; }
.dot::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #aeb6bf;
  transition: transform .2s ease;
}
.dot[aria-pressed="true"]::before { background: var(--ink); transform: scale(1.35); }

.order { text-align: center; padding: 20px 16px clamp(30px, 4vw, 64px); }
.btn {
  display: inline-block;
  padding: .65em 1.45em;
  border-radius: 21px;
  border: 0;
  background: var(--ink);
  color: white;
  font: 700 clamp(16px, 1.65vw, 28px)/1.25 "DM Sans", Arial, sans-serif;
  transition: background .2s ease, transform .2s ease;
}
.btn:hover, .cta a:hover .btn { background: #304e6d; transform: translateY(-2px); }

#galeria h2, #historia h2 { margin: clamp(24px, 3vw, 44px) var(--gutter) .2em; }
.gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(8px, 1.1vw, 18px);
  padding: 0 clamp(14px, 1.4vw, 22px) clamp(32px, 3.15vw, 48px);
}
.gallery img { width: 100%; height: auto; aspect-ratio: 456 / 365; object-fit: cover; }
.gallery img:nth-child(2) { object-position: 50% 47%; }

.story {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: clamp(24px, 9vw, 140px);
  margin: 0 var(--gutter) clamp(32px, 3.1vw, 48px);
}
.story p { max-width: 34ch; font-size: clamp(24px, 3.1vw, 46px); line-height: 1.12; }
.story img { width: 100%; height: auto; aspect-ratio: 437 / 546; object-fit: cover; object-position: bottom; }

.cta a {
  justify-content: center;
  gap: clamp(12px, 3vw, 44px);
  padding: clamp(32px, 4.45vw, 70px) 16px;
  text-align: center;
}
.cta img { width: clamp(42px, 6.9vw, 100px); flex: none; }
.cta .btn { font-size: clamp(17px, 2.5vw, 36px); }

footer {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, max-content));
  justify-content: space-between;
  gap: clamp(24px, 4vw, 64px);
  padding: clamp(30px, 3.4vw, 56px) var(--gutter) 24px;
  background: var(--ink);
  color: white;
}

footer h2 { font-size: clamp(32px, 4.6vw, 70px); margin-bottom: .6em; }
footer p, footer a {
  display: flex;
  align-items: center;
  gap: .4em;
  margin-top: .35em;
  min-height: 44px;
  font-size: clamp(24px, 3.7vw, 54px);
  overflow-wrap: anywhere;
}
footer img { flex: none; width: clamp(24px, 3.8vw, 56px); }
footer small { grid-column: 1 / -1; text-align: center; font-size: clamp(15px, 1.5vw, 23px); }

.cart-toggle {
  position: fixed;
  z-index: 2;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  min-height: 48px;
  border: 1px solid #ffffff80;
  box-shadow: 0 4px 18px #1c344e45;
  font-size: 16px;
}

#cart-count {
  display: inline-block;
  min-width: 24px;
  margin-left: 4px;
  padding: 2px 5px;
  border-radius: 20px;
  background: white;
  color: var(--ink);
}

footer { padding-bottom: calc(82px + env(safe-area-inset-bottom)); }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

body:has(dialog[open]) { overflow: hidden; }

dialog {
  width: min(calc(100% - 24px), 480px);
  max-height: calc(100dvh - 24px);
  margin: auto;
  padding: 12px clamp(14px, 4vw, 28px) 24px;
  border: 0;
  border-radius: 20px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 12px 48px #0004;
  overscroll-behavior: contain;
}

dialog::backdrop { background: #0d1b2baf; }
dialog h2 { font-size: clamp(30px, 8vw, 52px); }
dialog p { font-size: 22px; }
.dialog-close { display: flex; justify-content: flex-end; }
.dialog-close button, .quantity-picker button, .remove-item {
  min-width: 44px;
  min-height: 44px;
  border: 1px solid #1c344e44;
  border-radius: 12px;
  background: white;
  font: 24px Arial, sans-serif;
}

#pizza-form { text-align: center; }
#pizza-dialog-image {
  width: min(62%, 210px, 32dvh);
  aspect-ratio: 1;
  object-fit: contain;
  margin: 0 auto 12px;
}
#pizza-dialog-description { margin-top: 6px; }
.quantity-label { display: block; margin-top: 12px; font-size: 22px; }
.quantity-picker { display: flex; justify-content: center; gap: 8px; margin: 6px 0 12px; }
dialog input {
  width: 64px;
  min-height: 44px;
  border: 1px solid #1c344e66;
  border-radius: 8px;
  color: inherit;
  text-align: center;
  font: 16px Arial, sans-serif;
}
#pizza-error:not(:empty) { margin-bottom: 10px; color: #a1301d; }
dialog .btn { width: 100%; min-height: 44px; text-align: center; }
#cart-checkout[hidden] { display: none; }
#cart-empty { margin-top: 12px; }
#cart-items { list-style: none; margin: 10px 0; padding: 0; }
.cart-item {
  display: grid;
  grid-template-columns: clamp(44px, 15vw, 70px) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #1c344e33;
}
.cart-item img { width: 100%; aspect-ratio: 1; object-fit: contain; }
.cart-item-details strong { display: block; font: 22px/1.15 var(--display); }
.cart-item-details label { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 4px; font-size: 20px; }
.remove-item { padding-inline: 9px; font: 18px Steelfish, sans-serif; }

@media (max-width: 960px) {
  :root { --gutter: clamp(16px, 5vw, 48px); }
  nav { width: calc(100% - 2 * var(--gutter)); padding-inline: 16px; }
}

@media (max-width: 760px) {
  header {
    min-height: clamp(300px, 58svh, 440px);
    padding-bottom: 22px;
    background-position: center;
  }

  .selector {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "copy" "preview" "choices";
    grid-template-rows: auto;
    text-align: center;
  }
  .pizza-copy h3 { font-size: clamp(34px, 8vw, 52px); }
  #ingredients { margin-inline: auto; }
  .preview { width: min(100%, 68vw, 360px); margin-inline: auto; }
  .controls { display: none; }
  #options {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 4px;
    margin-inline: auto;
  }
  #options button { min-height: 44px; align-self: center; }
  .order .btn { width: min(100%, 380px); min-height: 44px; }
  .story { gap: 18px; }
}

@media (max-width: 640px) {
  nav { flex-wrap: wrap; padding: 4px 14px 14px; gap: 0 12px; }
  #menu-toggle:not([hidden]) {
    display: grid;
    place-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid #ffffff75;
    border-radius: 12px;
    background: transparent;
    color: white;
  }
  #menu-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    border-radius: 1px;
    background: currentColor;
    transition: transform .2s, opacity .2s;
  }
  #menu-toggle[aria-expanded="true"] span:first-child { transform: translateY(7px) rotate(45deg); }
  #menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  #menu-toggle[aria-expanded="true"] span:last-child { transform: translateY(-7px) rotate(-45deg); }
  #menu-toggle[aria-expanded="false"]:not([hidden]) + #nav-links { display: none; }
  #nav-links {
    flex: 1 0 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px 8px;
    padding-block: 8px;
  }
  #nav-links a { white-space: normal; }
  #nav-links .contact { grid-column: 1 / -1; justify-content: center; }
}

@media (max-width: 520px) {
  #galeria h2, #historia h2 { font-size: clamp(34px, 10vw, 52px); }
  .gallery, .story, footer { grid-template-columns: minmax(0, 1fr); }
  .gallery { padding-inline: var(--gutter); }
  .story img { max-width: 420px; }
}

@media (max-width: 350px) {
  #options {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: min(100%, 224px);
  }
}

@media (prefers-reduced-motion: reduce) {
  :root { scroll-behavior: auto; }
  #options img, .dot::before, .btn, #menu-toggle span { transition: none; }
}
