/*
 * Eduval - WooCommerce Shop + category/tag archives + Single Product
 */

/* -------------------------------------------------------------------------
 * Product listing (shop + taxonomies): layout aligned with account / cart polish
 * body.eduval-shop-listing is added in functions.php
 * ---------------------------------------------------------------------- */

/* Kill grey strip between main and footer (body default #ebeef1) */
body.eduval-shop-listing,
body.single-product.woocommerce {
  background-color: #ffffff !important;
}

body.eduval-shop-listing .site-main,
body.single-product.woocommerce .site-main {
  background: #ffffff !important;
}

body.eduval-shop-listing .site-footer {
  margin-top: 0 !important;
}

/* Inner rail: readable width on large screens */
body.eduval-shop-listing .site-main > .container .woocommerce {
  max-width: 1220px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: clamp(16px, 4vw, 28px) !important;
  padding-right: clamp(16px, 4vw, 28px) !important;
  padding-bottom: clamp(28px, 5vw, 56px) !important;
}

/* Native WC intro text (no hero) */
body.eduval-shop-listing .term-description,
body.eduval-shop-listing .page-description {
  margin: 0 0 clamp(14px, 2vw, 22px);
  max-width: 72ch;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-paragraph);
}

body.eduval-shop-listing .term-description > :first-child,
body.eduval-shop-listing .page-description > :first-child {
  margin-top: 0;
}

body.eduval-shop-listing .term-description > :last-child,
body.eduval-shop-listing .page-description > :last-child {
  margin-bottom: 0;
}

/* Notices sit above the toolbar */
body.eduval-shop-listing .woocommerce-notices-wrapper {
  max-width: 1220px;
  margin-left: auto;
  margin-right: auto;
  padding-left: clamp(16px, 4vw, 28px);
  padding-right: clamp(16px, 4vw, 28px);
}

body.eduval-shop-listing .eduval-shop-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  flex-wrap: wrap;
  padding: 14px 18px;
  margin: 0 0 22px;
  background: var(--white);
  border: 1px solid color-mix(in srgb, var(--bg-blue) 14%, #d1d5db);
  border-radius: 0;
  box-shadow: none;
}

body.eduval-shop-listing .eduval-shop-toolbar__meta {
  flex: 1 1 200px;
  min-width: 0;
}

body.eduval-shop-listing .eduval-shop-toolbar__controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 16px 20px;
  flex: 2 1 320px;
  min-width: 0;
}

body.eduval-shop-listing .eduval-shop-toolbar .woocommerce-result-count {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--bg-blue);
  letter-spacing: -0.01em;
}

body.eduval-shop-listing .eduval-shop-toolbar .woocommerce-ordering {
  position: relative;
  margin: 0;
  text-align: right;
}

body.eduval-shop-listing .eduval-shop-toolbar .woocommerce-ordering select {
  min-width: min(300px, 100%);
  max-width: 100%;
  border-radius: 0;
  min-height: 46px;
  padding: 10px 44px 10px 14px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-heading);
  border: 2px solid color-mix(in srgb, var(--bg-blue) 18%, #cbd5e1);
  background-color: color-mix(in srgb, var(--bg-blue-secondary) 22%, #fff);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 16 16'%3E%3Cpath stroke='%23263150' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.75' d='M4 6.5 8 10.5 12 6.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px 16px;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

body.eduval-shop-listing .eduval-shop-toolbar .woocommerce-ordering select:hover {
  border-color: color-mix(in srgb, var(--bg-blue) 35%, #94a3b8);
  background-color: var(--white);
}

body.eduval-shop-listing .eduval-shop-toolbar .woocommerce-ordering select:focus {
  outline: 2px solid color-mix(in srgb, var(--bg-blue) 45%, transparent);
  outline-offset: 2px;
}

/* IVA toggle (toolbar + single product summary) */
.eduval-vat-toggle {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-heading);
}

.eduval-vat-toggle__label {
  color: color-mix(in srgb, var(--color-paragraph) 88%, var(--bg-blue));
  font-weight: 700;
  white-space: nowrap;
}

.eduval-vat-toggle__modes {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--color-paragraph) 70%, var(--bg-blue));
}

.eduval-vat-toggle__mode {
  opacity: 0.45;
  transition: opacity 0.15s ease;
}

.eduval-vat-toggle__mode.is-active {
  opacity: 1;
  color: var(--bg-blue);
}

.eduval-vat-toggle__switch {
  position: relative;
  width: 52px;
  height: 28px;
  flex-shrink: 0;
  padding: 0;
  border: 2px solid color-mix(in srgb, var(--bg-blue) 22%, #cbd5e1);
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg-blue-secondary) 40%, #e2e8f0);
  cursor: pointer;
  transition:
    background 0.18s ease,
    border-color 0.18s ease;
}

.eduval-vat-toggle__switch:hover {
  border-color: color-mix(in srgb, var(--bg-blue) 40%, #94a3b8);
}

.eduval-vat-toggle__switch:focus-visible {
  outline: 2px solid var(--bg-blue);
  outline-offset: 3px;
}

.eduval-vat-toggle__switch[aria-checked='true'] {
  background: color-mix(in srgb, var(--bg-blue) 18%, #e8eef8);
  border-color: color-mix(in srgb, var(--bg-blue) 45%, #94a3b8);
}

.eduval-vat-toggle__thumb {
  position: absolute;
  top: 50%;
  left: 4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--white);
  box-shadow: 0 2px 8px rgba(38, 30, 80, 0.18);
  transform: translate(0, -50%);
  transition: transform 0.2s ease;
}

.eduval-vat-toggle__switch[aria-checked='true'] .eduval-vat-toggle__thumb {
  transform: translate(22px, -50%);
}

.eduval-vat-toggle--summary {
  margin-bottom: 14px;
  padding: 12px 16px;
  border: 1px solid color-mix(in srgb, var(--bg-blue) 12%, #e5e7eb);
  border-radius: 12px;
  background: color-mix(in srgb, var(--bg-blue-secondary) 28%, #fff);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* Product grid on listings */
body.eduval-shop-listing ul.products {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(14px, 2vw, 22px);
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
}

body.eduval-shop-listing ul.products::before,
body.eduval-shop-listing ul.products::after {
  display: none !important;
  content: none !important;
}

body.eduval-shop-listing ul.products li.product {
  --eduval-loop-card-radius: 14px;
  --eduval-loop-card-pad: clamp(12px, 1.8vw, 16px);
  /* Altura mínima da faixa promo (texto centrado em flex); link usa a mesma variável */
  --eduval-promo-strip-min-h: clamp(58px, 14vw, 70px);
  position: relative;
  margin: 0 !important;
  width: 100% !important;
  max-width: none !important;
  float: none !important;
  clear: none !important;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid color-mix(in srgb, var(--bg-blue) 10%, #e5e7eb);
  border-radius: var(--eduval-loop-card-radius);
  padding: var(--eduval-loop-card-pad);
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 28px rgba(38, 30, 80, 0.04);
  overflow: hidden;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

/* Faixas topo do card: promo (Woo .onsale) + destaque (tema) — mesma grelha */
body.eduval-shop-listing ul.products li.product span.onsale,
body.eduval-shop-listing ul.products li.product span.eduval-product-strip {
  position: absolute;
  z-index: 2;
  top: calc(-1 * var(--eduval-loop-card-pad));
  left: calc(-1 * var(--eduval-loop-card-pad));
  right: calc(-1 * var(--eduval-loop-card-pad));
  width: auto;
  margin: 0;
  box-sizing: border-box;
  min-height: var(--eduval-promo-strip-min-h);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 26px var(--eduval-loop-card-pad) 11px;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.15;
  color: var(--white);
  border: 0;
  border-bottom: 1px solid color-mix(in srgb, #fff 22%, transparent);
  border-radius: var(--eduval-loop-card-radius) var(--eduval-loop-card-radius) 0 0;
  box-shadow: 0 6px 16px rgba(38, 30, 80, 0.12);
}

body.eduval-shop-listing ul.products li.product span.onsale {
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--color-secondary) 92%, #000) 0%,
    var(--color-secondary) 100%
  );
}

body.eduval-shop-listing ul.products li.product span.eduval-product-strip--destaque {
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--bg-blue) 82%, #0f172a) 0%,
    var(--bg-blue) 100%
  );
}

/*
 * Espaço real até à imagem: altura da faixa (− offset negativo) + folga explícita.
 */
body.eduval-shop-listing
  ul.products
  li.product:has(> a.woocommerce-LoopProduct-link span.onsale),
body.eduval-shop-listing
  ul.products
  li.product:has(> a.woocommerce-LoopProduct-link span.eduval-product-strip)
  > a.woocommerce-LoopProduct-link {
  display: block;
  box-sizing: border-box;
  padding-top: max(
    1.25rem,
    calc(
      var(--eduval-promo-strip-min-h) - var(--eduval-loop-card-pad) + clamp(12px, 3.5vw, 22px) - 20px
    )
  );
}

body.eduval-shop-listing ul.products li.product:hover {
  border-color: color-mix(in srgb, var(--bg-blue) 22%, var(--eduval-woo-border, #e0e0e0));
  box-shadow: 0 18px 44px rgba(38, 30, 80, 0.1);
  transform: translateY(-2px);
}

/* Link em coluna: mesma ordem DOM que promo (faixa → img); imagem sem crescer no flex */
body.eduval-shop-listing ul.products li.product a.woocommerce-LoopProduct-link {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

body.eduval-shop-listing ul.products li.product a.woocommerce-LoopProduct-link img {
  flex: 0 0 auto;
  width: 100%;
  height: 220px;
  max-height: 220px;
  object-fit: contain;
}

body.eduval-shop-listing ul.products li.product .woocommerce-loop-product__title {
  font-size: 1.04rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-align: center;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

body.eduval-shop-listing ul.products li.product a.woocommerce-LoopProduct-link {
  text-align: center;
}

body.eduval-shop-listing ul.products li.product a.button,
body.eduval-shop-listing ul.products li.product button.button {
  border-radius: 999px !important;
  min-height: 44px;
  font-weight: 700;
}

/* Prices — loop: align right like promo; regular = same chip as ins */
body.eduval-shop-listing ul.products li.product .price {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px 10px;
  width: 100%;
  text-align: right;
  margin-top: 4px;
}

body.eduval-shop-listing ul.products li.product .price ins {
  margin-left: 0;
  font-size: 1.05em;
  font-weight: 800;
}

/* Sem promoção: mesmo visual do <ins> (fundo, borda, peso) */
body.eduval-shop-listing ul.products li.product .price:not(:has(ins)) .woocommerce-Price-amount.amount,
body.eduval-shop-listing ul.products li.product .price:not(:has(ins)) span.amount {
  display: inline-block;
  font-size: 1.05em;
  font-weight: 800;
  line-height: 1.25;
  text-decoration: none !important;
  background: var(--bg-blue-secondary);
  color: var(--bg-blue);
  border: 1px solid color-mix(in srgb, var(--bg-blue) 12%, transparent);
  border-radius: var(--eduval-woo-radius, 6px);
  padding: 2px 8px;
}

body.eduval-shop-listing ul.products li.product .price del,
body.eduval-shop-listing ul.products li.product .price del .amount {
  font-size: 0.98em;
  font-weight: 800;
  color: color-mix(in srgb, var(--color-heading) 78%, var(--bg-blue)) !important;
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
  text-decoration-color: color-mix(in srgb, var(--color-secondary) 65%, #94a3b8);
  opacity: 1;
  background: transparent;
  border: 0;
  padding: 0;
}

body.eduval-shop-listing ul.products li.product .price del {
  margin-right: auto;
  text-align: left;
}

/* Pagination */
body.eduval-shop-listing nav.woocommerce-pagination {
  margin: 8px 0 0;
  clear: both;
}

body.eduval-shop-listing nav.woocommerce-pagination ul {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
  border: 0;
}

body.eduval-shop-listing nav.woocommerce-pagination ul li {
  margin: 0;
  border: 0;
  display: inline-flex;
}

body.eduval-shop-listing nav.woocommerce-pagination ul li a,
body.eduval-shop-listing nav.woocommerce-pagination ul li span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.92rem;
  text-decoration: none !important;
  border: 1px solid color-mix(in srgb, var(--bg-blue) 12%, #e5e7eb);
  background: var(--white);
  color: color-mix(in srgb, var(--bg-blue) 55%, #374151);
  line-height: 1;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}

body.eduval-shop-listing nav.woocommerce-pagination ul li a:hover {
  border-color: color-mix(in srgb, var(--bg-blue) 28%, #cbd5e1);
  color: var(--bg-blue);
  background: color-mix(in srgb, var(--bg-blue-secondary) 35%, #fff);
}

body.eduval-shop-listing nav.woocommerce-pagination ul li span.current {
  background: var(--bg-blue);
  border-color: var(--bg-blue);
  color: var(--white);
}

@media (max-width: 1024px) {
  /*
   * Toolbar: stack on tablet; kill vertical flex-grow + space-between —
   * otherwise "A mostrar…" and controls float apart with a huge empty band.
   */
  body.eduval-shop-listing .eduval-shop-toolbar {
    flex-direction: column;
    align-items: center;
    align-content: center;
    justify-content: flex-start;
    gap: 14px;
    padding: 16px 18px;
    margin-bottom: 16px;
  }

  body.eduval-shop-listing .eduval-shop-toolbar__meta,
  body.eduval-shop-listing .eduval-shop-toolbar__controls {
    flex: 0 0 auto;
    width: 100%;
    min-width: 0;
  }

  body.eduval-shop-listing .eduval-shop-toolbar__meta {
    text-align: center;
    padding-bottom: 2px;
  }

  body.eduval-shop-listing .eduval-shop-toolbar__controls {
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 14px;
  }

  body.eduval-shop-listing .eduval-vat-toggle--toolbar {
    justify-content: center;
    width: 100%;
    max-width: 100%;
    gap: 10px 14px;
    padding: 4px 0;
  }

  body.eduval-shop-listing .eduval-shop-toolbar .woocommerce-result-count {
    line-height: 1.4;
  }

  body.eduval-shop-listing .eduval-shop-toolbar .woocommerce-ordering {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
    gap: 6px;
  }

  body.eduval-shop-listing .eduval-shop-toolbar .woocommerce-ordering select {
    width: 100%;
    max-width: 360px;
    min-width: 0;
    text-align: left;
    text-align-last: left;
  }

  body.eduval-shop-listing ul.products {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 18px;
  }
}

@media (max-width: 768px) {
  body.eduval-shop-listing .eduval-shop-toolbar {
    padding: 14px 16px;
    margin-bottom: 14px;
    gap: 12px;
  }

  body.eduval-shop-listing .eduval-shop-toolbar__controls {
    gap: 12px;
  }

  body.eduval-shop-listing .eduval-vat-toggle--toolbar {
    font-size: 0.88rem;
    gap: 10px 12px;
    padding: 6px 0;
  }

  body.eduval-shop-listing .eduval-vat-toggle--toolbar .eduval-vat-toggle__modes {
    font-size: 0.75rem;
  }

  body.eduval-shop-listing .eduval-shop-toolbar .woocommerce-ordering select {
    max-width: 100%;
  }

  body.eduval-shop-listing ul.products {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
  }

  /* Respiro vertical entre cartões / face à barra (base usa margin:0 !important) */
  body.eduval-shop-listing ul.products li.product {
    margin: clamp(10px, 3vw, 15px) 0 0 !important;
  }
}

@media (max-width: 480px) {
  body.eduval-shop-listing ul.products {
    grid-template-columns: 1fr !important;
  }

  body.eduval-shop-listing ul.products li.product a.woocommerce-LoopProduct-link img {
    height: 200px;
    max-height: 200px;
  }
}

/* -------------------------------------------------------------------------
 * Shared: full-width main container (shop, tax, single product)
 * ---------------------------------------------------------------------- */

body.woocommerce-shop .site-main > .container,
body.tax-product_cat .site-main > .container,
body.tax-product_tag .site-main > .container,
body.single-product .site-main > .container {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* Single product: same inner rail as shop listing */
body.single-product .site-main > .container .woocommerce {
  max-width: 1220px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: clamp(16px, 4vw, 28px) !important;
  padding-right: clamp(16px, 4vw, 28px) !important;
  padding-bottom: clamp(28px, 5vw, 56px) !important;
}

body.single-product .woocommerce-notices-wrapper {
  max-width: 1220px;
  margin-left: auto;
  margin-right: auto;
  padding-left: clamp(16px, 4vw, 28px);
  padding-right: clamp(16px, 4vw, 28px);
}

/*
 * Single product: stack (hero card → tabs → related). Galeria + resumo partilham o mesmo quadro
 * branco (.eduval-product-hero-card) — ver woocommerce/content-single-product.php.
 */
body.single-product.woocommerce div.product {
  position: relative;
  display: flex !important;
  flex-direction: column;
  align-items: stretch;
  gap: clamp(20px, 2.8vw, 32px);
}

body.single-product.woocommerce div.product > .eduval-product-hero-card {
  position: relative;
  z-index: 0;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0;
  align-items: stretch;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: clamp(18px, 2.6vw, 28px);
  border: 1px solid rgba(38, 30, 80, 0.1);
  border-radius: 26px;
  background: var(--white);
  box-shadow: 0 22px 56px rgba(38, 30, 80, 0.09);
  overflow: hidden;
  isolation: isolate;
}

body.single-product.woocommerce div.product > .woocommerce-tabs,
body.single-product.woocommerce div.product > section.related.products,
body.single-product.woocommerce div.product > section.up-sells.upsells.products {
  width: 100%;
  min-width: 0;
}

body.single-product.woocommerce div.product > .eduval-product-hero-card > div.images {
  grid-column: 1;
  grid-row: 1;
  position: relative;
  z-index: 1;
  align-self: stretch;
  justify-self: stretch;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0;
  float: none !important;
  clear: none !important;
}

body.single-product.woocommerce div.product > .eduval-product-hero-card > span.onsale {
  grid-column: 1;
  grid-row: 1;
  z-index: 4;
  align-self: start;
  justify-self: start;
}

body.single-product.woocommerce div.product > .eduval-product-hero-card > div.summary {
  grid-column: 2;
  grid-row: 1;
  align-self: stretch;
}

@media (min-width: 769px) {
  body.single-product.woocommerce div.product > .eduval-product-hero-card > div.images {
    padding-right: clamp(12px, 2vw, 24px);
    margin-right: clamp(8px, 1.5vw, 16px);
    border-right: 1px solid color-mix(in srgb, var(--bg-blue) 8%, #e5e7eb);
  }

  body.single-product.woocommerce div.product > .eduval-product-hero-card > div.summary {
    padding-left: clamp(8px, 1.5vw, 16px);
  }
}

body.single-product.woocommerce div.product div.images,
body.single-product.woocommerce div.product div.summary {
  float: none !important;
  width: auto !important;
  margin: 0 !important;
}

body.single-product.woocommerce div.product div.images {
  padding: 0;
  margin: 0;
  border: none;
  border-radius: 0;
  background: transparent !important;
  background-color: transparent !important;
  box-shadow: none;
}

/* WooCommerce core often paints grey behind the viewport — keep tudo dentro do quadro branco */
body.single-product.woocommerce div.product .eduval-product-hero-card .woocommerce-product-gallery,
body.single-product.woocommerce div.product .eduval-product-hero-card .woocommerce-product-gallery__wrapper,
body.single-product.woocommerce div.product .eduval-product-hero-card .flex-viewport {
  background: transparent !important;
  background-color: transparent !important;
}

body.single-product.woocommerce div.product div.images .woocommerce-product-gallery {
  border-radius: 14px;
  overflow: hidden;
}

body.single-product.woocommerce div.product .eduval-product-hero-card .woocommerce-product-gallery__trigger {
  top: 10px;
  right: 10px;
  z-index: 5;
}

body.single-product.woocommerce div.product div.images .flex-viewport .woocommerce-product-gallery__image img,
body.single-product.woocommerce div.product div.images .woocommerce-product-gallery__image img {
  border-radius: 12px;
  width: 100%;
  height: auto;
  max-height: min(52vh, 480px);
  object-fit: contain;
}

body.single-product.woocommerce div.product .summary.entry-summary {
  text-align: start;
}

body.single-product.woocommerce div.product .product_title {
  margin: 0;
  font-size: clamp(1.45rem, 2.5vw, 1.85rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--color-heading);
  text-align: start;
}

body.single-product.woocommerce div.product .woocommerce-product-details__short-description {
  font-size: 1rem;
  line-height: 1.65;
  color: var(--color-paragraph);
  text-align: start;
}

body.single-product.woocommerce div.product .woocommerce-product-details__short-description p {
  text-align: start;
  text-justify: auto;
}

body.single-product.woocommerce div.product .woocommerce-product-details__short-description > :first-child {
  margin-top: 0;
}

body.single-product.woocommerce div.product .woocommerce-product-details__short-description > :last-child {
  margin-bottom: 0;
}

body.single-product.woocommerce div.product form.cart {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

body.single-product.woocommerce div.product form.cart .quantity .qty {
  min-height: 48px;
}

/*
 * WooCommerce marks single-product add-to-cart as .button.alt (orange gradient in base).
 * Storefront pattern: same primary as loop / account — navy, no gradient.
 */
body.single-product.woocommerce div.product .summary form.cart .button,
body.single-product.woocommerce div.product .summary form.cart button.button.alt,
body.single-product.woocommerce div.product .summary form.cart input.button.alt {
  background-image: none !important;
  background-color: var(--bg-blue) !important;
  color: var(--white) !important;
  border: none !important;
  border-radius: 12px !important;
  padding: 14px 22px !important;
  font-weight: 700 !important;
  line-height: 1.2 !important;
  box-shadow: none !important;
  transition:
    opacity 0.15s ease,
    filter 0.15s ease;
}

body.single-product.woocommerce div.product .summary form.cart .button:hover,
body.single-product.woocommerce div.product .summary form.cart button.button.alt:hover,
body.single-product.woocommerce div.product .summary form.cart input.button.alt:hover {
  background-color: var(--bg-blue) !important;
  background-image: none !important;
  opacity: 0.92;
  filter: brightness(1.04);
}

body.single-product.woocommerce div.product .summary .price {
  margin: 0;
  font-size: clamp(1.2rem, 2.2vw, 1.45rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--bg-blue);
}

body.single-product.woocommerce div.product .summary .woocommerce-product-rating {
  margin: -6px 0 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

body.single-product.woocommerce div.product .summary .product_meta {
  margin: 0;
  padding-top: 4px;
  font-size: 0.9rem;
  line-height: 1.55;
  color: color-mix(in srgb, var(--color-paragraph) 92%, var(--bg-blue));
  border-top: 1px solid color-mix(in srgb, var(--bg-blue) 8%, #e5e7eb);
}

body.single-product.woocommerce div.product .summary .product_meta > span {
  display: block;
  margin: 0.35em 0 0;
}

body.single-product.woocommerce div.product .summary .product_meta a {
  color: var(--bg-blue);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

body.single-product.woocommerce div.product .summary .product_meta a:hover {
  color: color-mix(in srgb, var(--bg-blue) 75%, #0f172a);
}

/* Bloco de confiança — faixa única integrada (evita 3 “caixas” soltas) */
body.single-product.woocommerce .eduval-product-reassurance {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  margin: clamp(8px, 1.8vw, 14px) 0 0;
  padding: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  border: 1px solid color-mix(in srgb, var(--bg-blue) 10%, #e5e7eb);
  border-radius: 14px;
  overflow: hidden;
  background: color-mix(in srgb, var(--bg-blue-secondary) 14%, #fff);
}

body.single-product.woocommerce .eduval-product-reassurance__item {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1 1 200px;
  margin: 0;
  padding: 12px 14px;
  border: 0;
  border-radius: 0;
  background: transparent;
  text-align: start;
  min-width: 0;
}

body.single-product.woocommerce .eduval-product-reassurance__item:not(:last-child) {
  border-right: 1px solid color-mix(in srgb, var(--bg-blue) 8%, #e5e7eb);
}

body.single-product.woocommerce .eduval-product-reassurance__title {
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--bg-blue);
  line-height: 1.25;
}

body.single-product.woocommerce .eduval-product-reassurance__text {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 500;
  line-height: 1.5;
  color: color-mix(in srgb, var(--color-paragraph) 90%, var(--bg-blue));
}

@media (max-width: 640px) {
  body.single-product.woocommerce .eduval-product-reassurance {
    flex-direction: column;
  }

  body.single-product.woocommerce .eduval-product-reassurance__item:not(:last-child) {
    border-right: none;
    border-bottom: 1px solid color-mix(in srgb, var(--bg-blue) 8%, #e5e7eb);
  }
}

body.single-product.woocommerce div.product div.images .flex-control-thumbs {
  margin: 12px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
}

body.single-product.woocommerce div.product div.images .flex-control-thumbs li {
  float: none !important;
  width: 72px !important;
  margin: 0 !important;
}

body.single-product.woocommerce div.product div.images .flex-control-thumbs img {
  border-radius: 8px;
  border: 2px solid transparent;
  opacity: 0.88;
  transition:
    border-color 0.15s ease,
    opacity 0.15s ease;
}

body.single-product.woocommerce div.product div.images .flex-control-thumbs .flex-active,
body.single-product.woocommerce div.product div.images .flex-control-thumbs img:hover {
  opacity: 1;
  border-color: color-mix(in srgb, var(--bg-blue) 35%, #cbd5e1);
}

/* Tabs: card + readable measure */
body.single-product.woocommerce div.product > .woocommerce-tabs {
  margin-top: clamp(8px, 2vw, 20px);
  padding: clamp(20px, 3vw, 28px);
  border: 1px solid color-mix(in srgb, var(--bg-blue) 12%, #e5e7eb);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 12px 36px rgba(38, 30, 80, 0.05);
}

body.single-product.woocommerce div.product .woocommerce-tabs ul.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin: 0 0 clamp(16px, 2vw, 22px);
  padding: 0 0 12px;
  list-style: none;
  border-bottom: 1px solid color-mix(in srgb, var(--bg-blue) 10%, #e5e7eb);
}

body.single-product.woocommerce div.product .woocommerce-tabs ul.tabs li {
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
}

body.single-product.woocommerce div.product .woocommerce-tabs ul.tabs li a {
  display: inline-flex;
  align-items: center;
  padding: 10px 16px;
  font-weight: 700;
  font-size: 0.95rem;
  color: color-mix(in srgb, var(--color-paragraph) 85%, var(--bg-blue));
  border-radius: 999px;
  border: 1px solid transparent;
  transition:
    color 0.15s ease,
    background 0.15s ease,
    border-color 0.15s ease;
}

body.single-product.woocommerce div.product .woocommerce-tabs ul.tabs li.active a,
body.single-product.woocommerce div.product .woocommerce-tabs ul.tabs li a:hover {
  color: var(--bg-blue);
  background: color-mix(in srgb, var(--bg-blue-secondary) 55%, #fff);
  border-color: color-mix(in srgb, var(--bg-blue) 14%, transparent);
}

body.single-product.woocommerce div.product .woocommerce-tabs .panel {
  margin: 0;
  padding: 0;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--color-paragraph);
  text-align: start;
}

body.single-product.woocommerce div.product .woocommerce-tabs .panel p {
  text-align: start;
  text-justify: auto;
}

body.single-product.woocommerce div.product .woocommerce-tabs .woocommerce-Tabs-panel--description {
  max-width: 72ch;
}

/* Conteúdo da tab costuma repetir o título “Descrição” em <h2> — reduz hierarquia visual */
body.single-product.woocommerce div.product .woocommerce-tabs .woocommerce-Tabs-panel--description > h2:first-of-type {
  margin: 0 0 0.65rem;
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--color-heading);
}

body.single-product.woocommerce div.product .woocommerce-tabs .panel > :first-child {
  margin-top: 0;
}

/* Upsells + related: section spacing and grid aligned with listing */
body.single-product.woocommerce div.product > section.up-sells.upsells.products,
body.single-product.woocommerce div.product > section.related.products {
  margin-top: clamp(28px, 4vw, 44px);
  padding-top: clamp(22px, 3vw, 32px);
  border-top: 1px solid color-mix(in srgb, var(--bg-blue) 8%, #e5e7eb);
}

body.single-product.woocommerce div.product > section.up-sells.upsells.products > h2,
body.single-product.woocommerce div.product > section.related.products > h2 {
  margin: 0 0 clamp(16px, 2vw, 22px);
  font-size: clamp(1.15rem, 2vw, 1.35rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--color-heading);
}

body.single-product.woocommerce section.related.products ul.products,
body.single-product.woocommerce section.up-sells.upsells.products ul.products {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(14px, 2vw, 22px);
  list-style: none;
  padding: 0;
  margin: 0;
}

body.single-product.woocommerce section.related.products ul.products::before,
body.single-product.woocommerce section.related.products ul.products::after,
body.single-product.woocommerce section.up-sells.upsells.products ul.products::before,
body.single-product.woocommerce section.up-sells.upsells.products ul.products::after {
  display: none !important;
  content: none !important;
}

body.single-product.woocommerce section.related.products ul.products li.product,
body.single-product.woocommerce section.up-sells.upsells.products ul.products li.product {
  --eduval-loop-card-radius: 14px;
  --eduval-loop-card-pad: clamp(12px, 1.8vw, 16px);
  position: relative;
  margin: 0 !important;
  width: 100% !important;
  max-width: none !important;
  float: none !important;
  clear: none !important;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid color-mix(in srgb, var(--bg-blue) 10%, #e5e7eb);
  border-radius: var(--eduval-loop-card-radius);
  padding: var(--eduval-loop-card-pad);
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 28px rgba(38, 30, 80, 0.04);
}

body.single-product.woocommerce section.related.products ul.products li.product a.woocommerce-LoopProduct-link,
body.single-product.woocommerce section.up-sells.upsells.products ul.products li.product a.woocommerce-LoopProduct-link {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-align: center;
}

body.single-product.woocommerce section.related.products ul.products li.product a.woocommerce-LoopProduct-link img,
body.single-product.woocommerce section.up-sells.upsells.products ul.products li.product a.woocommerce-LoopProduct-link img {
  flex: 0 0 auto;
  width: 100%;
  height: 200px;
  max-height: 200px;
  object-fit: contain;
}

body.single-product.woocommerce section.related.products ul.products li.product .woocommerce-loop-product__title,
body.single-product.woocommerce section.up-sells.upsells.products ul.products li.product .woocommerce-loop-product__title {
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}

/* Related / upsells: match shop loop — navy CTA, pill shape (body is not .eduval-shop-listing) */
body.single-product.woocommerce section.related.products ul.products li.product a.button,
body.single-product.woocommerce section.related.products ul.products li.product button.button,
body.single-product.woocommerce section.up-sells.upsells.products ul.products li.product a.button,
body.single-product.woocommerce section.up-sells.upsells.products ul.products li.product button.button {
  border-radius: 999px !important;
  min-height: 44px;
  font-weight: 700;
  background-image: none !important;
  background-color: var(--bg-blue) !important;
  color: var(--white) !important;
}

body.single-product.woocommerce section.related.products ul.products li.product a.button:hover,
body.single-product.woocommerce section.related.products ul.products li.product button.button:hover,
body.single-product.woocommerce section.up-sells.upsells.products ul.products li.product a.button:hover,
body.single-product.woocommerce section.up-sells.upsells.products ul.products li.product button.button:hover {
  background-color: var(--bg-blue) !important;
  background-image: none !important;
  opacity: 0.92;
}

@media (max-width: 1024px) {
  body.single-product.woocommerce section.related.products ul.products,
  body.single-product.woocommerce section.up-sells.upsells.products ul.products {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 480px) {
  body.single-product.woocommerce section.related.products ul.products,
  body.single-product.woocommerce section.up-sells.upsells.products ul.products {
    grid-template-columns: 1fr !important;
  }
}

body.single-product.woocommerce div.product div.summary.entry-summary {
  display: grid;
  gap: 18px;
  padding: 0;
  margin: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

/* Sale badge — single: topo e lados sem offset; mais padding por baixo face à galeria */
body.single-product.woocommerce span.onsale {
  position: absolute;
  z-index: 2;
  top: 0;
  left: 0;
  right: auto;
  min-height: auto;
  margin: 0;
  padding: 18px 16px 14px;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.4;
  color: var(--white);
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--color-secondary) 92%, #000) 0%,
    var(--color-secondary) 100%
  );
  border: 1px solid color-mix(in srgb, #fff 25%, transparent);
  border-radius: 0 0 8px 0;
  box-shadow: 0 10px 26px rgba(38, 30, 80, 0.22);
}

/* Sale prices — single */
body.single-product.woocommerce div.product p.price del,
body.single-product.woocommerce div.product span.price del {
  font-size: 1em;
  font-weight: 800;
  color: color-mix(in srgb, var(--color-heading) 78%, var(--bg-blue)) !important;
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
  text-decoration-color: color-mix(in srgb, var(--color-secondary) 65%, #94a3b8);
  opacity: 1;
  margin-right: 0.35em;
}

body.single-product.woocommerce div.product p.price ins,
body.single-product.woocommerce div.product span.price ins {
  font-size: 1.08em;
  font-weight: 800;
}

@media (max-width: 768px) {
  body.single-product.woocommerce div.product {
    gap: 16px;
  }

  body.single-product.woocommerce div.product > .eduval-product-hero-card {
    grid-template-columns: 1fr;
    padding: clamp(16px, 4vw, 22px);
  }

  body.single-product.woocommerce div.product > .eduval-product-hero-card > div.images,
  body.single-product.woocommerce div.product > .eduval-product-hero-card > span.onsale {
    grid-column: 1;
    grid-row: 1;
  }

  body.single-product.woocommerce div.product > .eduval-product-hero-card > div.summary {
    grid-column: 1;
    grid-row: 2;
  }

  body.single-product.woocommerce div.product > .eduval-product-hero-card > div.images {
    padding-right: 0;
    margin-right: 0;
    border-right: none;
    padding-bottom: clamp(12px, 3vw, 18px);
    margin-bottom: clamp(8px, 2vw, 14px);
    border-bottom: 1px solid color-mix(in srgb, var(--bg-blue) 8%, #e5e7eb);
  }

  body.single-product.woocommerce div.product > .eduval-product-hero-card > div.summary {
    padding-left: 0;
  }
}
