/* ==========================================================
   PAGE : PRODUITS
   - Mesmo estilo (header/menu/logos/footer) da página À PROPOS.
   - Menu de categorias e grelha de produtos mantidos.
   ========================================================== */

/* ===== VARIÁVEIS ===== */
:root {
  /* Tipografia */
  --size-h1: 6em;
  --size-menu: 2em;
  --size-h2: 3em;
  --size-h3: 2em;
  --size-h4: 1.4em;
  --size-p: 1.5em;
  --size-card-text: 1.05em;

  /* Layout */
  --logo-w: 12em;
  --header-padding-y: 1.2em;
  --nav-gap-top: 0.15em;
  --max-content: 80em;
  --gap: 1.2em;

  /* Espaço horizontal entre links do menu */
  --gap-menu-x: 0.2em;

  /* Cores */
  --color-border-soft: rgba(255,255,255,0.08);
  --color-card-bg: rgba(255,255,255,0.03);
  --color-card-border: rgba(255,255,255,0.12);

  /* Fontes */
  --font-heading-menu: "Amatic SC", cursive;
}

/* ==========================================================
   HEADER – IGUAL À PÁGINA À PROPOS
   ========================================================== */
header {
  position: static;
  top: auto;
  border-bottom: 0.05em solid var(--color-border-soft);
  padding: var(--header-padding-y) 0;
}

.header-content {
  max-width: var(--max-content);
  margin: 0 auto;
  padding: 0 1em;
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas:
    "logoL title logoR"
    "nav   nav   nav";
  gap: 0.5em;
}

.left-logo { grid-area: logoL; }
.right-logo { grid-area: logoR; }

.logo {
  width: var(--logo-w);
  height: auto;
  margin: 0;
}

.title-nav {
  grid-area: title;
  align-self: center;
}

.title-nav h1 {
  font-size: var(--size-h1);
  letter-spacing: 0.12em;
  line-height: 1.1;
  margin: 0;
  font-family: inherit;
  font-weight: normal;
}

/* ===== MENU ===== */
nav {
  grid-area: nav;
  margin-top: var(--nav-gap-top);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--gap-menu-x);
}

nav a {
  font-size: var(--size-menu);
  padding: 0.4em 0.3em;
  color: var(--color-fg);
  font-weight: bold;
  text-decoration: none;
  transition: 0.2s ease;
  font-family: var(--font-heading-menu);
  letter-spacing: 0.05em;
}

nav a:hover {
  color: var(--color-accent);
  text-decoration: underline;
}

nav a.active {
  color: var(--color-fg);
}

/* ==========================================================
   MAIN
   ========================================================== */
main {
  padding: 2.5em 1em 2em;
  max-width: var(--max-content);
  margin: 0 auto;
}

/* INTRODUÇÃO + MENU DE CATEGORIAS */
.products-intro h2 {
  font-size: var(--size-h2);
  text-align: center;
  margin-bottom: 0.4em;
  font-family: var(--font-heading-menu);
  font-weight: 700;
  letter-spacing: 0.03em;
}

.products-intro p {
  font-size: var(--size-p);
  text-align: justify;
  line-height: 1.6;
  margin: 0 auto 1.5em;
  max-width: 70ch;
  font-family: "Quicksand", sans-serif;
  font-weight: 300;
}

/* MENU INTERNO DE CATEGORIAS */
.products-nav {
  margin-top: 1em;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.8em;
}

.products-nav a {
  font-size: 1.1em;
  padding: 0.4em 0.9em;
  border-radius: 999px;
  border: 0.05em solid var(--color-card-border);
  text-decoration: none;
  color: var(--color-fg);
  background: rgba(0,0,0,0.25);
  transition: 0.2s ease;
  font-family: "Quicksand", sans-serif;
}

.products-nav a:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

/* ==========================================================
   SECÇÕES DE PRODUTOS
   ========================================================== */
.products-section {
  margin-top: 3em;
}

.products-section h3 {
  font-size: var(--size-h3);
  margin-bottom: 0.4em;
  text-align: center;
  font-family: var(--font-heading-menu);
  font-weight: 700;
}

.section-desc {
  font-size: var(--size-p);
  text-align: justify;
  line-height: 1.6;
  margin: 0 auto 1.5em;
  max-width: 70ch;
  font-family: "Quicksand", sans-serif;
  font-weight: 300;
}

/* GRELHA DE PRODUTOS */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16em, 1fr));
  gap: var(--gap);
}

/* CARTÕES DE PRODUTO */
.product-card {
  border-radius: 0.9em;
  background: var(--color-card-bg);
  border: 0.05em solid var(--color-card-border);
  padding: 0.8em;
  overflow: hidden;
}

.product-card figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6em;
}

.product-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 0.6em;
  display: block;
}

.product-card video {
  width: 100%;
  aspect-ratio: 8 / 3;
  object-fit: cover;
  border-radius: 0.6em;
  display: block;
}

.product-card h4 {
  font-size: var(--size-h4);
  margin: 0 0 0.2em;
  font-family: var(--font-heading-menu);
}

.product-card p {
  font-size: var(--size-card-text);
  margin: 0;
  line-height: 1.5;
  font-family: "Quicksand", sans-serif;
}

/* ==========================================================
   FOOTER – IGUAL À PROPOS
   ========================================================== */
footer {
  border-top: 0.05em solid var(--color-border-soft);
  padding: 1em;
  text-align: center;
  font-size: calc(var(--size-p) * 0.9);
  opacity: 0.85;
  font-family: "Quicksand", sans-serif;
  font-weight: 300;
}

/* ==========================================================
   RESPONSIVIDADE (AJUSTADO À À PROPOS)
   ========================================================== */

/* Tablet (601–1000px) */
@media (max-width: 1000px) and (min-width: 601px) {
  :root {
    --size-h1: 4em;
    --size-menu: 1em;
    --size-h2: 2.2em;
    --size-h3: 1.7em;
    --size-h4: 1.3em;
    --size-p: 1.1em;
    --logo-w: 8em;
  }

  .header-content { gap: 0.3em; }

  html body.page-produits header .header-content .title-nav h1 {
    font-size: 4em !important;
  }
}

/* Telemóveis (≤ 600px) */
@media (max-width: 600px) {
  :root {
    --size-h1: 2.5em;
    --size-menu: 0.85em;
    --size-h2: 1.6em;
    --size-h3: 1.4em;
    --size-h4: 1.2em;
    --size-p: 1em;
    --logo-w: 6em;
  }

  header {
    padding: 0.5em 0;
  }

  .header-content {
    grid-template-columns: auto 1fr auto;
    grid-template-areas:
      "logoL title logoR"
      "nav   nav   nav";
    gap: 0.2em;
  }

  nav a {
    padding: 0.3em 0.25em;
  }

  main {
    padding: 1.8em 1em 1.5em;
  }

  html body.page-produits header .header-content .title-nav h1 {
    font-size: 2.5em !important;
    letter-spacing: 0.12em !important;
    line-height: 1.1 !important;
  }
}

/* Esconde logo direito em mobile vertical */
@media (max-width: 600px) and (orientation: portrait) {
  .right-logo {
    display: none;
  }
}

/* Menu compacto em mobile vertical */
@media (max-width: 800px) and (orientation: portrait) {
  header .header-content nav {
    gap: 0 !important;
    justify-content: center !important;
    flex-wrap: nowrap !important;
  }

  header .header-content nav a {
    padding: 0.25em 0.08em !important;
    font-size: 0.8em !important;
    letter-spacing: -0.03em !important;
  }
}

/* ==========================================================
   FONTES E DETALHES
   ========================================================== */
.page-produits nav a,
.page-produits h2,
.page-produits h3,
.page-produits h4 {
  font-family: "Amatic SC", cursive;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.page-produits p,
.page-produits footer p {
  font-family: "Quicksand", sans-serif;
  font-weight: 300;
  letter-spacing: 0.01em;
  line-height: 1.6;
}

/* ==========================================================
   FORÇAR H1 IGUAL À À PROPOS (desktop + breakpoints)
   ========================================================== */
.page-produits header .title-nav h1,
body.page-produits header .title-nav h1,
html body.page-produits header .title-nav h1 {
  font-size: 6em !important;
  letter-spacing: 0.12em !important;
  line-height: 1.1 !important;
  margin: 0 !important;
  font-family: inherit !important;
  font-weight: normal !important;
}

@media (max-width: 1000px) and (min-width: 601px) {
  .page-produits header .title-nav h1 {
    font-size: 4em !important;
  }
}

@media (max-width: 600px) {
  .page-produits header .title-nav h1 {
    font-size: 2.5em !important;
  }
}

/* ==========================================================
   ACESSIBILIDADE
   ========================================================== */
:where(a, button, .btn):focus-visible {
  outline: 0.1em dashed var(--color-accent);
  outline-offset: 0.1em;
}
