/* ==========================================================================
   Ginja Barber — folha de estilos
   Mobile-first: as regras base são para telemóvel; os @media acrescentam
   ajustes para ecrãs maiores.
   ========================================================================== */

/* ---------- 1. Paleta e tokens (extraídos do logótipo) ---------- */
:root {
  /* Cores do logótipo */
  --ink: #111111;          /* principal: preto das letras G, N, A */
  --gold: #8E6A22;         /* secundária: dourado das letras I, J e "BARBER" */
  --gold-text: #7A5A1A;    /* dourado escurecido para texto sobre fundo claro (contraste AA) */
  --gold-light: #B8913F;   /* destaque: dourado para fundos escuros */
  --paper: #F5F2EC;        /* fundo claro quente */
  --paper-2: #ECE6DA;      /* fundo alternativo (secções suaves) */
  --white: #FFFFFF;

  /* Neutros de apoio */
  --muted: #5E584F;
  --muted-dark: #A9A196;
  --line: #DCD4C5;
  --line-dark: #2C2925;
  --ink-2: #1A1816;

  /* Tipografia */
  --serif: "Playfair Display", "Didot", "Bodoni 72", Georgia, serif;
  --sans: "Jost", "Futura", "Avenir Next", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Escala tipográfica fluida */
  --fs-hero: clamp(2.4rem, 1.6rem + 4vw, 4.4rem);
  --fs-h2: clamp(1.9rem, 1.4rem + 2.2vw, 3rem);
  --fs-h3: 1.3rem;
  --fs-lead: clamp(1.05rem, 1rem + .3vw, 1.2rem);

  /* Espaçamento e forma */
  --gutter: 1.25rem;
  --section: clamp(4.5rem, 3rem + 6vw, 8rem);
  --radius: 4px;
  --header-h: 64px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 8px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
img, svg, iframe { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 500; line-height: 1.12; margin: 0 0 .6em; letter-spacing: -.01em; }
h2, .h2-like { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
p { margin: 0 0 1em; }
em { font-style: italic; color: var(--gold-text); }
.container { width: min(1180px, 100% - 2 * var(--gutter)); margin-inline: auto; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 1rem; top: -100px; background: var(--ink); color: var(--white); padding: .6rem 1rem; z-index: 100; }
.skip-link:focus { top: 1rem; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.ico { width: 1.15em; height: 1.15em; flex: none; }
.flip { transform: scaleX(-1); }
.center { text-align: center; }
.muted { color: var(--muted); }
.muted-light { color: var(--muted-dark); }

/* Pequeno rótulo em maiúsculas espaçadas, a ecoar o "BARBER" do logótipo */
.eyebrow {
  font-family: var(--sans);
  font-size: .78rem;
  font-weight: 500;
  letter-spacing: .32em;
  text-transform: uppercase;
  color: var(--gold-text);
  margin-bottom: 1rem;
}
.section-dark .eyebrow, .site-footer .eyebrow { color: var(--gold-light); }

/* ---------- 3. Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  min-height: 50px; padding: .8rem 1.5rem;
  font: 500 .95rem/1 var(--sans); letter-spacing: .04em;
  text-decoration: none; border: 1px solid transparent; border-radius: var(--radius);
  cursor: pointer; transition: background-color .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease), transform .25s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn-gold { background: var(--gold); color: var(--white); }
.btn-gold:hover { background: var(--gold-text); }
.btn-dark { background: var(--ink); color: var(--paper); }
.btn-dark:hover { background: var(--gold); }
.btn-line { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn-line:hover { background: var(--ink); color: var(--paper); }
.btn-line-light { border-color: var(--gold-light); color: var(--paper); }
.btn-line-light:hover { background: var(--gold-light); color: var(--ink); }
.btn-sm { min-height: 40px; padding: .55rem 1.1rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.link-arrow { display: inline-flex; align-items: center; gap: .5rem; font-weight: 500; text-decoration: none; border-bottom: 1px solid currentColor; padding-bottom: 2px; }
.link-arrow .ico { transition: transform .25s var(--ease); }
.link-arrow:hover .ico { transform: translateX(4px); }

/* ---------- 4. Cabeçalho ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50; height: var(--header-h);
  background: rgba(245, 242, 236, .92);
  backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid transparent; transition: border-color .3s;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
.header-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; }
.header-logo img { width: 118px; height: auto; }
.nav-toggle { width: 44px; height: 44px; background: none; border: 0; padding: 10px; cursor: pointer; display: grid; align-content: center; gap: 7px; }
.nav-toggle span { display: block; height: 1.5px; background: var(--ink); transition: transform .3s var(--ease); }
.nav-toggle[aria-expanded="true"] span:first-child { transform: translateY(4.25px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:last-child { transform: translateY(-4.25px) rotate(-45deg); }
.nav {
  position: fixed; inset: var(--header-h) 0 auto 0;
  display: flex; flex-direction: column; gap: .25rem;
  padding: 1rem var(--gutter) 1.5rem; background: var(--paper); border-bottom: 1px solid var(--line);
  transform: translateY(-8px); opacity: 0; visibility: hidden; transition: .25s var(--ease);
}
.nav.is-open { transform: none; opacity: 1; visibility: visible; }
.nav a:not(.btn) { padding: .75rem 0; text-decoration: none; font-size: 1.1rem; border-bottom: 1px solid var(--line); }
.nav .btn { margin-top: 1rem; }

/* ---------- 5. Hero ---------- */
.hero { padding: 2.5rem 0 var(--section); }
.hero-grid { display: grid; gap: 2.5rem; }
.hero-logo { width: min(300px, 78%); margin: 0 0 2rem -4px; }
.hero h1 { font-size: var(--fs-hero); margin-bottom: .45em; }
.hero h1 em { display: block; }
.lead { font-size: var(--fs-lead); color: var(--muted); max-width: 34rem; }
.hero-actions { display: flex; flex-direction: column; gap: .75rem; margin: 2rem 0 1.75rem; }
.hero-facts { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .6rem 1.75rem; font-size: .95rem; color: var(--muted); }
.hero-facts li { display: flex; align-items: center; gap: .5rem; }
.hero-facts .ico { color: var(--gold); }
.hero-photo { margin: 0; position: relative; }
.hero-photo img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: var(--radius); }
/* moldura dourada deslocada — detalhe editorial discreto */
.hero-photo::after { content: ""; position: absolute; inset: 14px -14px -14px 14px; border: 1px solid var(--gold); border-radius: var(--radius); z-index: -1; }

/* ---------- 6. Secções ---------- */
.section { padding: var(--section) 0; }
.section-dark { background: var(--ink); color: var(--paper); }
.section-dark h2, .section-dark h3, .section-dark h4 { color: var(--paper); }
.section-soft { background: var(--paper-2); }
.section-head { max-width: 40rem; margin-bottom: 2.75rem; }
.section-head-row { max-width: none; display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 1rem 2rem; }
.note-confirm { display: inline-block; font-size: .85rem; padding: .3rem .7rem; border: 1px dashed var(--gold-light); color: var(--gold-light); border-radius: var(--radius); }

/* Sobre */
.about-grid { display: grid; gap: 2.5rem; align-items: center; }
.about-photo { margin: 0; }
.about-photo img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius); }
.about-copy p:not(.eyebrow) { color: var(--muted); }

/* ---------- 7. Cartões de serviços / produtos ---------- */
.cards { list-style: none; padding: 0; margin: 0; display: grid; gap: 1px; background: var(--line-dark); border: 1px solid var(--line-dark); }
.card { background: var(--ink); padding: 1.75rem 1.5rem; display: flex; flex-direction: column; position: relative; transition: background-color .3s var(--ease); }
.card:hover { background: var(--ink-2); }
.card h3, .card h4 { font-size: 1.45rem; margin-bottom: .4rem; }
.card p { color: var(--muted-dark); font-size: .98rem; }
.card .price { margin: auto 0 0; padding-top: 1rem; display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap; }
.card .price span { font-family: var(--serif); font-size: 1.9rem; color: var(--gold-light); }
.card .price small { font-size: .72rem; letter-spacing: .08em; color: var(--muted-dark); border: 1px dashed var(--line-dark); padding: .1rem .4rem; }
.tag { font-size: .72rem !important; letter-spacing: .24em; text-transform: uppercase; color: var(--gold-light) !important; margin-bottom: .75rem; }
.card-feature { box-shadow: inset 0 2px 0 var(--gold-light); }

.products { margin-top: calc(var(--section) * .8); }
.products .section-head { margin-bottom: 2rem; }

/* ---------- 8. Galeria ---------- */
.gallery { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: .5rem; }
.gallery img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 2px; transition: transform .6s var(--ease), filter .6s var(--ease); }
.gallery li { overflow: hidden; border-radius: 2px; }
.gallery li:hover img { transform: scale(1.03); }

/* ---------- 9. Testemunhos ---------- */
.quotes { display: grid; gap: 1.25rem; margin-bottom: 2.5rem; }
.quote { margin: 0; background: var(--paper); padding: 2rem 1.75rem; border-radius: var(--radius); border-top: 2px solid var(--gold); }
.stars { color: var(--gold); letter-spacing: .2em; font-size: .95rem; margin-bottom: .75rem; }
.quote blockquote { margin: 0 0 1.25rem; font-family: var(--serif); font-size: 1.2rem; line-height: 1.45; }
.quote figcaption { font-size: .85rem; letter-spacing: .08em; color: var(--muted); }

/* ---------- 10. Marcações ---------- */
.booking { display: grid; gap: 1.25rem; }
.step, .booking-form fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.booking > .step, .booking-form { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem 1.25rem; }
.step legend { display: flex; align-items: center; gap: .7rem; font-family: var(--serif); font-size: 1.35rem; margin-bottom: 1.1rem; padding: 0; }
.step-n { display: inline-grid; place-items: center; width: 1.9rem; height: 1.9rem; border-radius: 50%; border: 1px solid var(--gold); color: var(--gold-text); font: 500 .9rem var(--sans); }

.days-nav { display: grid; grid-template-columns: 36px 1fr 36px; align-items: center; gap: .25rem; }
.days-btn { width: 36px; height: 44px; border: 0; background: none; cursor: pointer; color: var(--ink); display: grid; place-items: center; border-radius: var(--radius); }
.days-btn:hover { background: var(--paper); }
.days-btn[disabled] { opacity: .25; cursor: default; }
.days { display: grid; grid-template-columns: repeat(5, 1fr); gap: .4rem; }
.day {
  border: 1px solid var(--line); background: var(--white); border-radius: var(--radius);
  padding: .55rem .2rem; cursor: pointer; text-align: center; font: inherit; color: var(--ink); line-height: 1.2;
  transition: border-color .2s, background-color .2s, color .2s;
}
.day small { display: block; font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.day strong { display: block; font-family: var(--serif); font-size: 1.35rem; font-weight: 500; }
.day:hover:not([disabled]) { border-color: var(--ink); }
.day[aria-checked="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.day[aria-checked="true"] small { color: var(--gold-light); }
.day[disabled] { opacity: .38; cursor: not-allowed; text-decoration: line-through; }

.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: .45rem; min-height: 3rem; }
.slot {
  border: 1px solid var(--line); background: var(--white); border-radius: var(--radius); min-height: 44px;
  font: 500 .95rem var(--sans); cursor: pointer; color: var(--ink); transition: .2s;
}
.slot:hover:not([disabled]) { border-color: var(--gold); color: var(--gold-text); }
.slot[aria-checked="true"] { background: var(--gold); border-color: var(--gold); color: var(--white); }
.slot[disabled] { background: var(--paper); color: #A59E93; text-decoration: line-through; cursor: not-allowed; }
.slots .muted { grid-column: 1 / -1; margin: 0; }

.field { margin-bottom: 1rem; }
.field label { display: block; font-size: .85rem; font-weight: 500; letter-spacing: .04em; margin-bottom: .35rem; }
.optional { color: var(--muted); font-weight: 400; }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; font-size: 1rem; color: var(--ink);
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: .75rem .85rem; min-height: 48px; transition: border-color .2s, background-color .2s;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--ink); background: var(--white); }
.field [aria-invalid="true"] { border-color: #A3341F; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.summary { font-size: .95rem; padding: .8rem 1rem; background: var(--paper); border-left: 2px solid var(--gold); margin: .5rem 0 1rem; }
.form-msg { margin: 1rem 0 0; font-size: .95rem; }
.form-msg.is-error { color: #A3341F; }
.booking-done { text-align: center; padding: 1rem 0; }
.booking-done h3 { font-size: 1.6rem; }
.booking-done .btn { margin: .4rem; }

/* ---------- 11. Horário e mapa ---------- */
.map-grid { display: grid; gap: 2.5rem; }
.hours { width: 100%; border-collapse: collapse; margin: .5rem 0 1.75rem; }
.hours th, .hours td { padding: .7rem 0; border-bottom: 1px solid var(--line-dark); text-align: left; font-weight: 400; }
.hours td { text-align: right; font-variant-numeric: tabular-nums; }
.hours tr.closed { color: var(--muted-dark); }
.hours tr.is-today th, .hours tr.is-today td { color: var(--gold-light); font-weight: 500; }
.address { font-style: normal; display: flex; gap: .7rem; margin-bottom: 1.75rem; color: var(--paper); }
.address .ico { color: var(--gold-light); margin-top: .25rem; }
.map { min-height: 340px; border-radius: var(--radius); overflow: hidden; background: var(--ink-2); }
.map iframe { width: 100%; height: 100%; min-height: 340px; border: 0; filter: grayscale(.85) contrast(1.05); }

/* ---------- 12. Contactos ---------- */
.contact-grid { display: grid; gap: 2rem; }
.contact-list { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.contact-list a { display: flex; align-items: center; gap: 1rem; padding: 1.1rem 0; text-decoration: none; border-bottom: 1px solid var(--line); font-size: 1.15rem; transition: color .2s; }
.contact-list a:hover { color: var(--gold-text); }
.contact-list .ico { width: 1.4rem; height: 1.4rem; color: var(--gold); }
.contact-list small { display: block; font-size: .72rem; letter-spacing: .24em; text-transform: uppercase; color: var(--muted); }

/* ---------- 13. Rodapé ---------- */
.site-footer { background: var(--ink); color: var(--muted-dark); padding: 4rem 0 calc(6rem + env(safe-area-inset-bottom)); font-size: .95rem; }
.footer-inner { display: grid; gap: 1.5rem; justify-items: start; }
.footer-inner img { width: 170px; }
.social { display: flex; gap: .5rem; }
.social a { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid var(--line-dark); border-radius: 50%; color: var(--paper); transition: .2s; }
.social a:hover { border-color: var(--gold-light); color: var(--gold-light); }
.copy { font-size: .85rem; margin: 0; }

/* ---------- 14. WhatsApp flutuante ---------- */
.wa-float {
  position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); z-index: 60;
  width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center;
  background: #1F9D55; color: var(--white); box-shadow: 0 6px 20px rgba(0, 0, 0, .22);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
.wa-float svg { width: 28px; height: 28px; }
.wa-float:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(0, 0, 0, .28); }

/* ---------- 15. Animações ao fazer scroll (subtis) ---------- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.js .reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  * { transition-duration: .01ms !important; }
}

/* ==========================================================================
   Ecrãs maiores
   ========================================================================== */
@media (min-width: 600px) {
  :root { --gutter: 2rem; }
  .hero-actions { flex-direction: row; flex-wrap: wrap; }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .gallery { gap: .75rem; }
  .days { grid-template-columns: repeat(7, 1fr); }
  .quotes { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 900px) {
  :root { --header-h: 76px; }
  .header-logo img { width: 140px; }
  .nav-toggle { display: none; }
  .nav {
    position: static; flex-direction: row; align-items: center; gap: 2rem;
    padding: 0; background: none; border: 0; transform: none; opacity: 1; visibility: visible;
  }
  .nav a:not(.btn) { border: 0; padding: .25rem 0; font-size: .95rem; position: relative; }
  .nav a:not(.btn)::after { content: ""; position: absolute; left: 0; right: 100%; bottom: -2px; height: 1px; background: var(--gold); transition: right .3s var(--ease); }
  .nav a:not(.btn):hover::after { right: 0; }
  .nav .btn { margin: 0; }

  .hero { padding-top: 4rem; }
  .hero-grid { grid-template-columns: 1.15fr .85fr; gap: 5rem; align-items: center; }
  .about-grid { grid-template-columns: 1fr 1fr; gap: 5rem; }
  .cards { grid-template-columns: repeat(3, 1fr); }
  .gallery { grid-template-columns: repeat(4, 1fr); }
  .card { padding: 2.25rem 2rem; }
  .booking { grid-template-columns: 1.3fr 1fr; grid-template-rows: auto 1fr; align-items: start; }
  .booking > .step:first-child { grid-column: 1; }
  .booking > .step:nth-child(2) { grid-column: 1; }
  .booking-form { grid-column: 2; grid-row: 1 / span 2; position: sticky; top: calc(var(--header-h) + 1rem); }
  .map-grid { grid-template-columns: .9fr 1.1fr; gap: 4rem; align-items: stretch; }
  .map, .map iframe { min-height: 460px; }
  .contact-grid { grid-template-columns: 1fr 1.2fr; gap: 5rem; align-items: start; }
  .footer-inner { grid-template-columns: auto 1fr auto; align-items: center; gap: 2rem 3rem; }
  .footer-inner .copy { grid-column: 1 / -1; justify-self: stretch; padding-top: 1.5rem; border-top: 1px solid var(--line-dark); }
  .site-footer { padding-bottom: 3rem; }
}
