/*
 * BuenTheme — woocommerce.css
 * Tienda, ficha, carrito y checkout. En el sitio solo en esas vistas; también si la página pinta un bloque de WooCommerce.
 * Extraído de style.css en 2.6.148. No se borró ninguna regla.
 */

/* ============================================================================
   MEJORAS DE UI PARA WOOCOMMERCE
   ============================================================================ */

/* Avisos nativos (store-notices + clásicos) */
.wp-block-woocommerce-store-notices,
.wc-block-store-notices,
.woocommerce-notices-wrapper,
.buentheme-wc-notices {
	display: block;
	width: 100%;
	margin: 0 0 1rem;
	box-sizing: border-box;
}
.woocommerce-message,
.woocommerce-info,
.woocommerce-error,
.wc-block-components-notice-banner {
	display: block !important;
	visibility: visible !important;
	opacity: 1 !important;
	border-radius: 10px;
	padding: 0.85rem 1rem;
}
.woocommerce-message,
.wc-block-components-notice-banner.is-success {
	border-left: 4px solid var(--wp--preset--color--accent-1, #16a34a);
	background: color-mix(in srgb, var(--wp--preset--color--accent-1, #16a34a) 10%, #fff);
	color: inherit;
}
.woocommerce-error,
.wc-block-components-notice-banner.is-error {
	border-left: 4px solid #dc2626;
	background: color-mix(in srgb, #dc2626 10%, #fff);
}
.woocommerce-info,
.wc-block-components-notice-banner.is-info {
	border-left: 4px solid var(--wp--preset--color--accent-1, #3b82f6);
	background: color-mix(in srgb, var(--wp--preset--color--accent-1, #3b82f6) 10%, #fff);
}

/* --- Catálogo de Productos (Archive Product) --- */

body.buentheme-wc-catalog .wp-block-group.buentheme-product-card,
.buentheme-product-card {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.4s ease !important;
    position: relative;
}

body.buentheme-wc-catalog .wp-block-group.buentheme-product-card,
body.buentheme-wc-catalog li.wc-block-product {
    overflow: visible;
    height: 100%;
    min-height: 100%;
    max-height: none;
}

body.buentheme-wc-catalog .wp-block-group.buentheme-product-card:not(.buentheme-card-preset-overlay) {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 100%;
}

body.buentheme-wc-catalog li.wc-block-product .wp-block-post-title,
body.buentheme-wc-catalog li.wc-block-product .buentheme-product-card__title {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    overflow: hidden;
    min-height: 4.35em;
    max-height: 4.35em;
    line-height: 1.45;
    margin-top: 0.875rem;
    white-space: normal;
    text-overflow: ellipsis;
    overflow-wrap: normal;
    word-break: normal;
}

body.buentheme-wc-catalog li.wc-block-product .wp-block-post-title a {
    display: block;
    color: inherit;
    text-decoration: none;
    overflow: hidden;
}

body.buentheme-wc-catalog .buentheme-product-card__price,
body.buentheme-wc-catalog .buentheme-price-single-line {
    display: inline-flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: baseline;
    align-content: flex-start;
    column-gap: 0.25em;
    gap: 0;
    margin-top: 0.5rem;
    min-height: 1.5rem;
    line-height: 1.25;
    font-size: 0.9em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: keep-all;
    overflow-wrap: normal;
    max-width: 100%;
}

body.buentheme-wc-catalog .buentheme-product-card__price .price,
body.buentheme-wc-catalog .buentheme-price-single-line .price {
    display: inline-flex;
    flex-wrap: nowrap;
    align-items: baseline;
    column-gap: 0.25em;
    gap: 0;
    white-space: nowrap;
    margin: 0;
    width: auto;
    max-width: 100%;
}

body.buentheme-wc-catalog .buentheme-product-card__price del,
body.buentheme-wc-catalog .buentheme-product-card__price ins,
body.buentheme-wc-catalog .buentheme-price-single-line del,
body.buentheme-wc-catalog .buentheme-price-single-line ins,
body.buentheme-wc-catalog .buentheme-product-card__price .woocommerce-Price-amount,
body.buentheme-wc-catalog .buentheme-price-single-line .woocommerce-Price-amount,
body.buentheme-wc-catalog .buentheme-product-card__price .wc-block-formatted-money-amount,
body.buentheme-wc-catalog .buentheme-price-single-line .wc-block-formatted-money-amount,
body.buentheme-wc-catalog .buentheme-product-card__price bdi,
body.buentheme-wc-catalog .buentheme-price-single-line bdi,
body.buentheme-wc-catalog .buentheme-product-card__price .woocommerce-Price-currencySymbol,
body.buentheme-wc-catalog .buentheme-price-single-line .woocommerce-Price-currencySymbol,
body.buentheme-wc-catalog .buentheme-product-card__price .wc-block-components-product-price__value,
body.buentheme-wc-catalog .buentheme-price-single-line .wc-block-components-product-price__value {
    display: inline;
    white-space: nowrap;
    width: auto;
    max-width: none;
    margin: 0;
    padding: 0;
    vertical-align: baseline;
}

body.buentheme-wc-catalog .buentheme-product-card__actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-end;
    margin-top: auto;
    padding-top: 0.875rem;
}

body.buentheme-wc-catalog .buentheme-product-card__actions .button,
body.buentheme-wc-catalog .buentheme-product-card__actions a,
body.buentheme-wc-catalog .buentheme-product-card__actions button {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
}

body.buentheme-wc-catalog li.wc-block-product .wp-block-woocommerce-product-price,
body.buentheme-wc-catalog li.wc-block-product .wc-block-components-product-price {
    display: inline-flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: baseline;
    visibility: visible;
    opacity: 1;
    height: auto;
    max-height: none;
    overflow: hidden;
    position: static;
    clip: auto;
    clip-path: none;
    margin-top: 0;
    white-space: nowrap;
}

body.buentheme-wc-catalog li.wc-block-product .wp-block-woocommerce-product-button,
body.buentheme-wc-catalog li.wc-block-product .wc-block-components-product-button {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    visibility: visible;
    opacity: 1;
    height: auto;
    max-height: none;
    overflow: hidden;
    position: static;
    clip: auto;
    clip-path: none;
    margin-top: 0;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

body.buentheme-wc-catalog .wp-block-woocommerce-product-collection,
body.buentheme-wc-catalog .buentheme-wc-catalog-root.wp-block-woocommerce-product-collection {
    display: block;
}

body.buentheme-wc-catalog .wp-block-query-pagination,
body.buentheme-wc-catalog .buentheme-wc-catalog-root .wp-block-query-pagination {
    width: 100%;
    clear: both;
    margin-top: 2rem;
    justify-content: flex-end;
}

body.buentheme-wc-catalog .wp-block-group.buentheme-product-card:not(.buentheme-card-preset-overlay) {
    gap: 0;
    justify-content: flex-start;
    padding: 1rem;
    border-radius: 10px;
}

body.buentheme-wc-catalog .buentheme-product-card__media,
body.buentheme-wc-catalog li.wc-block-product .wp-block-woocommerce-product-image,
body.buentheme-wc-catalog li.wc-block-product .wc-block-components-product-image {
    margin: 0;
    border-radius: 8px;
    overflow: hidden;
}

body.buentheme-wc-catalog li.wc-block-product {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

body.buentheme-wc-catalog .wc-block-product-template.is-flex-container,
body.buentheme-wc-catalog .wc-block-product-template__responsive {
    display: grid !important;
    align-items: stretch !important;
    gap: 1.75rem !important;
}

body.buentheme-wc-catalog .wc-block-product-template.is-flex-container > li,
body.buentheme-wc-catalog .wc-block-product-template__responsive > li {
    width: 100% !important;
    max-width: 100% !important;
}

body.buentheme-wc-catalog .wc-block-components-product-button__button--placeholder {
    display: none !important;
}

/* Efecto de segunda imagen en hover */
.buentheme-image-hover-wrapper {
    position: relative;
    overflow: hidden;
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 6px;
    background-color: #f7f7f7;
}

.buentheme-image-hover-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.buentheme-hover-image {
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    z-index: 2;
    pointer-events: none;
}

@media (hover: hover) {
    .buentheme-image-hover-wrapper:hover .buentheme-hover-image {
        opacity: 1;
    }

    .buentheme-image-hover-wrapper:hover img:not(.buentheme-hover-image) {
        transform: scale(1.08);
    }
}

/* Estilos de botones de producto en catálogo (WC 10.9 usa <button>, versiones anteriores <a>) */
.buentheme-product-card .wp-block-woocommerce-product-button,
.buentheme-product-card .wc-block-components-product-button,
.buentheme-product-card .buentheme-product-card__actions {
    align-items: stretch;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    box-sizing: border-box;
}

.buentheme-product-card .wp-block-woocommerce-product-button .wp-block-button,
.buentheme-product-card .wc-block-components-product-button {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    text-align: center;
    overflow: hidden;
    box-sizing: border-box;
}

/*
 * Etiqueta «Añadir al carrito»: debe caber dentro del botón en tablet/móvil
 * (grillas de 2 cols). Máx. ~2 líneas, tipografía fluida, sin desborde.
 */
.buentheme-product-card .wp-block-woocommerce-product-button a,
.buentheme-product-card .wp-block-woocommerce-product-button button,
.buentheme-product-card .wc-block-components-product-button__button,
.buentheme-product-card .buentheme-product-card__actions .button,
.buentheme-product-card .add_to_cart_button,
.buentheme-product-related .wp-block-woocommerce-product-button a,
.buentheme-product-related .wp-block-woocommerce-product-button button,
.buentheme-product-related .add_to_cart_button,
.buentheme-wc-query-loop-sync .wp-block-woocommerce-product-button a,
.buentheme-wc-query-loop-sync .wp-block-woocommerce-product-button button,
.buentheme-wc-query-loop-sync .add_to_cart_button {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    align-content: center !important;
    flex-wrap: wrap !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    text-align: center !important;
    padding: 0.55rem 0.7rem !important;
    min-height: 2.5rem !important;
    max-height: 3.4rem !important;
    font-size: 0.875rem !important;
    font-weight: 600 !important;
    line-height: 1.2 !important;
    letter-spacing: -0.01em !important;
    white-space: normal !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    word-break: normal !important;
    overflow-wrap: anywhere !important;
    hyphens: auto !important;
    border-radius: 6px !important;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease !important;
    cursor: pointer;
    pointer-events: auto;
}

.buentheme-product-card .wp-block-woocommerce-product-button a:hover,
.buentheme-product-card .wp-block-woocommerce-product-button button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

@media (max-width: 1079px) {
    .buentheme-product-card .wp-block-woocommerce-product-button a,
    .buentheme-product-card .wp-block-woocommerce-product-button button,
    .buentheme-product-card .wc-block-components-product-button__button,
    .buentheme-product-card .buentheme-product-card__actions .button,
    .buentheme-product-card .add_to_cart_button,
    .buentheme-product-related .wp-block-woocommerce-product-button a,
    .buentheme-product-related .wp-block-woocommerce-product-button button,
    .buentheme-product-related .add_to_cart_button,
    .buentheme-wc-query-loop-sync .wp-block-woocommerce-product-button a,
    .buentheme-wc-query-loop-sync .wp-block-woocommerce-product-button button,
    .buentheme-wc-query-loop-sync .add_to_cart_button {
        font-size: clamp(0.68rem, 2.7vw, 0.8125rem) !important;
        line-height: 1.15 !important;
        padding: 0.45rem 0.4rem !important;
        min-height: 2.35rem !important;
        max-height: 3.1rem !important;
    }
}

@media (max-width: 480px) {
    .buentheme-product-card .wp-block-woocommerce-product-button a,
    .buentheme-product-card .wp-block-woocommerce-product-button button,
    .buentheme-product-card .wc-block-components-product-button__button,
    .buentheme-product-card .buentheme-product-card__actions .button,
    .buentheme-product-card .add_to_cart_button,
    .buentheme-product-related .wp-block-woocommerce-product-button a,
    .buentheme-product-related .wp-block-woocommerce-product-button button,
    .buentheme-product-related .add_to_cart_button,
    .buentheme-wc-query-loop-sync .wp-block-woocommerce-product-button a,
    .buentheme-wc-query-loop-sync .wp-block-woocommerce-product-button button,
    .buentheme-wc-query-loop-sync .add_to_cart_button {
        font-size: clamp(0.65rem, 3.1vw, 0.75rem) !important;
        padding: 0.4rem 0.35rem !important;
        min-height: 2.25rem !important;
        max-height: 2.95rem !important;
    }
}

/* --- Fase 3: Filtros AJAX del catálogo --- */

.buentheme-wc-catalog-filters {
    margin: 0 0 1.5rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--wp--preset--color--bg-3, #e2e8f0);
}

.buentheme-wc-catalog-filters__row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.buentheme-wc-catalog-filters__categories {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.buentheme-wc-filter-chip {
    appearance: none;
    background: var(--wp--preset--color--bg-2, #fff);
    border: 1px solid var(--wp--preset--color--bg-3, #e2e8f0);
    border-radius: 999px;
    color: #334155;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 14px;
    transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.buentheme-wc-filter-chip:hover,
.buentheme-wc-filter-chip.is-active {
    background: var(--wp--preset--color--accent-1, #2563eb);
    border-color: var(--wp--preset--color--accent-1, #2563eb);
    color: #fff;
}

.buentheme-wc-catalog-filters__sort select {
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    font-size: 14px;
    min-width: 180px;
    padding: 8px 12px;
}

.buentheme-wc-catalog-filters__count {
    color: #64748b;
    font-size: 13px;
    margin: 12px 0 0;
}

.buentheme-wc-product-grid.is-loading,
.buentheme-wc-query-loop-sync.is-loading {
    opacity: 0.55;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

/* Badges unificados (Buenclick Suite): oferta arriba-izquierda, suscripción arriba-derecha */
.buentheme-wc-catalog-root .wp-block-woocommerce-product-image,
.buentheme-wc-catalog-root .wc-block-components-product-image,
.buentheme-wc-catalog-root .buentheme-product-card__media {
    position: relative;
}

.buentheme-wc-catalog-root .buenclick-product-badge--sale,
body.buentheme-wc-catalog .buenclick-product-badge--sale {
    z-index: 4;
}

.buentheme-wc-catalog-root .buenclick-product-badges--top-left,
body.buentheme-wc-catalog .buenclick-product-badges--top-left {
    left: 12px;
    right: auto;
    top: 12px;
}

.buentheme-wc-catalog-root .buenclick-product-badges--top-right,
body.buentheme-wc-catalog .buenclick-product-badges--top-right {
    left: auto;
    right: 12px;
    top: 12px;
}

/* Legacy WC sale badge — oculto cuando Suite gestiona la oferta */
.buenclick-badges-sale-managed .wc-block-components-product-sale-badge,
.buenclick-badges-sale-managed span.onsale,
.buentheme-wc-catalog-root .wc-block-components-product-sale-badge,
body.buentheme-wc-catalog span.onsale {
    display: none !important;
}

/* --- Fase 3: Quick View --- */

.buentheme-quick-view-trigger {
    position: absolute;
    right: 12px;
    top: 12px;
    z-index: 12;
    appearance: none;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 6px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
    color: #1e293b;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    opacity: 0;
    padding: 8px 12px;
    transform: translateY(4px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.buentheme-product-card:hover .buentheme-quick-view-trigger,
.buentheme-query-card:hover .buentheme-quick-view-trigger,
.wc-block-product:hover .buentheme-quick-view-trigger,
.buentheme-related-product:hover .buentheme-quick-view-trigger,
.buentheme-product-related li:hover .buentheme-quick-view-trigger {
    opacity: 1;
    transform: translateY(0);
}

/* Media clickeable hacia el producto (también con Vista rápida activa) */
.buentheme-product-card__media-link,
.wp-block-woocommerce-product-image > a,
.wc-block-components-product-image > a,
.buentheme-card-top-media > a {
    display: block;
    width: 100%;
    height: 100%;
    color: inherit;
    text-decoration: none;
    line-height: 0;
    cursor: pointer;
}

.buentheme-product-card__media-link img,
.wp-block-woocommerce-product-image > a img,
.wc-block-components-product-image > a img,
.buentheme-card-top-media > a img {
    width: 100%;
    height: auto;
    display: block;
}

/* Área de imagen: position para el botón QV (hermano del enlace, z-index alto) */
.buentheme-product-card__media,
.wp-block-woocommerce-product-image,
.wc-block-components-product-image,
.buentheme-card-top-media,
.buentheme-product-related .buentheme-product-card__media,
.buentheme-product-related .wp-block-woocommerce-product-image,
.buentheme-product-related .wc-block-components-product-image {
    position: relative !important;
}

/* QV siempre por encima del enlace de la imagen */
.buentheme-product-card__media .buentheme-quick-view-trigger,
.wp-block-woocommerce-product-image .buentheme-quick-view-trigger,
.wc-block-components-product-image .buentheme-quick-view-trigger,
.buentheme-card-top-media .buentheme-quick-view-trigger {
    z-index: 12;
    pointer-events: auto;
}

.buentheme-quick-view {
    --buentheme-qv-img-max: min(48vh, 440px);
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 100000;
    display: none;
    width: 100%;
    height: 100%;
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    box-sizing: border-box;
    overflow: hidden;
}

.buentheme-quick-view.is-open {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: max(16px, env(safe-area-inset-top, 0px))
             max(16px, env(safe-area-inset-right, 0px))
             max(16px, env(safe-area-inset-bottom, 0px))
             max(16px, env(safe-area-inset-left, 0px));
}

.buentheme-quick-view__backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(3px);
}

.buentheme-quick-view__panel {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    width: min(920px, 100%);
    max-width: 100%;
    max-height: 100%;
    margin: auto;
    overflow: hidden;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.18);
    padding: 24px;
    box-sizing: border-box;
    min-height: 0;
}

.buentheme-quick-view__close {
    position: absolute;
    right: 10px;
    top: 10px;
    z-index: 2;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: #f8fafc;
    color: #334155;
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
}

.buentheme-quick-view__close:focus-visible {
    outline: 2px solid var(--wp--preset--color--accent-1, #2563eb);
    outline-offset: 2px;
}

.buentheme-quick-view__body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
}

.buentheme-quick-view__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    min-width: 0;
}

.buentheme-quick-view__media {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 0;
}

.buentheme-quick-view__image {
    width: min(100%, var(--buentheme-qv-img-max));
    height: auto;
    max-width: 100%;
    max-height: var(--buentheme-qv-img-max);
    border-radius: 10px;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    object-position: center;
}

.buentheme-quick-view__thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
    width: 100%;
    justify-content: center;
}

.buentheme-quick-view__thumb {
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    overflow: hidden;
    padding: 0;
    width: 56px;
    height: 56px;
    flex: 0 0 auto;
}

.buentheme-quick-view__thumb.is-active {
    border-color: var(--wp--preset--color--accent-1, #2563eb);
}

.buentheme-quick-view__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.buentheme-quick-view__summary {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.buentheme-quick-view__title {
    font-size: 1.5rem;
    margin: 0 0 12px;
    padding-right: 36px;
    overflow-wrap: anywhere;
}

.buentheme-quick-view__price {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.buentheme-quick-view__excerpt {
    color: #64748b;
    line-height: 1.6;
    margin: 0 0 20px;
}

.buentheme-quick-view__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.buentheme-quick-view__link {
    color: var(--wp--preset--color--accent-1, #2563eb);
    font-weight: 600;
    text-decoration: none;
}

html:has(.buentheme-quick-view.is-open),
html.buentheme-quick-view-open,
body.buentheme-quick-view-open {
    overflow: hidden;
    overscroll-behavior: none;
}

@media (min-width: 769px) {
    .buentheme-quick-view {
        --buentheme-qv-img-max: none;
    }

    .buentheme-quick-view__image {
        width: 100%;
        max-height: none;
    }

    .buentheme-quick-view__media {
        align-items: stretch;
    }

    .buentheme-quick-view__thumbs {
        justify-content: flex-start;
    }
}

@media (max-width: 768px) {
    .buentheme-quick-view {
        --buentheme-qv-img-max: min(40vh, 320px);
    }

    .buentheme-quick-view__grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .buentheme-quick-view-trigger {
        opacity: 1;
        transform: none;
    }

    .buentheme-quick-view__title {
        font-size: 1.25rem;
        padding-right: 0;
    }

    .buentheme-quick-view__actions {
        position: sticky;
        bottom: 0;
        z-index: 1;
        background: linear-gradient(to top, #fff 72%, rgba(255, 255, 255, 0.92));
        padding-top: 12px;
        margin-top: auto;
    }
}

@media (max-width: 480px), (max-height: 780px) {
    .buentheme-quick-view.is-open {
        padding: max(8px, env(safe-area-inset-top, 0px))
                 max(8px, env(safe-area-inset-right, 0px))
                 max(8px, env(safe-area-inset-bottom, 0px))
                 max(8px, env(safe-area-inset-left, 0px));
    }

    .buentheme-quick-view__panel {
        padding: 16px 14px 14px;
        border-radius: 10px;
        width: 100%;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }

    .buentheme-quick-view__title {
        font-size: 1.15rem;
        margin-bottom: 8px;
    }

    .buentheme-quick-view__price {
        margin-bottom: 10px;
    }

    .buentheme-quick-view__excerpt {
        margin-bottom: 14px;
    }

    .buentheme-quick-view__actions {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .buentheme-quick-view__cta,
    .buentheme-quick-view__link {
        width: 100%;
        text-align: center;
        justify-content: center;
    }
}

@media (max-height: 780px) {
    .buentheme-quick-view {
        --buentheme-qv-img-max: min(34vh, 260px);
    }

    .buentheme-quick-view__image {
        width: min(100%, var(--buentheme-qv-img-max));
        max-height: var(--buentheme-qv-img-max);
    }
}

@media (max-height: 600px) {
    .buentheme-quick-view {
        --buentheme-qv-img-max: min(28vh, 180px);
    }

    .buentheme-quick-view__thumbs {
        margin-top: 8px;
    }

    .buentheme-quick-view__thumb {
        width: 44px;
        height: 44px;
    }
}

/* Grid y presets de tarjeta: CSS dinámico vía inc/woocommerce/appearance.php */

.buentheme-wc-hover-off .buentheme-hover-image,
.buentheme-wc-hover-off .buentheme-image-hover-wrapper:hover .buentheme-hover-image {
    display: none !important;
    opacity: 0 !important;
}

.buentheme-wc-hover-off .buentheme-image-hover-wrapper:hover img:not(.buentheme-hover-image) {
    transform: none;
}

/* --- Producto Individual (Single Product) --- */

/* Alinear ficha con el ancho de la cabecera (content-size del tema/plantilla). */
.buentheme-single-product-main {
    box-sizing: border-box;
}
/* max-width + padding L/R: ver bloque «Refuerzo ficha de producto» más arriba */

.buentheme-single-product-main .buentheme-product-gallery-column .woocommerce-product-gallery,
.buentheme-single-product-main .buentheme-product-gallery-column .wp-block-woocommerce-product-image-gallery {
    width: 100%;
}

.buentheme-single-product-main .buentheme-product-gallery-column .woocommerce-product-gallery__wrapper,
.buentheme-single-product-main .buentheme-product-gallery-column .flex-viewport {
    border-radius: 12px;
    overflow: hidden;
}

.buentheme-single-product-main .buentheme-product-gallery-column img {
    transition: transform 0.5s ease;
    border-radius: 12px;
}

.buentheme-single-product-main .buentheme-product-gallery-column .woocommerce-product-gallery__image img:hover {
    transform: scale(1.02);
}

.buentheme-single-product-main .buentheme-product-gallery-column .flex-control-thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 16px 0 0;
    padding: 0;
    list-style: none;
}

.buentheme-single-product-main .buentheme-product-gallery-column .flex-control-thumbs li {
    width: 72px;
    margin: 0;
}

.buentheme-single-product-main .buentheme-product-gallery-column .flex-control-thumbs li img {
    border-radius: 8px;
    border: 2px solid transparent;
    cursor: pointer;
    opacity: 0.72;
    transition: opacity 0.2s ease, border-color 0.2s ease;
}

.buentheme-single-product-main .buentheme-product-gallery-column .flex-control-thumbs li img.flex-active,
.buentheme-single-product-main .buentheme-product-gallery-column .flex-control-thumbs li img:hover {
    opacity: 1;
    border-color: var(--wp--preset--color--accent-1, #2563eb);
}

/* Modos de galería (Fase 2) */
.buentheme-wc-gallery-slider .buentheme-product-gallery-column .flex-control-thumbs,
.buentheme-gallery-layout-slider .flex-control-thumbs {
    display: none !important;
}

/*
 * Pre-init / sin flexslider (LiteSpeed delay JS para visitantes, adblock, etc.):
 * solo la primera imagen visible en modos slider. Evita el “stack” vertical
 * de todas las fotos de la galería antes de que corra jQuery/flexslider.
 * Cuando flexslider o nuestro fallback marcan .flexslider / .buentheme-gallery-manual,
 * se revierten a display controlado por el slider.
 */
body.buentheme-wc-gallery-slider .woocommerce-product-gallery:not(.flexslider):not(.buentheme-gallery-manual) .woocommerce-product-gallery__wrapper > .woocommerce-product-gallery__image:not(:first-child),
body.buentheme-wc-gallery-slider-thumbs .woocommerce-product-gallery:not(.flexslider):not(.buentheme-gallery-manual) .woocommerce-product-gallery__wrapper > .woocommerce-product-gallery__image:not(:first-child),
.buentheme-gallery-layout-slider:not(.flexslider):not(.buentheme-gallery-manual) .woocommerce-product-gallery__wrapper > .woocommerce-product-gallery__image:not(:first-child) {
    display: none !important;
}

/*
 * Fallback manual sin animación (1 imagen o prefers-reduced-motion):
 * solo la activa visible.
 */
.buentheme-gallery-manual:not(.buentheme-gallery-animated) .woocommerce-product-gallery__wrapper > .woocommerce-product-gallery__image:not(.is-bt-active),
.woocommerce-product-gallery.buentheme-gallery-manual:not(.buentheme-gallery-animated) .woocommerce-product-gallery__image:not(.is-bt-active) {
    display: none !important;
}
.buentheme-gallery-manual:not(.buentheme-gallery-animated) .woocommerce-product-gallery__wrapper > .woocommerce-product-gallery__image.is-bt-active,
.woocommerce-product-gallery.buentheme-gallery-manual:not(.buentheme-gallery-animated) .woocommerce-product-gallery__image.is-bt-active {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    float: none !important;
    margin: 0 !important;
    opacity: 1 !important;
    position: relative !important;
    left: auto !important;
    top: auto !important;
}

/*
 * Si flexslider ya envolvió el DOM (.flex-viewport + transform/width), el modo
 * manual debe anular residuos peligrosos o la galería queda vacía/colapsada.
 */
.buentheme-gallery-manual .flex-viewport {
    height: auto !important;
    max-height: none !important;
    overflow: hidden !important;
}
.buentheme-gallery-manual:not(.buentheme-gallery-animated) .woocommerce-product-gallery__wrapper {
    width: 100% !important;
    max-width: 100% !important;
    transform: none !important;
    transition-duration: 0s !important;
    margin: 0 !important;
}
.buentheme-gallery-manual .flex-direction-nav,
.buentheme-gallery-manual .flex-control-nav:not(.flex-control-thumbs) {
    display: none !important;
}

/*
 * Carrusel manual con slide horizontal.
 * Anchos del track/slides y transform en px los pone el JS (evita contenedores
 * vacíos por % mal calculado + lazy-load + residuos flexslider).
 */
.buentheme-gallery-manual.buentheme-gallery-animated,
.buentheme-gallery-manual.buentheme-gallery-animated .flex-viewport {
    overflow: hidden !important;
    width: 100%;
    max-width: 100%;
}
.buentheme-gallery-manual.buentheme-gallery-animated .woocommerce-product-gallery__wrapper {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: flex-start !important;
    /* width total (n * slideWidth) lo define JS en px — no forzar 100% */
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    will-change: transform;
    box-sizing: border-box !important;
}
.buentheme-gallery-manual.buentheme-gallery-animated .woocommerce-product-gallery__wrapper > .woocommerce-product-gallery__image,
.buentheme-gallery-manual.buentheme-gallery-animated .woocommerce-product-gallery__image {
    display: block !important;
    flex-shrink: 0 !important;
    float: none !important;
    margin: 0 !important;
    padding: 0 !important;
    opacity: 1 !important;
    visibility: visible !important;
    position: relative !important;
    left: auto !important;
    top: auto !important;
    right: auto !important;
    box-sizing: border-box !important;
    /* width/flex-basis los define JS en px; fallback por si el JS aún no corrió */
    min-width: 0;
}
.buentheme-gallery-manual.buentheme-gallery-animated .woocommerce-product-gallery__image > a {
    display: block !important;
    width: 100% !important;
    opacity: 1 !important;
    visibility: visible !important;
}
.buentheme-gallery-manual.buentheme-gallery-animated .woocommerce-product-gallery__image img {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto;
}
/* Zoom de WC deja un .zoomImg absoluto que a veces tapa o deja hueco vacío */
.buentheme-gallery-manual.buentheme-gallery-animated .woocommerce-product-gallery__image img.zoomImg {
    display: none !important;
}
@media (prefers-reduced-motion: reduce) {
    .buentheme-gallery-manual.buentheme-gallery-animated .woocommerce-product-gallery__wrapper {
        transition-duration: 0s !important;
    }
}

/* Contenedor estable aunque no haya viewport de flexslider */
body.buentheme-wc-gallery-slider .woocommerce-product-gallery,
body.buentheme-wc-gallery-slider-thumbs .woocommerce-product-gallery,
.buentheme-gallery-layout-slider {
    position: relative;
    max-width: 100%;
    overflow: hidden;
}
body.buentheme-wc-gallery-slider .woocommerce-product-gallery__wrapper,
body.buentheme-wc-gallery-slider-thumbs .woocommerce-product-gallery__wrapper,
.buentheme-gallery-layout-slider .woocommerce-product-gallery__wrapper {
    max-width: 100%;
}
body.buentheme-wc-gallery-slider .woocommerce-product-gallery__image,
body.buentheme-wc-gallery-slider-thumbs .woocommerce-product-gallery__image,
.buentheme-gallery-layout-slider .woocommerce-product-gallery__image {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}
body.buentheme-wc-gallery-slider .woocommerce-product-gallery__image img,
body.buentheme-wc-gallery-slider-thumbs .woocommerce-product-gallery__image img,
.buentheme-gallery-layout-slider .woocommerce-product-gallery__image img {
    width: 100%;
    height: auto;
    display: block;
    max-width: 100%;
}

/* Slider sin miniaturas — flechas + puntos */
.buentheme-gallery-layout-slider,
.buentheme-wc-gallery-slider .woocommerce-product-gallery {
    position: relative;
}

.buentheme-gallery-slider-controls {
    position: absolute;
    inset: 0;
    z-index: 5;
    pointer-events: none;
}

.buentheme-gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    color: #0f172a;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.14);
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.buentheme-gallery-nav:hover {
    background: #fff;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.2);
    transform: translateY(-50%) scale(1.04);
}

.buentheme-gallery-nav:active {
    transform: translateY(-50%) scale(0.98);
}

.buentheme-gallery-nav--prev {
    left: 12px;
}

.buentheme-gallery-nav--next {
    right: 12px;
}

.buentheme-gallery-slider-dots {
    position: absolute;
    left: 50%;
    bottom: 14px;
    transform: translateX(-50%);
    z-index: 6;
    display: flex;
    gap: 8px;
    align-items: center;
    pointer-events: auto;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.28);
    backdrop-filter: blur(4px);
}

.buentheme-gallery-dot {
    width: 8px;
    height: 8px;
    padding: 0;
    margin: 0;
    border: none;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.55);
    cursor: pointer;
    transition: width 0.2s ease, background 0.2s ease;
}

.buentheme-gallery-dot.is-active {
    width: 20px;
    background: #fff;
}

.buentheme-gallery-dot:hover {
    background: #fff;
}

/* Viewport estable para el slider */
.buentheme-wc-gallery-slider .woocommerce-product-gallery .flex-viewport,
.buentheme-gallery-layout-slider .flex-viewport {
    border-radius: 12px;
    overflow: hidden;
}

.buentheme-wc-gallery-slider .woocommerce-product-gallery,
.buentheme-gallery-layout-slider {
    outline: none;
}

/* --- Estilos del resumen (dashboard: alineación / formulario) --- */
body.buentheme-wc-product-text-left .buentheme-product-summary-column {
    text-align: left;
    align-items: flex-start;
}
body.buentheme-wc-product-text-center .buentheme-product-summary-column {
    text-align: center;
    align-items: center;
}
body.buentheme-wc-product-text-right .buentheme-product-summary-column {
    text-align: right;
    align-items: flex-end;
}

body.buentheme-wc-product-text-center .buentheme-product-summary-column form.cart,
body.buentheme-wc-product-text-right .buentheme-product-summary-column form.cart {
    justify-content: inherit;
}
body.buentheme-wc-product-text-center .buentheme-product-summary-column form.cart {
    justify-content: center;
}
body.buentheme-wc-product-text-right .buentheme-product-summary-column form.cart {
    justify-content: flex-end;
}

body.buentheme-wc-product-text-center .buentheme-product-summary-column .price,
body.buentheme-wc-product-text-right .buentheme-product-summary-column .price {
    display: inline-block;
}

/* Vertical align del resumen vs galería (columnas en escritorio) */
@media (min-width: 782px) {
    body.buentheme-wc-product-valign-start .buentheme-single-product-main > .wp-block-columns {
        align-items: flex-start !important;
    }
    body.buentheme-wc-product-valign-center .buentheme-single-product-main > .wp-block-columns {
        align-items: center !important;
    }
    body.buentheme-wc-product-valign-end .buentheme-single-product-main > .wp-block-columns {
        align-items: flex-end !important;
    }
}

body.buentheme-wc-product-valign-start .buentheme-product-summary-column {
    justify-content: flex-start;
}
body.buentheme-wc-product-valign-center .buentheme-product-summary-column {
    justify-content: center;
}
body.buentheme-wc-product-valign-end .buentheme-product-summary-column {
    justify-content: flex-end;
}

/* Formulario de compra: en línea vs apilado */
body.buentheme-wc-product-form-stacked .buentheme-product-summary-column form.cart {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
}
body.buentheme-wc-product-form-stacked .buentheme-product-summary-column form.cart .quantity,
body.buentheme-wc-product-form-stacked .buentheme-product-summary-column form.cart .buentheme-quantity-stepper {
    width: 100%;
    max-width: 160px;
}
body.buentheme-wc-product-form-stacked.buentheme-wc-product-text-center .buentheme-product-summary-column form.cart .quantity,
body.buentheme-wc-product-form-stacked.buentheme-wc-product-text-center .buentheme-product-summary-column form.cart .buentheme-quantity-stepper {
    margin-left: auto;
    margin-right: auto;
}
body.buentheme-wc-product-form-stacked.buentheme-wc-product-text-right .buentheme-product-summary-column form.cart .quantity,
body.buentheme-wc-product-form-stacked.buentheme-wc-product-text-right .buentheme-product-summary-column form.cart .buentheme-quantity-stepper {
    margin-left: auto;
}
body.buentheme-wc-product-form-stacked .buentheme-product-summary-column form.cart .single_add_to_cart_button,
body.buentheme-wc-product-form-stacked .buentheme-product-summary-column form.cart button.single_add_to_cart_button {
    width: 100%;
    justify-content: center;
}

/* Resumen más limpio */
.buentheme-product-summary-column .wp-block-post-title,
.buentheme-product-summary-column .product_title {
    margin-top: 0;
    margin-bottom: 0.5rem;
    line-height: 1.25;
}
.buentheme-product-summary-column .price {
    margin-bottom: 0.75rem;
    font-size: 1.25rem;
    font-weight: 600;
}
.buentheme-product-summary-column .woocommerce-product-details__short-description,
.buentheme-product-summary-column .wp-block-post-excerpt {
    margin-bottom: 1.25rem;
    color: var(--wp--preset--color--text-2, #64748b);
    line-height: 1.6;
}

/*
 * Grid / stacked: aplicar por body class (no esperar .buentheme-gallery-layout-ready).
 * Con delay de JS (LiteSpeed invitados) el markup clásico de flexslider apilaría
 * o dejaría floats rotos; estos selectores funcionan solo con CSS.
 */
body.buentheme-wc-gallery-grid .buentheme-product-gallery-column .woocommerce-product-gallery .woocommerce-product-gallery__wrapper,
.buentheme-gallery-layout-grid .woocommerce-product-gallery__wrapper {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    width: 100% !important;
    transform: none !important;
}

body.buentheme-wc-gallery-grid .buentheme-product-gallery-column .woocommerce-product-gallery .woocommerce-product-gallery__image,
.buentheme-gallery-layout-grid .woocommerce-product-gallery__image {
    display: block !important;
    width: 100% !important;
    float: none !important;
    margin: 0 !important;
}

body.buentheme-wc-gallery-stacked .buentheme-product-gallery-column .woocommerce-product-gallery .woocommerce-product-gallery__wrapper,
.buentheme-gallery-layout-stacked .woocommerce-product-gallery__wrapper {
    display: flex !important;
    flex-direction: column;
    gap: 16px;
    width: 100% !important;
    transform: none !important;
}

body.buentheme-wc-gallery-stacked .buentheme-product-gallery-column .woocommerce-product-gallery .woocommerce-product-gallery__image,
.buentheme-gallery-layout-stacked .woocommerce-product-gallery__image {
    display: block !important;
    width: 100% !important;
    float: none !important;
    margin: 0 !important;
}

body.buentheme-wc-gallery-grid .buentheme-product-gallery-column .woocommerce-product-gallery .flex-control-thumbs,
body.buentheme-wc-gallery-stacked .buentheme-product-gallery-column .woocommerce-product-gallery .flex-control-thumbs,
.buentheme-gallery-layout-grid .flex-control-thumbs,
.buentheme-gallery-layout-stacked .flex-control-thumbs {
    display: none !important;
}

@media (max-width: 640px) {
    body.buentheme-wc-gallery-grid .buentheme-product-gallery-column .woocommerce-product-gallery .woocommerce-product-gallery__wrapper,
    .buentheme-gallery-layout-grid .woocommerce-product-gallery__wrapper {
        grid-template-columns: 1fr;
    }
}

.buentheme-product-summary-column {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.25rem;
    min-width: 0;
}

/* Stepper de Cantidad (+/-) */
.buentheme-quantity-stepper {
    display: inline-flex;
    align-items: center;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
    height: 42px;
    box-sizing: border-box;
}

.buentheme-quantity-stepper .qty-btn {
    background: #f7fafc;
    border: none;
    width: 36px;
    height: 100%;
    font-size: 18px;
    font-weight: 500;
    color: #4a5568;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease, color 0.2s ease;
    padding: 0;
}

.buentheme-quantity-stepper .qty-btn:hover {
    background-color: #edf2f7;
    color: #1a202c;
}

.buentheme-quantity-stepper .qty-btn:active {
    background-color: #e2e8f0;
}

/* Esconder spinners por defecto en input de cantidad */
.buentheme-quantity-stepper input[type="number"].qty {
    width: 44px;
    height: 100%;
    border: none;
    border-left: 1px solid #e2e8f0;
    border-right: 1px solid #e2e8f0;
    text-align: center;
    font-size: 15px;
    font-weight: 600;
    color: #2d3748;
    background: #fff;
    margin: 0;
    padding: 0;
    -moz-appearance: textfield;
}

.buentheme-quantity-stepper input[type="number"].qty::-webkit-outer-spin-button,
.buentheme-quantity-stepper input[type="number"].qty::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Formularios de Variaciones y Añadir al Carrito */
.buentheme-product-summary-column form.cart {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
}

.buentheme-product-summary-column form.cart .quantity {
    margin: 0 !important;
}

.buentheme-product-summary-column .single_add_to_cart_button {
    min-height: 42px;
    height: auto;
    padding: 0.55rem 1.25rem !important;
    font-weight: 600;
    line-height: 1.2;
    white-space: normal;
    overflow: hidden;
    text-align: center;
    box-sizing: border-box;
    max-width: 100%;
    border-radius: 6px !important;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease !important;
}

.buentheme-product-summary-column .single_add_to_cart_button:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

@media (max-width: 781px) {
    .buentheme-product-summary-column form.cart {
        max-width: 100%;
    }

    .buentheme-product-summary-column .single_add_to_cart_button {
        flex: 1 1 auto;
        min-width: 0;
        width: auto;
        max-width: 100%;
        font-size: clamp(0.75rem, 2.8vw, 0.9rem);
        padding: 0.55rem 0.85rem !important;
    }
}

/* Pestañas de producto */
.buentheme-product-tabs-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 24px;
    padding: 0;
    border-bottom: 1px solid #e2e8f0;
}

.buentheme-product-tab-btn {
    appearance: none;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: #64748b;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 -1px;
    padding: 12px 18px;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.buentheme-product-tab-btn:hover,
.buentheme-product-tab-btn.is-active {
    color: #1e293b;
    border-bottom-color: var(--wp--preset--color--accent-1, #2563eb);
}

/* Placeholder de pestañas solo visible en editor (el front rellena con PHP) */
body:not(.block-editor-page) .buentheme-tab-placeholder {
	display: none !important;
}

/*
 * Productos relacionados (ficha)
 * Evitar el CSS clásico de WC (ul.products li.product { float; width:22% })
 * que dejaba las tarjetas como franjas verticales con el texto letra a letra.
 */
.buentheme-product-related {
	display: block !important;
	flex-direction: column !important;
	flex-wrap: nowrap !important;
	align-items: stretch !important;
	width: 100% !important;
	max-width: 100%;
	box-sizing: border-box;
	clear: both;
	margin-top: var(--wp--preset--spacing--60, 4rem);
}

.buentheme-product-related > .buentheme-related-heading,
.buentheme-product-related > h2 {
	display: block !important;
	width: 100% !important;
	max-width: 100% !important;
	float: none !important;
	flex: none !important;
	margin-bottom: var(--wp--preset--spacing--30, 1.5rem) !important;
	writing-mode: horizontal-tb !important;
	text-orientation: mixed !important;
}

/*
 * Grid de relacionados (sin clase .products de WC).
 * Aspecto de tarjeta: lo gobierna buentheme-wc-appearance-css
 * (mismos selectores que catálogo / Query Loop Premium).
 * Aquí solo layout del grid + defensa anti-float de WC.
 */
.buentheme-product-related .buentheme-related-products-grid,
.buentheme-product-related .buentheme-wc-related-sync,
.buentheme-product-related .buentheme-wc-related-products,
.buentheme-product-related .wp-block-woocommerce-product-collection,
.buentheme-product-related ul.wc-block-product-template,
.buentheme-product-related ul.wp-block-woocommerce-product-template,
.buentheme-product-related .wc-block-product-template,
.buentheme-product-related .wp-block-woocommerce-product-template,
.woocommerce .buentheme-product-related ul.products,
.woocommerce-page .buentheme-product-related ul.products {
	display: grid !important;
	grid-template-columns: repeat(var(--buentheme-wc-cols-m, 2), minmax(0, 1fr)) !important;
	gap: 1.75rem !important;
	list-style: none !important;
	margin: 0 !important;
	padding: 0 !important;
	width: 100% !important;
	max-width: 100% !important;
	float: none !important;
	clear: both !important;
	flex: none !important;
	min-width: 0 !important;
	box-sizing: border-box !important;
	align-items: stretch !important;
}

.buentheme-product-related .buentheme-related-products-grid > li,
.buentheme-product-related .buentheme-related-product,
.buentheme-product-related li.wc-block-product,
.buentheme-product-related ul.wc-block-product-template > li,
.buentheme-product-related ul.wp-block-woocommerce-product-template > li,
.woocommerce .buentheme-product-related ul.products li.product,
.woocommerce-page .buentheme-product-related ul.products li.product {
	display: flex !important;
	flex-direction: column !important;
	float: none !important;
	clear: none !important;
	width: 100% !important;
	max-width: 100% !important;
	min-width: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
	position: relative !important;
	box-sizing: border-box !important;
	height: 100% !important;
	min-height: 100% !important;
	background: transparent !important;
	border: none !important;
	box-shadow: none !important;
}

/* Overlay en ficha: overflow visible para hover del botón */
.buentheme-product-related .buentheme-product-card.buentheme-card-preset-overlay,
.buentheme-product-related .wp-block-group.buentheme-product-card.buentheme-card-preset-overlay {
	overflow: visible !important;
}

@media (min-width: 600px) and (max-width: 1079px) {
	.buentheme-product-related .buentheme-related-products-grid,
	.buentheme-product-related .buentheme-wc-related-sync,
	.buentheme-product-related ul.wc-block-product-template,
	.buentheme-product-related ul.wp-block-woocommerce-product-template,
	.woocommerce .buentheme-product-related ul.products {
		grid-template-columns: repeat(var(--buentheme-wc-cols-t, 2), minmax(0, 1fr)) !important;
	}
}

@media (min-width: 1080px) {
	.buentheme-product-related .buentheme-related-products-grid,
	.buentheme-product-related .buentheme-wc-related-sync,
	.buentheme-product-related ul.wc-block-product-template,
	.buentheme-product-related ul.wp-block-woocommerce-product-template,
	.woocommerce .buentheme-product-related ul.products {
		grid-template-columns: repeat(var(--buentheme-wc-cols-d, var(--buentheme-related-cols, 3)), minmax(0, 1fr)) !important;
	}
}

.buentheme-product-tab-panel[hidden] {
    display: none !important;
}

.buentheme-product-tab-panel.is-active {
    display: block;
}

.buentheme-product-flat-description > h2 {
    margin-bottom: 1.25rem;
}

.buentheme-product-reviews-panel .comment-respond {
    margin-top: 1.5rem;
}

/* Swatches de variaciones */
.buentheme-variation-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
}

.buentheme-swatch {
    appearance: none;
    background: #fff;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    color: #334155;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    min-height: 36px;
    min-width: 36px;
    padding: 6px 12px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.buentheme-swatch:hover {
    border-color: #cbd5e0;
    transform: translateY(-1px);
}

.buentheme-swatch.is-selected {
    border-color: var(--wp--preset--color--accent-1, #2563eb);
    box-shadow: 0 0 0 1px var(--wp--preset--color--accent-1, #2563eb);
}

.buentheme-swatch.is-color-swatch {
    border-radius: 50%;
    height: 36px;
    min-width: 36px;
    padding: 0;
    width: 36px;
}

.buentheme-swatch-color {
    background: var(--buentheme-swatch-color, #cbd5e0);
    border-radius: 50%;
    display: block;
    height: 100%;
    width: 100%;
}

.buentheme-swatch-select-hidden {
    clip: rect(0, 0, 0, 0) !important;
    height: 1px !important;
    overflow: hidden !important;
    position: absolute !important;
    white-space: nowrap !important;
    width: 1px !important;
}

.variations tr .value {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Selectores de variación más limpios */
.variations select {
    padding: 8px 12px;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    background-color: #fff;
    font-size: 14px;
    color: #2d3748;
    min-width: 150px;
    outline: none;
    transition: border-color 0.2s ease;
}

.variations select:focus {
    border-color: var(--wp--preset--color--accent-1, #2563eb);
}

.variations td.label {
    padding-right: 15px;
    font-weight: 600;
    color: #4a5568;
    vertical-align: middle;
}

/* --- Sticky Buy Bar --- */

.buentheme-sticky-buy-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
    /* Por debajo de BuenChat (999999) e ir-arriba (1000100); full-width en el suelo */
    z-index: 100000;
    padding: 12px 24px;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    pointer-events: none;
}

.buentheme-sticky-buy-bar.is-visible {
    transform: translateY(0);
    pointer-events: auto;
}

body.buentheme-sticky-bar-active {
    scroll-padding-bottom: calc(var(--buentheme-sticky-bar-height, 80px) + 8px);
}

.buentheme-sticky-buy-bar .sticky-buy-btn.disabled,
.buentheme-sticky-buy-bar .sticky-buy-btn:disabled {
    cursor: not-allowed;
    opacity: 0.65;
}

.sticky-buy-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.sticky-buy-product {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sticky-buy-img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.sticky-buy-info {
    display: flex;
    flex-direction: column;
}

.sticky-buy-title {
    font-weight: 600;
    font-size: 14px;
    color: #1a202c;
}

.sticky-buy-price {
    font-size: 13px;
    color: #4a5568;
    font-weight: 500;
}

.sticky-buy-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.sticky-buy-btn {
    min-height: 42px;
    height: auto;
    padding: 0.5rem 1rem !important;
    font-weight: 600;
    border-radius: 6px !important;
    border: none;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.2;
    white-space: normal;
    overflow: hidden;
    text-align: center;
    box-sizing: border-box;
    max-width: 100%;
    min-width: 0;
}

/* Responsividad para móviles */
@media (max-width: 640px) {
    .buentheme-sticky-buy-bar {
        padding: 10px 16px;
    }
    
    .sticky-buy-content {
        gap: 10px;
    }

    .sticky-buy-product {
        display: none;
    }

    .sticky-buy-actions {
        width: 100%;
        justify-content: space-between;
        min-width: 0;
    }

    .sticky-buy-actions .buentheme-quantity-stepper {
        flex: 0 0 auto;
        max-width: 120px;
    }

    .sticky-buy-btn {
        flex: 1 1 auto;
        min-width: 0;
        max-width: 100%;
        text-align: center;
        font-size: clamp(0.72rem, 3vw, 0.875rem);
        padding: 0.5rem 0.55rem !important;
        white-space: normal;
        overflow: hidden;
        max-height: 3rem;
        line-height: 1.15;
    }
}
