/* KCT Ajustes — ficha de producto estilo marketplace */
:root {
	--kct-amarillo: #ffc107;
	--kct-amarillo-osc: #e0a800;
	--kct-amarillo-suave: #fff4cf;
	--kct-negro: #111;
	--kct-texto: rgba(0, 0, 0, .9);
	--kct-gris: rgba(0, 0, 0, .55);
	--kct-borde: rgba(0, 0, 0, .1);
	--kct-verde: #00a650;
	--kct-fondo: #f5f5f5;
}

/* Evita el salto visual mientras el JS reubica los módulos */
.kct-pdp-on:not(.kct-pdp-ready) .mfn-single-product-tmpl-builder { opacity: 0; }
.kct-pdp-vacia { display: none !important; }

.kct-pdp { max-width: 1200px; margin: 0 auto; padding: 16px 16px 40px; color: var(--kct-texto); }

/* Reset de columnas de BeBuilder dentro de la nueva maquetación */
.kct-pdp .mcb-column { width: 100% !important; float: none !important; margin: 0 !important; }
.kct-pdp .mcb-column-inner { margin: 0 !important; padding: 0 !important; }

/* Migas */
.kct-pdp__top { font-size: 14px; margin-bottom: 12px; }
.kct-pdp__top .woocommerce-breadcrumb, .kct-pdp__top nav { margin: 0; font-size: 14px; color: var(--kct-gris); }
.kct-pdp__top a { color: #3483fa; }

/* Tarjeta principal */
.kct-pdp__main { background: #fff; border-radius: 8px; box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }

@media (min-width: 992px) {
	.kct-pdp-on #Content, .kct-pdp-on .content_wrapper { background: var(--kct-fondo); }
	.kct-pdp__main { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 32px; padding: 24px; align-items: start; }
	.kct-pdp__box { position: sticky; top: 100px; border: 1px solid var(--kct-borde); border-radius: 8px; padding: 24px 20px; }
}

/* ------------------------------------------------------------ Galería */
.kct-gal { display: flex; gap: 16px; align-items: flex-start; }
.kct-gal__thumbs { display: flex; flex-direction: column; gap: 8px; width: 52px; flex: 0 0 52px; max-height: 500px; overflow-y: auto; scrollbar-width: none; }
.kct-gal__thumbs::-webkit-scrollbar { display: none; }
.kct-gal__thumb { position: relative; width: 50px; height: 50px; padding: 2px; margin: 0; background: #fff; border: 1px solid var(--kct-borde); border-radius: 6px; cursor: pointer; overflow: hidden; flex: 0 0 auto; }
.kct-gal__thumb:hover, .kct-gal__thumb:focus-visible { border-color: var(--kct-amarillo-osc); outline: none; }
.kct-gal__thumb.is-active { border: 2px solid var(--kct-amarillo-osc); padding: 1px; }
.kct-gal__thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }

.kct-gal__stage { position: relative; flex: 1; min-width: 0; }
.kct-gal__track { position: relative; }
.kct-gal__slide { margin: 0; display: none; align-items: center; justify-content: center; height: 500px; overflow: hidden; cursor: zoom-in; background: #fff; }
.kct-gal__slide.is-active { display: flex; }
.kct-gal__img { width: 100% !important; height: 100% !important; max-width: none; object-fit: contain; transition: transform .12s ease-out; }
.kct-gal__slide.is-zoom .kct-gal__img { transform: scale(2.2); }
.kct-gal__count, .kct-gal__dots { display: none; }

@media (max-width: 991px) {
	.kct-gal { display: block; }
	.kct-gal__thumbs { display: none; }
	.kct-gal__track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
	.kct-gal__track::-webkit-scrollbar { display: none; }
	.kct-gal__slide, .kct-gal__slide.is-active { display: flex; flex: 0 0 100%; height: auto; aspect-ratio: 1 / 1; scroll-snap-align: start; cursor: pointer; }
	.kct-gal__slide.is-zoom .kct-gal__img { transform: none; }
	.kct-gal__count { display: block; position: absolute; top: 12px; left: 12px; background: rgba(255, 255, 255, .9); border-radius: 12px; padding: 2px 10px; font-size: 13px; color: var(--kct-gris); box-shadow: 0 1px 2px rgba(0, 0, 0, .15); }
	.kct-gal__dots { display: flex; justify-content: center; gap: 6px; padding: 10px 0 2px; }
	.kct-gal__dots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(0, 0, 0, .2); transition: background .2s, transform .2s; }
	.kct-gal__dots i.is-active { background: var(--kct-negro); transform: scale(1.2); }
}

/* -------------------------------------------------------- Caja de compra */
.kct-pdp__meta { font-size: 14px; color: var(--kct-gris); margin-bottom: 6px; }
.kct-pdp__meta .kct-sep { margin: 0 6px; }

.kct-pdp__box .column_product_title h1,
.kct-pdp__box .column_product_title .title,
.kct-pdp__box .product_title { font-size: 22px !important; line-height: 1.3 !important; font-weight: 600 !important; margin: 0 0 8px !important; color: var(--kct-texto); letter-spacing: 0; text-transform: none; }

.kct-pdp__box .column_product_rating .star-rating { margin: 0 0 8px; font-size: 13px; }

.kct-pdp__box .price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 10px; margin: 12px 0 4px !important; color: var(--kct-texto) !important; font-size: 34px !important; font-weight: 300 !important; line-height: 1.15 !important; }
.kct-pdp__box .price del { flex: 0 0 100%; font-size: 15px; color: var(--kct-gris); opacity: 1; font-weight: 400; }
.kct-pdp__box .price ins { text-decoration: none; background: none; font-weight: 300; }
.kct-pdp__box .price .screen-reader-text { position: absolute; clip: rect(1px, 1px, 1px, 1px); width: 1px; height: 1px; overflow: hidden; }
.kct-off { font-size: 18px; color: var(--kct-verde); font-weight: 400; }

.kct-pdp__stock { margin: 14px 0 12px !important; font-weight: 600; font-size: 16px; }
.kct-pdp__stock.is-out { color: #f23d4f; }

/* Formulario de compra */
.kct-pdp__box .mfn-variations-wrapper { margin: 0 0 12px; }
.kct-pdp__box .mfn-vr { display: flex !important; align-items: center; gap: 12px; margin: 0 0 12px; }
.kct-pdp__box .mfn-vr > label { flex: 0 0 auto; font-size: 15px; font-weight: 400; color: var(--kct-texto); margin: 0; }
.kct-pdp__box .mfn-vr select { flex: 1; width: auto !important; max-width: none; height: 44px; border-radius: 6px; border: 1px solid var(--kct-borde); padding: 0 12px; background-color: #fff; }
.kct-pdp__box .mfn-reset-variations { font-size: 13px; color: #3483fa; }
.kct-pdp .joinchat__woo-btn__wrapper { display: none !important; }
.kct-pdp__box form.cart { margin: 0 !important; }
.kct-pdp__box table.variations { width: 100%; margin: 0 0 12px; border: 0; }
.kct-pdp__box table.variations th, .kct-pdp__box table.variations td { display: block; padding: 0; border: 0; background: none; text-align: left; }
.kct-pdp__box table.variations th label, .kct-pdp__box table.variations .label label { font-size: 14px; font-weight: 400; color: var(--kct-texto); margin-bottom: 6px; display: block; }
.kct-pdp__box table.variations select { width: 100%; height: 44px; border-radius: 6px; border: 1px solid var(--kct-borde); padding: 0 12px; }
.kct-pdp__box .reset_variations { font-size: 13px; color: #3483fa; }
.kct-pdp__box .woocommerce-variation-price { display: none !important; }
.kct-pdp__box .woocommerce-variation-availability, .kct-pdp__box form.cart > .stock { font-size: 14px; margin-bottom: 8px; }

.kct-pdp__box .woocommerce-variation-add-to-cart,
.kct-pdp__box form.cart:not(.variations_form),
.kct-pdp__box .mfn-cart-button-wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.kct-qty-label { flex: 0 0 auto; align-self: center; font-size: 15px; }
.kct-pdp__box .quantity { flex: 0 0 auto !important; width: auto !important; max-width: none !important; display: inline-flex !important; align-items: center; height: 40px; margin: 0 0 8px !important; padding: 0 4px !important; border: 1px solid rgba(0, 0, 0, .15); border-radius: 6px; }
.kct-pdp__box .quantity::before { content: none !important; }
.kct-pdp__box .quantity input.qty { width: 44px !important; height: 38px !important; border: 0 !important; background: none !important; text-align: center; padding: 0 !important; margin: 0 !important; box-shadow: none !important; -moz-appearance: textfield; }
.kct-pdp__box .quantity input.qty::-webkit-outer-spin-button, .kct-pdp__box .quantity input.qty::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.kct-pdp__box .quantity .quantity-change { position: static !important; transform: none !important; width: 28px; height: 38px; display: flex; align-items: center; justify-content: center; color: var(--kct-texto); }
.kct-pdp__box .woocommerce-variation-description { display: none !important; }

.kct-pdp__box .single_add_to_cart_button,
.kct-pdp__box .kct-comprar-ahora { flex: 0 0 100%; width: 100%; height: 48px; margin: 0 !important; border-radius: 6px !important; font-size: 16px !important; font-weight: 600 !important; text-transform: none !important; letter-spacing: 0 !important; display: flex !important; align-items: center; justify-content: center; border: 0 !important; box-shadow: none !important; cursor: pointer; transition: background .15s; }
.kct-pdp__box .kct-comprar-ahora { background: var(--kct-amarillo) !important; color: var(--kct-negro) !important; }
.kct-pdp__box .kct-comprar-ahora:hover { background: var(--kct-amarillo-osc) !important; }
.kct-pdp__box .single_add_to_cart_button { background: var(--kct-amarillo-suave) !important; color: var(--kct-negro) !important; }
.kct-pdp__box .single_add_to_cart_button:hover { background: #ffe9a3 !important; }
.kct-pdp__box .kct-comprar-ahora.disabled, .kct-pdp__box .single_add_to_cart_button.disabled { opacity: .5; cursor: not-allowed; }
.kct-pdp__box .kct-comprar-ahora.loading { opacity: .7; pointer-events: none; }

/* Confianza */
.kct-pdp__trust { margin-top: 20px; }
.kct-pdp__trust ul { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 14px; }
.kct-pdp__trust li { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; line-height: 1.35; color: var(--kct-gris); margin: 0; }
.kct-pdp__trust li strong { display: block; color: var(--kct-texto); font-weight: 400; }
.kct-pdp__trust li.kct-ok strong { color: var(--kct-verde); font-weight: 600; }
.kct-pdp__trust li small { display: block; font-size: 13px; color: var(--kct-gris); }
.kct-ico { width: 20px; height: 20px; flex: 0 0 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; color: var(--kct-gris); }
.kct-ok .kct-ico { color: var(--kct-verde); }
.kct-pdp__wa { display: flex; align-items: center; justify-content: center; gap: 8px; height: 44px; border: 1px solid var(--kct-verde); color: var(--kct-verde) !important; border-radius: 6px; font-weight: 600; text-decoration: none !important; }
.kct-pdp__wa:hover { background: rgba(0, 166, 80, .06); }
.kct-pdp__wa .kct-ico { color: var(--kct-verde); }

/* -------------------------------------------- Características y descripción */
.kct-pdp__block { border-top: 1px solid var(--kct-borde); margin-top: 32px; padding-top: 32px; }
.kct-pdp__h { font-size: 24px !important; font-weight: 400 !important; margin: 0 0 20px !important; color: var(--kct-texto); letter-spacing: 0; text-transform: none; }
.kct-pdp__block .woocommerce-product-attributes, .kct-pdp__block .shop_attributes { width: 100%; max-width: 560px; border: 0; border-radius: 6px; overflow: hidden; border-collapse: collapse; margin: 0; }
.kct-pdp__block .shop_attributes tr th { width: 42%; background: #ebebeb !important; font-weight: 600; text-align: left !important; padding: 12px 16px !important; border: 0 !important; font-size: 14px; color: var(--kct-texto); }
.kct-pdp__block .shop_attributes tr td { background: #f5f5f5 !important; padding: 12px 16px !important; border: 0 !important; font-size: 14px; font-style: normal; text-align: left !important; color: var(--kct-texto); }
.kct-pdp__block .shop_attributes tr:nth-child(even) th { background: #e3e3e3 !important; }
.kct-pdp__block .shop_attributes tr:nth-child(even) td { background: #ebebeb !important; }
.kct-pdp__block .shop_attributes tr *::before, .kct-pdp__block .shop_attributes tr *::after { display: none !important; }
.kct-pdp__block .shop_attributes th span, .kct-pdp__block .shop_attributes td span { background: none !important; padding: 0 !important; }
.kct-pdp__block td p { margin: 0; }
.kct-pdp__block .column_product_content { font-size: 16px; line-height: 1.6; color: var(--kct-gris); }

/* Relacionados */
.kct-pdp__bottom { margin-top: 24px; background: #fff; border-radius: 8px; box-shadow: 0 1px 2px rgba(0, 0, 0, .12); padding: 24px; }
.kct-pdp__bottom:empty { display: none; }
.kct-pdp__bottom h2, .kct-pdp__bottom h3 { font-size: 24px; font-weight: 400; text-transform: none; }

/* ---------------------------------------------------------------- Móvil */
@media (max-width: 991px) {
	.kct-pdp { padding: 8px 0 24px; }
	.kct-pdp__top { padding: 0 16px; }
	.kct-pdp__main { display: flex; flex-direction: column; padding: 16px; border-radius: 0; box-shadow: none; }
	.kct-pdp__left, .kct-pdp__box { display: contents; }
	.kct-pdp__meta { order: 1; }
	.kct-pdp__box .column_product_title { order: 2; }
	.kct-pdp__box .column_product_rating { order: 3; }
	.kct-pdp__left .column_product_images { order: 4; margin: 8px -16px 0 !important; width: auto !important; }
	.kct-pdp__box .column_product_price { order: 5; }
	.kct-pdp__stock { order: 6; }
	.kct-pdp__box .column_product_cart_button { order: 7; }
	.kct-pdp__trust { order: 8; }
	.kct-pdp__block, .kct-pdp__left > .mcb-column:not(.column_product_images) { order: 9; }
	.kct-pdp__box .price { font-size: 30px !important; }
	.kct-pdp__bottom { border-radius: 0; box-shadow: none; padding: 16px; }
}

/* ----------------------------------------------------------- Visor */
.kct-lb { position: fixed; inset: 0; z-index: 999999; background: rgba(0, 0, 0, .92); display: none; align-items: center; justify-content: center; }
.kct-lb.is-open { display: flex; }
.kct-lb__img { max-width: 92vw; max-height: 86vh; object-fit: contain; user-select: none; }
.kct-lb button { position: absolute; background: none; border: 0; color: #fff; cursor: pointer; line-height: 1; padding: 12px; margin: 0; box-shadow: none; }
.kct-lb__x { top: 8px; right: 12px; font-size: 40px; }
.kct-lb__prev, .kct-lb__next { top: 50%; transform: translateY(-50%); font-size: 56px; }
.kct-lb__prev { left: 8px; }
.kct-lb__next { right: 8px; }
.kct-lb.is-single .kct-lb__prev, .kct-lb.is-single .kct-lb__next, .kct-lb.is-single .kct-lb__n { display: none; }
.kct-lb__n { position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); color: #fff; font-size: 14px; }
html.kct-lb-open { overflow: hidden; }
