/*
 * WP Supply — folha de estilos única
 *
 * 1. Tokens          5. Componentes      8. Rodapé
 * 2. Base            6. Produto          9. Utilitários
 * 3. Layout          7. Formulário      10. Responsivo
 * 4. Cabeçalho
 */

/* 1. Tokens ---------------------------------------------------------------- */

:root {
  --ink: #1e1e1e;
  --accent: #08a8f5;
  --surface: #f5f5f5;
  --line: #e6e6e6;
  --border: #767676;
  --muted: #626262;
}

/* 2. Base ------------------------------------------------------------------ */

* {
  box-sizing: border-box;
}

html {
  color: var(--ink);
  background: #fff;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
}

body {
  margin: 0;
}

a {
  color: inherit;
  text-underline-offset: 4px;
}

a:hover {
  text-decoration-thickness: 2px;
}

h1,
h2,
h3 {
  line-height: 1.2;
  margin: 0 0 24px;
  overflow-wrap: anywhere;
}

h1 {
  font-size: clamp(1.75rem, 3vw, 2.75rem);
  max-width: 28ch;
}

h2 {
  font-size: clamp(1.5rem, 2.5vw, 2.25rem);
}

h3 {
  font-size: 20px;
  margin-bottom: 16px;
}

p {
  margin: 0 0 16px;
  max-width: 65ch;
}

section {
  margin-bottom: 80px;
}

section h2 {
  margin-bottom: 32px;
}

table {
  border-collapse: collapse;
  width: 100%;
  font-variant-numeric: tabular-nums;
}

table + h3 {
  margin-top: 40px;
}

th,
td {
  text-align: left;
  padding: 16px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  overflow-wrap: anywhere;
}

th {
  width: 35%;
}

tr:nth-child(odd) {
  background: var(--surface);
}

:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 4px;
}

/* 3. Layout ---------------------------------------------------------------- */

.container {
  max-width: 1296px;
  margin: auto;
  padding-inline: 48px;
}

main {
  padding-top: 32px;
  padding-bottom: 64px;
  min-height: 50vh;
}

.reading {
  max-width: 760px;
}

.reading h1 {
  max-width: none;
}

.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
}

/* 4. Cabeçalho ------------------------------------------------------------- */

.skip {
  position: absolute;
  left: 20px;
  top: -100px;
  background: #fff;
  padding: 16px;
  z-index: 2;
}

.skip:focus {
  top: 10px;
}

header {
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  min-height: 48px;
}

.brand img,
footer img {
  width: 176px;
  height: auto;
  max-width: 100%;
}

header nav {
  display: flex;
  gap: 24px;
}

header nav a {
  padding: 12px 0;
  text-decoration: none;
}

header nav a:hover,
header nav a[aria-current] {
  text-decoration: underline;
}

header nav a[aria-current] {
  text-decoration-thickness: 2px;
}

/* 5. Componentes ----------------------------------------------------------- */

/* Botões */
button,
.button {
  background: var(--accent);
  color: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 8px;
  min-height: 48px;
  padding: 12px 20px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

button:hover,
.button:hover {
  background: var(--ink);
  color: #fff;
}

.secondary {
  background: #fff;
}

/* Botão do menu (mobile) — vem depois de button:hover de propósito */
.menu {
  display: none;
  background: transparent;
  border: 1px solid transparent;
  color: var(--ink);
  min-width: 48px;
  padding: 8px;
  font-size: 24px;
  line-height: 1;
}

.menu:hover {
  background: var(--surface);
  color: var(--ink);
}

/* Texto */
.intro {
  font-size: 18px;
  line-height: 1.55;
}

.eyebrow {
  font-size: 14px;
  font-weight: 600;
}

.small {
  font-size: 14px;
  color: var(--muted);
}

.note {
  padding: 20px;
  background: var(--surface);
  border-left: 3px solid var(--border);
  margin-block: 24px;
}

.postal {
  white-space: nowrap;
}

/* Hero (início) */
.hero {
  display: grid;
  grid-template-columns: 7fr 5fr;
  gap: 48px;
  align-items: center;
  padding-block: 32px;
}

.hero h1 {
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1.08;
}

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

/* Fotografia de produto */
.photo {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  overflow: hidden;
  padding: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  text-align: center;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.featured {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.featured .photo {
  height: 320px;
  min-height: 180px;
  max-height: none;
  aspect-ratio: auto;
  border-radius: 0;
}

/* Cartões de produto */
.grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
}

.card {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  min-width: 0;
}

.card .photo {
  border-radius: 0;
  border: 0;
}

.card-body {
  padding: 24px;
}

.card h3 a {
  display: block;
  min-height: 44px;
  text-decoration: none;
}

.card h3 a:hover {
  text-decoration: underline;
}

/* Categorias */
.categories {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 32px;
}

.category {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 80px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 20px;
  font-weight: 600;
  text-decoration: none;
}

.category:hover {
  text-decoration: underline;
}

.category img {
  width: 96px;
  height: 96px;
  object-fit: contain;
  flex-shrink: 0;
}

.category > span:last-child {
  flex-shrink: 0;
}

/* Blocos de chamada */
.buy {
  padding: 40px;
  background: var(--accent);
  border-radius: 12px;
}

.buy .button {
  background: #fff;
}

.buy .button:hover {
  background: var(--ink);
}

.professional {
  border-block: 1px solid var(--line);
  padding: 40px 0;
  margin: 48px 0;
}

.tracking {
  margin: 32px 0;
}

.tracking h2 {
  font-size: 24px;
}

.tracking a,
.check + a {
  display: inline-block;
  padding-block: 10px;
}

/* Contactos (rodapé e página de contacto) */
.contacts {
  overflow-wrap: anywhere;
}

.contacts a,
footer nav a {
  display: block;
  padding-block: 10px;
  min-height: 44px;
}


.contact-layout {
  margin-top: 40px;
}

.contact-layout .tracking {
  margin: 0;
}

.contact-layout h2 {
  font-size: 24px;
}

.contacts .button {
  display: inline-flex;
  margin-bottom: 8px;
}

/* Perguntas frequentes (apoio) */
.faq {
  max-width: 760px;
  margin: 32px 0 48px;
}

.faq details {
  border-bottom: 1px solid var(--line);
}

.faq summary {
  cursor: pointer;
  padding: 16px 32px 16px 0;
  font-weight: 600;
  list-style: none;
  position: relative;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  position: absolute;
  right: 4px;
  top: 14px;
  font-size: 22px;
  line-height: 1;
}

.faq details[open] summary::after {
  content: "−";
}

.faq details p {
  margin: 0 0 16px;
}

/* 6. Produto --------------------------------------------------------------- */

.breadcrumbs {
  margin-bottom: 24px;
  font-size: 14px;
}

.breadcrumbs a {
  display: inline-block;
  min-height: 44px;
  padding-top: 10px;
}

.product-layout {
  display: grid;
  grid-template-columns: 7fr 5fr;
  gap: 48px;
  margin-top: 32px;
}

.product-layout + .reading {
  margin-top: 48px;
}

/* Galeria */
.gallery {
  min-width: 0;
}

.gallery-main {
  display: block;
  width: 100%;
  padding: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.gallery-main:hover {
  background: #fff;
}

.gallery-main img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
}

.thumbnails {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.thumbnails button {
  background: #fff;
  padding: 4px;
  border: 1px solid var(--border);
  min-width: 0;
}

.thumbnails button:hover {
  border: 2px solid var(--ink);
  padding: 3px;
}

.thumbnails img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
}

/* Lightbox */
.lightbox {
  width: 1000px;
  max-width: 96vw;
  max-height: 96dvh;
  padding: 16px;
  border: 1px solid var(--ink);
  border-radius: 12px;
  overflow: auto;
}

.lightbox::backdrop {
  background: rgb(0 0 0 / 75%);
}

.lightbox-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.lightbox-image {
  display: block;
  width: 100%;
  max-width: 100%;
  height: min(65dvh, 750px);
  object-fit: contain;
}

.image-caption {
  text-align: center;
  margin: 12px auto 0;
}

.image-count {
  font-variant-numeric: tabular-nums;
}

/* Unidades de venda */
.sales-units {
  margin-bottom: 0;
}

.sales-units h2 {
  font-size: 24px;
  margin: 24px 0 16px;
}

.sales-unit {
  border: 1px solid var(--border);
  padding: 20px;
  margin-bottom: 16px;
  border-radius: 8px;
}

.sales-unit h3 {
  margin-bottom: 12px;
}

.sales-unit dl {
  margin: 0 0 16px;
}

.sales-unit dt {
  font-size: 14px;
  color: var(--muted);
}

.sales-unit dd {
  margin: 0 0 8px;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}

.sales-unit a {
  width: 100%;
  justify-content: center;
}

/* Documentação e marcação CE */
.documentation ul {
  list-style: none;
  padding: 0;
}

.documentation li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  padding: 24px 0;
}

.documentation h3 {
  font-size: 18px;
  margin-bottom: 8px;
}

.documentation button:disabled {
  background: var(--surface);
  color: var(--muted);
  border-color: var(--border);
  cursor: not-allowed;
  flex-shrink: 0;
}

.ce-mark {
  max-width: 760px;
}

.ce-mark p:last-child {
  margin-bottom: 0;
}


/* Características e operador responsável (produto) */
.features {
  padding-left: 20px;
  margin: 16px 0 24px;
}

.features li + li {
  margin-top: 6px;
}

.operator {
  margin-top: 24px;
}

/* 7. Formulário ------------------------------------------------------------ */

input,
select,
textarea {
  font: inherit;
  color: inherit;
  width: 100%;
  min-height: 48px;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
}

select {
  max-width: 100%;
  text-overflow: ellipsis;
}

textarea {
  min-height: 140px;
  resize: vertical;
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.check input {
  width: 24px;
  height: 24px;
  min-height: 24px;
  flex-shrink: 0;
}

.check label {
  font-size: 14px;
  font-weight: 400;
}

.error {
  font-size: 14px;
  margin: 6px 0 20px;
}

.error:empty {
  margin-bottom: 20px;
}

#errors:not(:empty) {
  border: 2px solid var(--ink);
  padding: 16px;
  margin-bottom: 24px;
}

#errors a {
  display: block;
  min-height: 44px;
}

/* 8. Rodapé ---------------------------------------------------------------- */

footer {
  background: var(--ink);
  color: #fff;
  border-top: 1px solid var(--ink);
  padding: 48px 0;
}

footer a {
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

footer :focus-visible {
  outline-color: #fff;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 0.8fr 1fr 1fr;
  gap: 32px;
  font-size: 14px;
}

.footer-grid img {
  margin-bottom: 20px;
}

.footer-grid > div > a {
  display: block;
  min-height: 44px;
  padding-block: 10px;
}

.fineprint {
  font-size: 14px;
  margin-top: 40px;
}

.fineprint p {
  max-width: none;
  margin-bottom: 8px;
}

/* 9. Utilitários ----------------------------------------------------------- */

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

[hidden] {
  display: none !important;
}

/* 10. Responsivo ----------------------------------------------------------- */

@media (max-width: 1199px) {
  .container {
    padding-inline: 32px;
  }

  header nav {
    gap: 16px;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 899px) {
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Tablet: menu recolhido, layouts numa coluna */
@media (max-width: 1023px) {
  header {
    flex-wrap: wrap;
    gap: 12px;
    padding-block: 12px;
  }

  .menu {
    display: block;
  }

  header nav {
    display: none;
    width: 100%;
    flex-direction: column;
    gap: 0;
  }

  header nav.open {
    display: flex;
  }

  header nav a {
    min-height: 48px;
  }

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

  .product-layout {
    gap: 32px;
  }

  .hero {
    gap: 32px;
  }

  .hero > div {
    max-width: 700px;
  }

  .featured {
    max-width: 540px;
  }

  .contact-layout {
    gap: 32px;
  }
}

@media (max-width: 767px) {
  .product-layout {
    grid-template-columns: 1fr;
  }
}

/* Telemóvel */
@media (max-width: 639px) {
  .container {
    padding-inline: 20px;
  }

  main {
    padding-top: 24px;
    padding-bottom: 40px;
  }

  section {
    margin-bottom: 40px;
  }

  th,
  td {
    padding: 12px 8px;
  }

  header {
    min-height: 72px;
  }

  .brand img {
    width: 176px;
  }

  .button {
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .hero {
    padding-block: 8px;
  }

  .hero .featured {
    width: 100%;
    max-width: none;
    border: 0;
  }

  .hero .featured .photo {
    height: 240px;
    min-height: 0;
    border: 0;
  }

  .photo {
    width: 100%;
    min-height: 180px;
    max-height: none;
  }

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

  .grid .photo {
    height: 132px;
    min-height: 0;
    max-height: none;
    aspect-ratio: auto;
  }

  .card-body {
    padding: 12px;
  }

  .card-body h3 {
    font-size: 16px;
    line-height: 1.35;
    margin-bottom: 8px;
  }

  .card-body p {
    font-size: 14px;
    margin-bottom: 8px;
  }

  .card-body .eyebrow {
    display: none;
  }

  .categories {
    grid-template-columns: 1fr;
  }

  .category {
    padding: 16px;
    font-size: 18px;
  }

  .category img {
    width: 72px;
    height: 72px;
  }

  .buy {
    padding: 24px;
  }

  .product-layout {
    gap: 24px;
  }

  .thumbnails {
    gap: 8px;
  }

  .lightbox {
    padding: 12px;
  }

  .lightbox-controls {
    gap: 8px;
  }

  .lightbox-controls button {
    padding: 8px 12px;
  }

  .sales-unit {
    padding: 16px;
  }

  .documentation li {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 24px 16px;
  }

  .footer-grid > div {
    grid-column: 1 / -1;
  }

  .footer-grid nav {
    min-width: 0;
  }

  .fineprint {
    margin-top: 32px;
  }
}
