/* ESTYLUS V3.4 — SHOP, PRODUCT, CART & NAVIGATION */

:root {
  --est34-dark: #302722;
  --est34-brown: #8e6654;
  --est34-cream: #f8f5f1;
  --est34-border: #e7e0da;
}

/* IDENTIDADE GERAL */

body.woocommerce-page {
  --theme-palette-color-1: #302722;
  --theme-palette-color-2: #8e6654;
  --theme-button-background-initial-color: #302722;
  --theme-button-background-hover-color: #8e6654;
  --theme-button-text-initial-color: #ffffff;
  --theme-button-text-hover-color: #ffffff;
}

body.woocommerce-page .ct-container {
  color: var(--est34-dark);
}

/* CARRINHO NO MENU */

.est34-cart-link > a {
  display: inline-flex !important;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.est34-cart-icon {
  display: inline-flex;
  width: 19px;
  height: 19px;
  align-items: center;
  justify-content: center;
}

.est34-cart-icon svg {
  width: 19px;
  height: 19px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.est34-cart-count {
  display: inline-flex;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--est34-dark);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}

/* LOJA — CABEÇALHO MAIS COMPACTO */

body.post-type-archive-product .hero-section,
body.tax-product_cat .hero-section,
body.post-type-archive-product .ct-hero-section,
body.tax-product_cat .ct-hero-section {
  min-height: 0 !important;
  padding-top: 32px !important;
  padding-bottom: 32px !important;
  background: var(--est34-cream) !important;
}

body.post-type-archive-product .hero-section h1,
body.tax-product_cat .hero-section h1,
body.post-type-archive-product .page-title,
body.tax-product_cat .page-title {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(32px, 3.5vw, 50px);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -.04em;
  color: var(--est34-dark);
}

/* CATÁLOGO */

body.post-type-archive-product ul.products li.product img,
body.tax-product_cat ul.products li.product img {
  width: 100%;
  background: #f6f3f0;
  object-fit: contain;
}

body.post-type-archive-product ul.products li.product .price,
body.tax-product_cat ul.products li.product .price {
  color: var(--est34-dark);
  font-weight: 700;
}

body.post-type-archive-product ul.products li.product .button,
body.tax-product_cat ul.products li.product .button {
  background: var(--est34-dark) !important;
  color: #fff !important;
  border-color: var(--est34-dark) !important;
  border-radius: 0 !important;
}

body.post-type-archive-product ul.products li.product .button:hover,
body.tax-product_cat ul.products li.product .button:hover {
  background: var(--est34-brown) !important;
}

/* PRODUTO — BOTÕES E CONTROLOS */

body.single-product .single_add_to_cart_button,
body.single-product button.single_add_to_cart_button,
body.single-product .ct-cart-actions button,
body.single-product .woocommerce-variation-add-to-cart button {
  background: var(--est34-dark) !important;
  background-color: var(--est34-dark) !important;
  border-color: var(--est34-dark) !important;
  color: #fff !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

body.single-product .single_add_to_cart_button:hover,
body.single-product .ct-cart-actions button:hover {
  background: var(--est34-brown) !important;
  background-color: var(--est34-brown) !important;
}

body.single-product .quantity,
body.single-product .ct-quantity,
body.single-product .ct-product-quantity {
  border-color: var(--est34-border) !important;
}

body.single-product .quantity button,
body.single-product .ct-quantity button,
body.single-product .quantity input {
  color: var(--est34-dark) !important;
  border-color: var(--est34-border) !important;
}

body.single-product .woocommerce-tabs .tabs a,
body.single-product .woocommerce-product-details__short-description a,
body.single-product .woocommerce-breadcrumb a,
body.single-product .product_meta a {
  color: var(--est34-brown) !important;
}

body.single-product .woocommerce-tabs .tabs .active a {
  color: var(--est34-dark) !important;
}

body.single-product .product_title {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
  letter-spacing: -.035em;
}

/* CARRINHO — WOOCOMMERCE CLÁSSICO E BLOCKS */

body.woocommerce-cart .wc-proceed-to-checkout a.checkout-button,
body.woocommerce-cart .checkout-button,
body.woocommerce-cart .wc-block-cart__submit-button,
body.woocommerce-cart .wc-block-components-button,
body.woocommerce-checkout #place_order,
body.woocommerce-checkout .wc-block-components-checkout-place-order-button {
  background: var(--est34-dark) !important;
  background-color: var(--est34-dark) !important;
  border-color: var(--est34-dark) !important;
  color: #fff !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

body.woocommerce-cart .wc-proceed-to-checkout a.checkout-button:hover,
body.woocommerce-cart .wc-block-cart__submit-button:hover,
body.woocommerce-cart .wc-block-components-button:hover,
body.woocommerce-checkout #place_order:hover {
  background: var(--est34-brown) !important;
  background-color: var(--est34-brown) !important;
}

body.woocommerce-cart a:not(.button),
body.woocommerce-checkout a:not(.button) {
  --theme-link-initial-color: #8e6654;
  --theme-link-hover-color: #302722;
}

body.woocommerce-cart .wc-block-cart-item__product a,
body.woocommerce-cart .woocommerce-cart-form__cart-item a {
  color: var(--est34-dark);
}

body.woocommerce-cart .wc-block-cart,
body.woocommerce-cart .woocommerce {
  margin-bottom: 50px;
}

/* HOMEPAGE — PRODUTO ÚNICO EM DESTAQUE */

@media (min-width: 768px) {
  body.home .est3-products .woocommerce ul.products:has(> li.product:only-child) {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body.home .est3-products .woocommerce ul.products > li.product:only-child {
    display: grid !important;
    grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr);
    align-items: center;
    column-gap: clamp(28px, 5vw, 80px);
    width: 100% !important;
    max-width: 900px !important;
    min-height: 340px;
    margin: 0 auto !important;
  }

  body.home .est3-products .woocommerce ul.products > li.product:only-child > a:first-child {
    grid-column: 1;
    grid-row: 1 / span 6;
  }

  body.home .est3-products .woocommerce ul.products > li.product:only-child img {
    width: 100%;
    max-height: 430px;
    object-fit: contain;
    margin-bottom: 0;
  }

  body.home .est3-products .woocommerce ul.products > li.product:only-child > :not(a:first-child) {
    grid-column: 2;
  }
}

/* RESPONSIVO */

@media (max-width: 767px) {
  body.home .est3-products .woocommerce ul.products > li.product:only-child {
    width: 100% !important;
    max-width: 100% !important;
  }

  body.woocommerce-cart .wc-block-cart {
    margin-bottom: 30px;
  }

  .est34-cart-link > a {
    gap: 8px;
  }
}

/* ESTYLUS V3.4 — CORREÇÕES VISUAIS */

/* Carrinho compacto no cabeçalho */
.ct-header .est34-cart-link,
.ct-header .est34-cart-link > a {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  vertical-align: middle !important;
}

.ct-header .est34-cart-link > a {
  flex-direction: row !important;
  gap: 6px !important;
  height: 42px !important;
  padding: 0 8px !important;
  line-height: 1 !important;
}

.ct-header .est34-cart-icon,
.ct-header .est34-cart-icon svg {
  display: block !important;
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
  max-width: 18px !important;
  max-height: 18px !important;
}

.ct-header .est34-cart-icon svg {
  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 1.8 !important;
}

.ct-header .est34-cart-count {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
  padding: 0 !important;
  border-radius: 50% !important;
  background: #302722 !important;
  color: #fff !important;
  font-size: 10px !important;
}

/* Botão de compra na página individual */
body.single-product form.cart button.single_add_to_cart_button,
body.single-product form.cart .single_add_to_cart_button,
body.single-product .ct-cart-actions .single_add_to_cart_button {
  background: #302722 !important;
  background-color: #302722 !important;
  color: #fff !important;
  border: 1px solid #302722 !important;
  box-shadow: none !important;
}

/* Botões do carrinho em blocos WooCommerce */
body.woocommerce-cart .wp-block-woocommerce-cart
.wc-block-cart__submit-container
.wc-block-components-button,
body.woocommerce-cart .wp-block-woocommerce-cart
.wc-block-cart__submit-button,
body.woocommerce-cart .wc-block-components-button:not(.is-link) {
  background: #302722 !important;
  background-color: #302722 !important;
  color: #fff !important;
  border: 1px solid #302722 !important;
  box-shadow: none !important;
}

/* Links no carrinho */
body.woocommerce-cart .wc-block-cart-item__product a {
  color: #302722 !important;
}

/* Cabeçalho da loja: reduzir o espaço interior */
body.post-type-archive-product .hero-section .ct-container,
body.tax-product_cat .hero-section .ct-container,
body.post-type-archive-product .ct-hero-section .ct-container,
body.tax-product_cat .ct-hero-section .ct-container {
  min-height: 0 !important;
  padding-top: 18px !important;
  padding-bottom: 18px !important;
}

