/* =========================================================
   FORUM BRASIL 3D - WOOCOMMERCE CUSTOMIZER STYLES (LIMPO)
   ========================================================= */

/* ====== VARIÁVEIS ====== */
:root{
  --fb3d-primary:#009c3b;
  --fb3d-secondary:#ffdf00;
  --fb3d-accent:#00a650;
  --fb3d-dark:#111111;
  --fb3d-light:#f8f9fa;
  --fb3d-text:#333333;
  --fb3d-text-light:#666666;
  --fb3d-border:#e0e0e0;
  --fb3d-radius:8px;
  --fb3d-shadow:0 2px 12px rgba(0,0,0,.08);
  --fb3d-font:'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ====== BASE ====== */
.woocommerce,
.woocommerce-page{
  font-family:var(--fb3d-font) !important;
  color:var(--fb3d-text) !important;
}

/* =========================================================
   SINGLE PRODUCT (modo limpo)
   ========================================================= */

/* Esconde header do tema somente na single product */
body.single-product.fb3d-single-product-clean #masthead,
body.single-product.fb3d-single-product-clean header#masthead,
body.single-product.fb3d-single-product-clean .site-header,
body.single-product.fb3d-single-product-clean #site-header,
body.single-product.fb3d-single-product-clean .main-header-bar,
body.single-product.fb3d-single-product-clean .ast-primary-header-bar,
body.single-product.fb3d-single-product-clean .wp-block-template-part{
  display:none !important;
}

body.single-product.fb3d-single-product-clean #page,
body.single-product.fb3d-single-product-clean .site,
body.single-product.fb3d-single-product-clean .site-content{
  margin-top:0 !important;
  padding-top:0 !important;
}

/* Header do plugin (somente logo clicável) */
body.single-product.fb3d-single-product-clean .fb3d-wc-header{
  display:flex !important;
  justify-content:center;
  align-items:center;
  padding:12px 0 14px !important;
  margin:0 0 18px !important;
  border-bottom:1px solid #e5e7eb;
  background:#fff;
  text-align:center;
}

/* Segurança: esconde qualquer img solta duplicada */
body.single-product.fb3d-single-product-clean .fb3d-wc-header > img{
  display:none !important;
}

/* Logo clicável */
body.single-product.fb3d-single-product-clean .fb3d-wc-header > a{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  line-height:0;
}
body.single-product.fb3d-single-product-clean .fb3d-wc-header > a img{
  display:block;
  width:auto !important;
  height:auto !important;
  max-width:180px !important;
  max-height:56px !important;
  object-fit:contain;
}

/* Wrapper */
.fb3d-product-page{
  max-width:1100px;
  margin:0 auto;
  padding:0 16px;
}

/* Esconde elementos padrão na landing */
.fb3d-landing-mode .woocommerce-breadcrumb,
.fb3d-landing-mode .product_meta,
.fb3d-landing-mode .woocommerce-tabs,
.fb3d-landing-mode .related.products,
.fb3d-landing-mode .upsells.products{
  display:none !important;
}

/* Distribuição produto */
body.single-product.fb3d-single-product-clean div.product{
  display:grid;
  grid-template-columns:1.05fr .95fr;
  gap:28px;
  align-items:start;
}

body.single-product.fb3d-single-product-clean .woocommerce-product-gallery,
body.single-product.fb3d-single-product-clean .summary.entry-summary{
  width:100% !important;
  float:none !important;
  margin:0 !important;
}

/* Imagem principal menor no desktop */
body.single-product.fb3d-single-product-clean .woocommerce-product-gallery{
  max-width:520px;
  margin:0 auto !important;
}
body.single-product.fb3d-single-product-clean .woocommerce-product-gallery img{
  width:100%;
  height:auto;
  object-fit:contain;
}

/* Miniaturas */
.fb3d-gallery{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:10px;
  margin-top:16px;
}
.fb3d-gallery img{
  width:100%;
  border-radius:var(--fb3d-radius);
  border:2px solid transparent;
  transition:border-color .2s;
  cursor:pointer;
}
.fb3d-gallery img:hover,
.fb3d-gallery img.active{
  border-color:var(--fb3d-primary);
}

/* Miniaturas Woo nativas no mobile: uma linha sem scroll */
@media (max-width:768px){
  body.single-product.fb3d-single-product-clean .flex-control-thumbs{
    display:flex !important;
    gap:6px;
    overflow:visible !important;
    flex-wrap:nowrap !important;
  }
  body.single-product.fb3d-single-product-clean .flex-control-thumbs li{
    width:auto !important;
    flex:1 1 0 !important;
    float:none !important;
    margin:0 !important;
  }
  body.single-product.fb3d-single-product-clean .flex-control-thumbs img{
    width:100% !important;
    height:auto !important;
    object-fit:cover;
  }
}

/* Descrições */
.fb3d-short-description{
  margin:14px 0 18px;
  padding:14px 16px;
  background:#f8fafc;
  border:1px solid #e5e7eb;
  border-radius:10px;
  color:#334155;
  line-height:1.65;
}
.fb3d-product-description-block{
  margin-top:30px;
  padding:24px;
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:12px;
  box-shadow:0 4px 18px rgba(15,23,42,.05);
}
.fb3d-product-description-block h2{
  margin:0 0 12px;
  font-size:1.35rem;
  color:#111827;
}
.fb3d-product-description-content{
  color:#334155;
  line-height:1.75;
}

/* =========================================================
   BOTÕES
   ========================================================= */
.woocommerce .button,
.woocommerce-page .button,
#place_order,
.checkout-button,
.single_add_to_cart_button,
.add_to_cart_button{
  background:var(--fb3d-accent) !important;
  color:#fff !important;
  font-weight:700 !important;
  padding:14px 28px !important;
  border-radius:var(--fb3d-radius) !important;
  border:none !important;
  text-transform:uppercase !important;
  font-size:.95rem !important;
  transition:all .2s ease !important;
  cursor:pointer !important;
}
.woocommerce .button:hover,
.woocommerce-page .button:hover,
#place_order:hover,
.checkout-button:hover,
.single_add_to_cart_button:hover{
  background:#008f44 !important;
  transform:translateY(-1px) !important;
  box-shadow:0 4px 12px rgba(0,166,80,.3) !important;
}

.fb3d-btn-primary{
  background:var(--fb3d-secondary) !important;
  color:var(--fb3d-dark) !important;
  font-weight:800 !important;
  padding:18px 40px !important;
  font-size:1.1rem !important;
}
.fb3d-btn-primary:hover{
  background:#f5d500 !important;
  color:var(--fb3d-dark) !important;
}

/* =========================================================
   SWATCHES / VARIAÇÕES
   ========================================================= */
.woo-variation-swatches .variable-items-wrapper{
  display:flex !important;
  flex-wrap:wrap;
  gap:10px;
  margin:8px 0 6px;
}
.woo-variation-swatches .variable-items-wrapper .variable-item{
  min-width:46px;
  height:38px;
  padding:0 12px;
  border:1px solid #d1d5db !important;
  border-radius:10px !important;
  background:#fff !important;
  box-shadow:none !important;
  transition:.2s ease;
}
.woo-variation-swatches .variable-items-wrapper .variable-item:hover{
  border-color:#2563eb !important;
}
.woo-variation-swatches .variable-items-wrapper .variable-item.selected,
.woo-variation-swatches .variable-items-wrapper .variable-item.selected:hover{
  border-color:#2563eb !important;
  background:#eff6ff !important;
  color:#1e40af !important;
  font-weight:700;
}
table.variations th.label label{
  font-size:18px;
  font-weight:700;
  color:#111827;
}
.woo-variation-swatches table.variations select{
  display:none !important;
}

/* Fallback custom buttons */
.fb3d-attr-buttons{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-top:8px;
}
.fb3d-attr-btn{
  border:1px solid #d1d5db;
  border-radius:10px;
  height:38px;
  padding:0 14px;
  background:#fff;
  font-weight:600;
  cursor:pointer;
}
.fb3d-attr-btn:hover{ border-color:#2563eb; }
.fb3d-attr-btn.is-active{
  border-color:#2563eb;
  background:#eff6ff;
  color:#1e40af;
}

/* =========================================================
   CARRINHO
   ========================================================= */
body.fb3d-cart-page .woocommerce-cart-form,
body.fb3d-cart-page .cart-collaterals{
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:12px;
  padding:18px;
  box-shadow:var(--fb3d-shadow);
  margin-bottom:20px;
}
body.fb3d-cart-page table.shop_table{
  border:none !important;
  border-radius:0 !important;
}
body.fb3d-cart-page table.shop_table th{
  background:var(--fb3d-light) !important;
  color:var(--fb3d-dark) !important;
  font-weight:600 !important;
  text-transform:uppercase;
  font-size:.8rem;
  letter-spacing:.5px;
  padding:12px !important;
  border-bottom:2px solid var(--fb3d-primary) !important;
}
body.fb3d-cart-page table.shop_table td{
  padding:16px 12px !important;
  border-bottom:1px solid var(--fb3d-border) !important;
}
body.fb3d-cart-page .shop_table td.product-name{ min-width:260px; }
body.fb3d-cart-page .product-name a{
  color:var(--fb3d-text) !important;
  font-weight:600;
  text-decoration:none;
}
.fb3d-cart-item-desc{
  margin-top:6px;
  color:#64748b;
  font-size:.88rem;
  line-height:1.5;
}
body.fb3d-cart-page .product-price,
body.fb3d-cart-page .product-subtotal{
  font-weight:700;
  color:var(--fb3d-primary);
}
body.fb3d-cart-page .quantity input{
  border:1px solid var(--fb3d-border) !important;
  border-radius:var(--fb3d-radius) !important;
  padding:8px !important;
}
body.fb3d-cart-page .cart_totals{
  border:1px solid #e5e7eb;
  border-radius:12px;
  padding:18px;
  background:#fff !important;
}
body.fb3d-cart-page .cart_totals h2{
  font-size:1.2rem;
  color:var(--fb3d-dark);
  margin-bottom:16px;
}

/* =========================================================
   CHECKOUT
   ========================================================= */
.fb3d-checkout-page{
  max-width:800px;
  margin:0 auto;
  padding:0 16px;
}
.fb3d-checkout-page .woocommerce-checkout{
  display:grid;
  grid-template-columns:1fr;
}
.fb3d-checkout-page #customer_details,
.fb3d-checkout-page #order_review{
  width:100% !important;
  float:none !important;
}
.fb3d-checkout-page .woocommerce-billing-fields,
.fb3d-checkout-page .woocommerce-shipping-fields,
.fb3d-checkout-page #order_review,
.fb3d-checkout-page #payment{
  background:#fff;
  border-radius:var(--fb3d-radius);
  padding:24px;
  box-shadow:var(--fb3d-shadow);
  margin-bottom:20px;
}
.fb3d-checkout-page input[type="text"],
.fb3d-checkout-page input[type="email"],
.fb3d-checkout-page input[type="tel"],
.fb3d-checkout-page input[type="password"],
.fb3d-checkout-page select,
.fb3d-checkout-page textarea{
  border:1px solid var(--fb3d-border) !important;
  border-radius:var(--fb3d-radius) !important;
  padding:12px 14px !important;
  font-size:.95rem !important;
  background:#fff !important;
}
.fb3d-checkout-page input:focus,
.fb3d-checkout-page select:focus,
.fb3d-checkout-page textarea:focus{
  border-color:var(--fb3d-primary) !important;
  box-shadow:0 0 0 3px rgba(0,156,59,.15) !important;
  outline:none !important;
}
.fb3d-checkout-page label{
  font-weight:600;
  font-size:.85rem;
  color:var(--fb3d-text);
  margin-bottom:6px;
  display:block;
}
.fb3d-checkout-page .form-row{ margin-bottom:16px !important; }

.fb3d-checkout-page .shop_table{
  border:none !important;
  width:100%;
}
.fb3d-checkout-page .shop_table th{
  text-align:left;
  padding:12px;
  border-bottom:2px solid var(--fb3d-primary);
  font-size:.85rem;
  text-transform:uppercase;
}
.fb3d-checkout-page .shop_table td{
  padding:12px;
  border-bottom:1px solid var(--fb3d-border);
}
.fb3d-checkout-page .order-total{
  font-size:1.2rem;
  color:var(--fb3d-primary);
  font-weight:700;
}

.fb3d-checkout-page #payment ul.wc_payment_methods{
  list-style:none;
  padding:0;
  margin:0;
}
.fb3d-checkout-page #payment .wc_payment_method{
  border:1px solid var(--fb3d-border) !important;
  border-radius:var(--fb3d-radius) !important;
  margin-bottom:12px !important;
  padding:0 !important;
  overflow:hidden;
}
.fb3d-checkout-page #payment .wc_payment_method > label{
  display:flex;
  align-items:center;
  gap:12px;
  padding:16px !important;
  margin:0 !important;
  cursor:pointer;
  background:var(--fb3d-light);
}
.fb3d-checkout-page #payment .wc_payment_method > input[type="radio"]{
  margin:0 !important;
  width:20px;
  height:20px;
  accent-color:var(--fb3d-primary);
}
.fb3d-checkout-page .payment_box{
  background:#fff !important;
  padding:16px !important;
  margin:0 !important;
  border-top:1px solid var(--fb3d-border);
}
.fb3d-checkout-page .payment_box:before{ display:none !important; }

.fb3d-checkout-page #place_order{
  width:100% !important;
  padding:18px !important;
  font-size:1.1rem !important;
  background:var(--fb3d-secondary) !important;
  color:var(--fb3d-dark) !important;
  font-weight:800 !important;
  margin-top:16px !important;
  border-radius:var(--fb3d-radius) !important;
}
.fb3d-checkout-page #place_order:hover{
  background:#f5d500 !important;
  transform:translateY(-2px);
}

/* Barra de progresso */
.fb3d-checkout-progress{
  display:flex;
  justify-content:center;
  gap:8px;
  margin-bottom:30px;
  padding:0 16px;
}
.fb3d-checkout-step{
  display:flex;
  align-items:center;
  gap:8px;
  font-size:.85rem;
  color:var(--fb3d-text-light);
  padding:8px 12px;
  border-radius:20px;
  background:var(--fb3d-light);
}
.fb3d-checkout-step.active{
  background:var(--fb3d-primary);
  color:#fff;
  font-weight:600;
}
.fb3d-checkout-step .step-number{
  width:24px;
  height:24px;
  border-radius:50%;
  background:rgba(255,255,255,.3);
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:.75rem;
  font-weight:700;
}
.fb3d-checkout-step.active .step-number{
  background:#fff;
  color:var(--fb3d-primary);
}

/* Loading */
.fb3d-loading-overlay{
  position:fixed;
  top:0; left:0;
  width:100%; height:100%;
  background:rgba(255,255,255,.9);
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:9999;
  flex-direction:column;
  gap:16px;
}
.fb3d-loading-spinner{
  width:48px;
  height:48px;
  border:4px solid var(--fb3d-border);
  border-top-color:var(--fb3d-primary);
  border-radius:50%;
  animation:fb3d-spin 1s linear infinite;
}
@keyframes fb3d-spin{ to{ transform:rotate(360deg); } }

/* ====== RESPONSIVO ====== */
@media (max-width:900px){
  body.single-product.fb3d-single-product-clean div.product{
    grid-template-columns:1fr;
  }
}
@media (max-width:768px){
  body.single-product.fb3d-single-product-clean .fb3d-wc-header > a img{
    max-width:140px !important;
    max-height:44px !important;
  }
  body.single-product.fb3d-single-product-clean .woocommerce-product-gallery{
    max-width:100%;
  }

  .fb3d-gallery{ grid-template-columns:repeat(3,1fr); }

  .fb3d-checkout-progress{ flex-wrap:wrap; }
  .fb3d-checkout-page .woocommerce-billing-fields__field-wrapper,
  .fb3d-checkout-page .woocommerce-shipping-fields__field-wrapper{
    display:block !important;
  }
  .fb3d-checkout-page .form-row-first,
  .fb3d-checkout-page .form-row-last{
    width:100% !important;
    float:none !important;
  }
}




.fb3d-cart-thumb{
  border-radius:8px;
  overflow:hidden;
}
.fb3d-cart-item-title{
  font-weight:600;
}
.fb3d-cart-item-desc{
  margin-top:6px;
  color:#64748b;
  font-size:.88rem;
  line-height:1.5;
}





/* ===== FIX LAYOUT CARRINHO DESALINHADO ===== */
.fb3d-page-shell{
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px 24px;
  box-sizing: border-box;
}

/* garante que nada estoure a largura */
body.woocommerce-cart .site-main,
body.woocommerce-cart .woocommerce,
body.woocommerce-cart .woocommerce-page,
body.woocommerce-cart .fb3d-cart-page{
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* formulário e totais alinhados */
body.woocommerce-cart .fb3d-cart-page .woocommerce-cart-form,
body.woocommerce-cart .fb3d-cart-page .cart-collaterals{
  width: 100%;
  max-width: 100%;
  margin: 0 0 18px 0;
  box-sizing: border-box;
}

/* evita conteúdo "vazando" para fora */
body.woocommerce-cart table.shop_table{
  width: 100% !important;
  table-layout: fixed;
}
body.woocommerce-cart table.shop_table th,
body.woocommerce-cart table.shop_table td{
  word-wrap: break-word;
  overflow-wrap: anywhere;
}

/* desktop: carrinho + totais em grid bonito */
@media (min-width: 992px){
  body.woocommerce-cart .woocommerce-cart-form{
    width: 68%;
    float: left;
  }
  body.woocommerce-cart .cart-collaterals{
    width: 30%;
    float: right;
    margin-top: 0;
  }
  body.woocommerce-cart .fb3d-cart-page::after{
    content: "";
    display: block;
    clear: both;
  }
}

/* mobile: stack e scroll horizontal só da tabela quando necessário */
@media (max-width: 991px){
  body.woocommerce-cart .woocommerce-cart-form,
  body.woocommerce-cart .cart-collaterals{
    width: 100%;
    float: none;
  }

  body.woocommerce-cart .woocommerce-cart-form{
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  body.woocommerce-cart table.shop_table{
    min-width: 680px; /* evita quebrar campos de qty/preço */
  }
}





/* ===== FIX DEFINITIVO: imagem do produto menor ===== */
:root{
  --fb3d-gallery-max-desktop: 430px; /* ajuste aqui: 380, 430, 460 */
  --fb3d-gallery-max-mobile: 100%;
  --fb3d-image-max-height: 520px;
}

body.single-product.fb3d-single-product-clean .woocommerce div.product{
  display: grid !important;
  grid-template-columns: .95fr 1.05fr !important;
  gap: 28px !important;
  align-items: start !important;
}

body.single-product.fb3d-single-product-clean .woocommerce div.product .woocommerce-product-gallery{
  width: 100% !important;
  max-width: var(--fb3d-gallery-max-desktop) !important;
  margin: 0 auto !important;
  float: none !important;
}

body.single-product.fb3d-single-product-clean .woocommerce div.product .woocommerce-product-gallery .flex-viewport{
  max-height: var(--fb3d-image-max-height) !important;
}

body.single-product.fb3d-single-product-clean .woocommerce div.product .woocommerce-product-gallery img,
body.single-product.fb3d-single-product-clean .woocommerce div.product .woocommerce-product-gallery .wp-post-image{
  width: 100% !important;
  max-width: var(--fb3d-gallery-max-desktop) !important;
  max-height: var(--fb3d-image-max-height) !important;
  height: auto !important;
  object-fit: contain !important;
  margin: 0 auto !important;
  display: block !important;
}

/* resumo ao lado */
body.single-product.fb3d-single-product-clean .woocommerce div.product .summary{
  width: 100% !important;
  float: none !important;
}

/* mobile */
@media (max-width: 900px){
  body.single-product.fb3d-single-product-clean .woocommerce div.product{
    grid-template-columns: 1fr !important;
  }

  body.single-product.fb3d-single-product-clean .woocommerce div.product .woocommerce-product-gallery,
  body.single-product.fb3d-single-product-clean .woocommerce div.product .woocommerce-product-gallery img{
    max-width: var(--fb3d-gallery-max-mobile) !important;
    max-height: none !important;
  }
}



/* ===== FIX LOGO GRANDE NO CHECKOUT ===== */
body.woocommerce-checkout .fb3d-wc-header{
  text-align: center;
  padding: 10px 0 12px !important;
  margin: 0 0 16px !important;
}

body.woocommerce-checkout .fb3d-wc-header > a{
  display: inline-block;
  line-height: 0;
}

body.woocommerce-checkout .fb3d-wc-header > a img{
  width: auto !important;
  height: auto !important;
  max-width: 170px !important;   /* desktop */
  max-height: 46px !important;   /* desktop */
  object-fit: contain !important;
}

/* mobile */
@media (max-width: 768px){
  body.woocommerce-checkout .fb3d-wc-header > a img{
    max-width: 130px !important;
    max-height: 38px !important;
  }
}





.fb3d-wc-header{
  text-align:center;
  margin:0 0 16px;
  padding:10px 0;
}
.fb3d-wc-header .fb3d-logo-link{
  display:inline-block;
  line-height:0;
}
.fb3d-wc-header .fb3d-logo-link img{
  max-width:170px;
  max-height:48px;
  width:auto;
  height:auto;
  object-fit:contain;
}




/* ===== Ocultar cabeçalho do tema apenas no bbPress ===== */
body.bbpress #masthead,
body.bbpress .site-header,
body.bbpress header.site-header,
body.bbpress .wp-block-template-part.header,
body.bbpress .site-branding,
body.bbpress .page-header,
body.bbpress .entry-header {
  display: none !important;
}

/* Remove espaços que o header deixava */
body.bbpress #page,
body.bbpress .site,
body.bbpress .site-content,
body.bbpress #content,
body.bbpress .content-area,
body.bbpress .site-main {
  margin-top: 0 !important;
  padding-top: 0 !important;
}