/* Só Papel 4.2.0 — alinhamento global, produto e sistema visual refinado. */
:root {
  --sp-shell-width: 1320px;
  --sp-shell-gutter: clamp(18px, 4vw, 48px);
}

/* O catálogo passa a ser a referência de alinhamento para todo o site. */
.container,
.site-header .container,
.site-footer .container,
.site-section > .container,
.woocommerce .container {
  width: calc(100% - 48px) !important;
  max-width: var(--sp-shell-width) !important;
  margin-inline: auto !important;
  padding-inline: 0 !important;
  box-sizing: border-box !important;
}

body.home #cores > .container,
body.single-product .site-section > .container {
  width: calc(100% - 48px) !important;
  max-width: var(--sp-shell-width) !important;
  padding-inline: 0 !important;
}

/* Os cabeçalhos internos não criam um segundo recuo dentro do container. */
body.home #cores .sp-catalog-head,
body.home .site-hero > .container,
.site-header > .container,
.site-topbar > .container,
.site-footer > .container {
  padding-inline: 0 !important;
}

body.home #cores .sp-catalog-head {
  width: 100% !important;
  max-width: none !important;
  margin-inline: 0 !important;
}

/* As duas colunas do produto deixam de compartilhar linhas de altura. */
body.single-product.woocommerce div.product {
  display: grid !important;
  grid-template-columns: minmax(0, 1.25fr) minmax(350px, .75fr) !important;
  grid-template-rows: auto auto !important;
  align-items: start !important;
  gap: 0 clamp(30px, 3.5vw, 48px) !important;
}

body.single-product .sp-product-media-column {
  grid-column: 1 !important;
  grid-row: 1 !important;
  display: flex;
  flex-direction: column;
  min-width: 0;
  align-self: start;
}

body.single-product.woocommerce div.product .sp-product-media-column > div.woocommerce-product-gallery.images {
  position: static !important;
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
}

body.single-product.woocommerce div.product div.summary.entry-summary {
  grid-column: 2 !important;
  grid-row: 1 !important;
  align-self: start !important;
  height: auto !important;
  min-height: 0 !important;
}

body.single-product .sp-product-media-column > .sp-paper-facts {
  display: block !important;
  width: 100% !important;
  margin: 22px 0 0 !important;
  padding: 22px 0 0 !important;
  border: 0 !important;
  border-top: 1px solid #dfe1e9 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

/* Detalhes: apenas o texto curto editável do produto. */
body.single-product .sp-product-media-column .sp-paper-facts__eyebrow,
body.single-product .sp-product-media-column .sp-paper-facts > h2,
body.single-product .sp-product-media-column .sp-paper-facts__terms,
body.single-product .sp-product-media-column .sp-paper-facts__texture,
body.single-product .sp-product-media-column .sp-product-context,
body.single-product .sp-product-media-column .sp-product-editorial {
  display: none !important;
}

body.single-product .sp-product-media-column .sp-paper-facts__description {
  max-width: 70ch;
  color: #555b68 !important;
  font-size: 16px;
  line-height: 1.68 !important;
}

body.single-product .sp-product-media-column > .sp-paper-facts:not(:has(.sp-paper-facts__description)) {
  display: none !important;
}

body.single-product.woocommerce div.product > .sp-related-section,
body.single-product.woocommerce div.product > .related,
body.single-product.woocommerce div.product > .upsells {
  grid-column: 1 / -1 !important;
  grid-row: 2 !important;
  margin-top: clamp(42px, 6vw, 72px) !important;
}

/* Resumo comercial criado com dados da seleção atual. */
body.single-product .sp-order-review {
  display: grid;
  gap: 7px;
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid #dde1ea;
}

body.single-product .sp-order-review > span {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

body.single-product .sp-order-review small {
  color: #626875;
  line-height: 1.45;
}

body.single-product .sp-order-review__subtotal {
  margin-top: 3px;
  color: var(--brand-red, #e63224);
  font-size: 18px;
}

body.single-product .sp-order-review__subtotal strong:last-child {
  font-size: 22px;
}

/* Catálogo como mostruário: cards alinhados e sem a página de configuração
   inteira repetida dentro da grade. */
body.home #sp-products-grid > ul.products > li.product {
  display: flex !important;
  flex-direction: column !important;
  min-height: 100%;
  border: 1px solid #e3e4e9 !important;
  background: #fff;
}

body.home #sp-products-grid .sp-img-wrap {
  aspect-ratio: 1 / 1;
  background: #f5f5f3;
}

body.home #sp-products-grid .sp-img-wrap img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}

body.home #sp-products-grid .sp-card-purchase--lightweight {
  display: flex !important;
  flex: 1;
  flex-direction: column;
  align-items: stretch;
  padding: 18px 18px 20px !important;
}

body.home #sp-products-grid .sp-card-purchase--lightweight .sp-product-link {
  min-height: 2.6em;
}

body.home #sp-products-grid .sp-card-purchase--lightweight .sp-mobile-product-options-link {
  width: 100%;
  min-height: 46px;
  margin-top: auto;
  justify-content: space-between;
  border-radius: 8px;
}

/* Menos cartões aninhados na configuração do produto. */
body.single-product .sp-product-choice-flow {
  gap: 12px !important;
}

body.single-product .sp-product-choice-step,
body.single-product .sp-product-choice-flow > .sp-custom-cut,
body.single-product .sp-variation-decision {
  border-color: #dfe1e8 !important;
  border-radius: 10px !important;
  box-shadow: none !important;
}

body.single-product .sp-product-choice-step__head {
  padding-bottom: 10px;
}

body.single-product .summary input,
body.single-product .summary select {
  min-height: 46px;
  border-radius: 8px !important;
}

body.single-product .summary button,
body.single-product .summary .button {
  min-height: 46px;
}

body.single-product div.product .woocommerce-product-gallery ol.flex-control-thumbs {
  scrollbar-width: thin;
  scroll-snap-type: x proximity;
}

body.single-product div.product .woocommerce-product-gallery ol.flex-control-thumbs > li {
  scroll-snap-align: start;
}

/* Mesmo quando houver somente um resultado, ele mantém a largura de um card
   da grade de quatro colunas. */
@media (min-width: 961px) {
  body.single-product .sp-related-section--single ul.products {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    justify-content: stretch !important;
  }
}

@media (max-width: 980px) {
  body.single-product.woocommerce div.product {
    display: flex !important;
    flex-direction: column !important;
  }
  body.single-product .sp-product-media-column { order: 1 !important; width: 100%; }
  body.single-product.woocommerce div.product div.summary.entry-summary { order: 2 !important; width: 100% !important; }
  body.single-product.woocommerce div.product > .sp-related-section,
  body.single-product.woocommerce div.product > .related,
  body.single-product.woocommerce div.product > .upsells { order: 3 !important; }
}

@media (max-width: 640px) {
  :root { --sp-shell-gutter: 16px; }
  .container,
  .site-header .container,
  .site-footer .container,
  .site-section > .container,
  .woocommerce .container,
  body.home #cores > .container,
  body.single-product .site-section > .container {
    width: 100% !important;
    padding-inline: 16px !important;
  }
  body.single-product .sp-order-review > span { align-items: flex-start; flex-direction: column; gap: 2px; }
}
