/* ==========================================================================
   Mesa Bacana — the only stylesheet
   All colors live in :root below. Change them here and nowhere else.
   ========================================================================== */

:root {
  --color-bg: #f7f2ea;          /* linen / cream page background */
  --color-surface: #fffdf9;     /* cards, dialog */
  --color-text: #36363a;        /* graphite, like "Mesa" in the logo */
  --color-muted: #6b655c;       /* secondary text */
  --color-line: #e3dacb;        /* thin borders and dividers */
  --color-blue: #0095da;        /* logo blue: decorative details only */
  --color-blue-strong: #00679a; /* darker blue for buttons and links (readable contrast) */
  --color-on-blue: #ffffff;     /* text on blue buttons */
  --color-sold-out: #8a3b2e;    /* "Esgotado" badge */
  --color-backdrop: rgb(40 36 30 / 0.6);

  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: ui-serif, Georgia, "Times New Roman", serif;

  --radius: 6px;
  --gutter: 16px;
  --max-width: 1120px;
}

/* ---------- base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
html:has(dialog[open]) { overflow: hidden; }   /* no page scroll behind an open kit */

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
}

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

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.2;
  margin: 0 0 0.5em;
}
h1 { font-size: clamp(2rem, 7vw, 3.25rem); }
h2 { font-size: clamp(1.625rem, 5vw, 2.25rem); }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1em; }

a { color: var(--color-blue-strong); text-underline-offset: 0.2em; }

:focus-visible { outline: 3px solid var(--color-blue); outline-offset: 2px; }

section[id] { scroll-margin-top: 1rem; }

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -3rem;
  background: var(--color-surface);
  padding: 0.5rem 1rem;
  z-index: 10;
}
.skip-link:focus { top: 0.5rem; }

/* ---------- buttons ---------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.75rem 1.25rem;
  border: 1px solid var(--color-blue-strong);
  border-radius: 999px;
  background: var(--color-blue-strong);
  color: var(--color-on-blue);
  font: inherit;
  font-weight: 600;
  font-size: 1rem;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
.button:hover { filter: brightness(1.1); }

.button--secondary {
  background: transparent;
  color: var(--color-blue-strong);
}
.button--secondary:hover { background: var(--color-surface); filter: none; }

.button-row { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1.5rem 0; }
.button-row--center { justify-content: center; }

.notice {
  font-size: 0.9375rem;
  color: var(--color-muted);
  border-left: 3px solid var(--color-blue);
  padding-left: 0.75rem;
}

/* ---------- header ---------- */

.site-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem var(--gutter) 0.75rem;
  border-bottom: 1px solid var(--color-line);
}
.site-header__logo img { height: 56px; width: auto; }

@media (min-width: 900px) {
  .site-header {
    flex-direction: row;
    justify-content: space-between;
    max-width: calc(var(--max-width) + 2 * var(--gutter));
    margin: 0 auto;
  }
  .site-header__logo img { height: 72px; }
  .site-nav { font-size: 0.9375rem; gap: 0.25rem 1.75rem; }
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem 1rem;
  font-size: 0.875rem;
}
.site-nav a {
  color: var(--color-text);
  text-decoration: none;
  padding: 0.5rem 0;   /* comfortable tap target */
}
.site-nav a:hover { color: var(--color-blue-strong); }

/* ---------- layout ---------- */

.hero,
.section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2.5rem var(--gutter);
}
.section--narrow { max-width: 720px; }

.section__header { max-width: 640px; margin-bottom: 1.75rem; }
.section__header p { color: var(--color-muted); }

/* ---------- home ---------- */

.hero { display: grid; gap: 1.5rem; padding-top: 1.5rem; }
.hero__photo {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius);
}
.hero__subtitle { font-size: 1.125rem; }

@media (min-width: 900px) {
  .hero { grid-template-columns: 1.1fr 1fr; align-items: center; gap: 3rem; padding-top: 3rem; }
  .hero__photo { aspect-ratio: 1; }
}

/* ---------- kit grid and cards ---------- */

.kit-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2rem 1.5rem;
}
@media (min-width: 600px) { .kit-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .kit-grid { grid-template-columns: repeat(3, 1fr); } }

.card {
  display: block;
  position: relative;
  color: inherit;
  text-decoration: none;
}
.card__photo {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius);
  margin-bottom: 0.875rem;
  transition: opacity 0.2s;
}
.card:hover .card__photo { opacity: 0.9; }
.card__name { margin-bottom: 0.25rem; }
.card__tagline { color: var(--color-muted); margin-bottom: 0.375rem; }
.card__price { font-weight: 600; margin: 0; }
.card:hover .card__name { text-decoration: underline; text-underline-offset: 0.2em; }

/* badges: always in the HTML, shown by the classes on <li class="kit"> */
.badges { display: flex; gap: 0.5rem; }
.card .badges { position: absolute; top: 0.75rem; left: 0.75rem; }
.badge {
  display: none;
  padding: 0.25rem 0.625rem;
  border-radius: 999px;
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.is-limited .badge--limited { display: inline-block; color: var(--color-blue-strong); }
.is-sold-out .badge--sold-out { display: inline-block; background: var(--color-sold-out); color: #fff; }
.is-sold-out .card__photo { opacity: 0.6; }
.is-sold-out .kit-dialog__actions .button:first-child { display: none; }   /* no WhatsApp order button */
.is-sold-out .kit-dialog__delivery { display: none; }

/* ---------- kit dialog ---------- */

.kit-dialog {
  width: 100%;
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--color-surface);
  color: var(--color-text);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.kit-dialog::backdrop { background: var(--color-backdrop); }

@media (min-width: 900px) {
  .kit-dialog[open] {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    align-items: start;
    width: min(1040px, calc(100% - 4rem));
    height: auto;
    max-height: calc(100% - 4rem);
    margin: auto;
    border-radius: var(--radius);
  }
  .kit-dialog .gallery { position: sticky; top: 0; }
}

.kit-dialog__close {
  position: fixed;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 2;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
}
@media (min-width: 900px) {
  /* in the centered dialog the button sits on the dialog's own corner */
  .kit-dialog__close { position: absolute; }
}

.kit-dialog__body { padding: 1.5rem var(--gutter) 0; }
@media (min-width: 900px) { .kit-dialog__body { padding: 2.5rem 2rem 0; } }

.kit-dialog__body h2 { margin-top: 0.5rem; }
.kit-dialog__body h3 { font-size: 1.0625rem; font-family: var(--font-body); font-weight: 600; margin: 1.5rem 0 0.375rem; }
.kit-dialog__body ul { padding-left: 1.25rem; margin: 0 0 1em; }
.kit-dialog__price { font-size: 1.25rem; font-weight: 600; }
.kit-dialog__delivery { color: var(--color-muted); font-size: 0.9375rem; margin-top: 1.5rem; }

/* order buttons stay in view at the bottom while reading */
.kit-dialog__actions {
  position: sticky;
  bottom: 0;
  display: flex;
  gap: 0.5rem;
  margin: 0 calc(-1 * var(--gutter));
  padding: 0.75rem var(--gutter) max(0.75rem, env(safe-area-inset-bottom));
  background: var(--color-surface);
  border-top: 1px solid var(--color-line);
}
.kit-dialog__actions .button { flex: 1 1 0; padding: 0.5rem 0.75rem; font-size: 0.875rem; line-height: 1.3; }
@media (min-width: 900px) { .kit-dialog__actions { margin: 0 -2rem; padding: 1rem 2rem; } }

/* ---------- gallery ---------- */

.gallery { position: relative; background: var(--color-bg); }

.gallery__track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.gallery__track::-webkit-scrollbar { display: none; }
.gallery__track img {
  flex: 0 0 100%;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  scroll-snap-align: center;
}

.gallery__dots {
  position: absolute;
  bottom: 0.75rem;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 0.25rem;
}
.gallery__dots button {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.gallery__dots button::before {
  content: "";
  display: block;
  width: 8px;
  height: 8px;
  margin: auto;
  border-radius: 50%;
  background: var(--color-surface);
  opacity: 0.5;
  box-shadow: 0 0 0 1px rgb(0 0 0 / 0.2);
  transition: transform 0.2s;
}
.gallery__dots button[aria-current="true"]::before { opacity: 1; transform: scale(1.35); }

.gallery__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: none;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.9;
}
.gallery__arrow--prev { left: 0.75rem; }
.gallery__arrow--next { right: 0.75rem; }
@media (hover: hover) { .gallery__arrow { display: block; } }

/* ---------- how to order / about ---------- */

.steps { padding-left: 1.5rem; }
.steps li { margin-bottom: 0.75rem; padding-left: 0.25rem; }

.bulk {
  margin-top: 2.5rem;
  padding: 1.5rem;
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
}

.about__quote {
  font-family: var(--font-display);
  font-size: 1.25rem;
  line-height: 1.55;
}
.about__signature { color: var(--color-muted); font-style: italic; }
.about__signature::before { content: "— "; }

/* ---------- footer ---------- */

.site-footer {
  margin-top: 2rem;
  padding: 2.5rem var(--gutter) 3rem;
  border-top: 1px solid var(--color-line);
  text-align: center;
  font-size: 0.9375rem;
}
.site-footer__mark { width: 56px; margin: 0 auto 1rem; }
