.boke-customizer {
    margin: 24px 0;
    padding: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    background: #fafafa;
    text-align: center;
}

.boke-customizer h3 {
    margin: 0 0 16px;
    font-size: 17px;
    font-weight: 600;
    color: #222;
    text-align: center;
}

.boke-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
}

.boke-btn {
    height: 34px;
    padding: 0 14px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    background: #2271b1;
    color: #fff;
    transition: background 0.2s;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
}

.boke-btn:hover {
    background: #135e96;
}

.boke-btn-danger {
    background: #d63638;
}

.boke-btn-danger:hover {
    background: #b32d2e;
}

.boke-btn-secondary {
    background: #6c757d;
}

.boke-btn-secondary:hover {
    background: #545b62;
}

#boke-upload-logo {
    display: none;
}

.boke-color-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #444;
}

.boke-canvas-wrap {
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
    display: inline-block;
    max-width: 100%;
}

.boke-canvas-wrap canvas {
    display: block;
    max-width: 100%;
}

/* --- Toolbar de formato de texto --- */
.boke-format-toolbar {
    display: none;
    align-items: center;
    gap: 6px;
    padding: 8px 0 4px;
    margin-top: 6px;
    border-top: 1px solid #e0e0e0;
    flex-wrap: wrap;
}

.boke-format-toolbar.visible,
.boke-format-toolbar[style*="display: flex"],
.boke-format-toolbar[style*="display:flex"] {
    display: flex;
}

.boke-fmt-btn {
    height: 30px;
    min-width: 30px;
    padding: 0 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    font-size: 13px;
    box-sizing: border-box;
    transition: background 0.15s, border-color 0.15s;
}

.boke-fmt-btn:hover,
.boke-fmt-btn.active {
    background: #2271b1;
    color: #fff;
    border-color: #2271b1;
}

.boke-fmt-delete-btn {
    color: #d63638;
    border-color: #d63638;
    margin-left: auto;
}

.boke-fmt-delete-btn:hover {
    background: #d63638;
    color: #fff;
    border-color: #d63638;
}

.boke-fmt-select {
    height: 30px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 12px;
    padding: 0 6px;
    cursor: pointer;
    box-sizing: border-box;
}

.boke-fmt-input {
    height: 30px;
    width: 54px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 12px;
    padding: 0 6px;
    text-align: center;
    box-sizing: border-box;
}

.boke-fmt-color {
    height: 30px;
    width: 36px;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    padding: 2px;
    box-sizing: border-box;
}

/* --- Preview en carrito --- */
.boke-cart-preview-img {
    max-width: 220px;
    width: 100%;
    border-radius: 6px;
    border: 1px solid #ddd;
    display: block;
    margin-top: 6px;
    cursor: zoom-in;
    transition: opacity 0.2s;
}

/* Más grande en la página completa del carrito */
.woocommerce-cart .boke-cart-preview-img,
.woocommerce-checkout .boke-cart-preview-img {
    max-width: 300px;
}

.boke-cart-preview-img:hover {
    opacity: 0.85;
}

/* --- Lightbox --- */
.boke-lightbox-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
}

.boke-lightbox-overlay.active {
    display: flex;
}

.boke-lightbox-overlay img {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 6px;
    box-shadow: 0 4px 30px rgba(0,0,0,0.5);
}

.boke-status {
    margin-top: 8px;
    font-size: 13px;
    color: #2271b1;
    font-style: italic;
}

.boke-hint {
    margin-top: 6px;
    font-size: 12px;
    color: #888;
}

/* --- Página de producto: layout --- */

/* Título en su línea, precio debajo más grande */
.single-product .wp-block-column .wp-block-post-title {
    display: block;
    margin-bottom: 6px;
}
.single-product .wp-block-column .wp-block-woocommerce-product-price,
.single-product .wp-block-column .wp-block-woocommerce-product-price > *,
.single-product .wp-block-column .wp-block-woocommerce-product-price ins {
    display: block !important;
    margin: 0 0 8px !important;
    padding: 0;
    font-size: 1.6rem !important;
    font-weight: 600 !important;
    color: #2C2A29 !important;
}
.single-product .wp-block-column .wp-block-woocommerce-product-price::before {
    content: '';
}
/* Ocultar precio original tachado (solo mostrar precio de venta) */
.single-product .wp-block-woocommerce-product-price del {
    display: none !important;
}

/* Ocultar descripción duplicada (está en pestaña Descripción) */
.single-product .wp-block-post-excerpt {
    display: none;
}

/* Reducir espacio vertical del bloque personalizador */
.single-product .boke-customizer {
    margin: 8px 0 12px;
}

/* Columnas producto: imagen 38%, resumen 58% */
.single-product .woocommerce-product-gallery {
    width: 38% !important;
    float: left !important;
}
.single-product .summary.entry-summary {
    width: 58% !important;
    float: left !important;
    margin-left: 4% !important;
}
.single-product .woocommerce-product-gallery img.wp-post-image,
.single-product .woocommerce-product-gallery .woocommerce-product-gallery__image img {
    width: 100% !important;
    height: auto !important;
}

/* Compensar header fijo en páginas que no usan el builder del tema */
body.woocommerce .wp-site-blocks,
body.woocommerce-page .wp-site-blocks,
body.home .wp-site-blocks {
    padding-top: 75px !important;
}
body.admin-bar.woocommerce .wp-site-blocks,
body.admin-bar.woocommerce-page .wp-site-blocks,
body.admin-bar.home .wp-site-blocks {
    padding-top: 107px !important;
}

/* --- Columna izquierda: precio, stock y formulario de compra --- */
.boke-purchase-info {
    margin-top: 14px;
    padding: 16px;
    background: #fafafa;
    border: 1px solid #dce6f0;
    border-radius: 12px;
    text-align: center;
}

.boke-purchase-info .wp-block-woocommerce-product-price,
.boke-purchase-info .wp-block-woocommerce-product-price > *,
.boke-purchase-info .wp-block-woocommerce-product-price ins {
    display: block !important;
    font-size: 2rem !important;
    font-weight: 700 !important;
    color: #2271b1 !important;
    margin: 0 0 10px !important;
    padding: 0 !important;
    text-decoration: none !important;
}

.boke-purchase-info .wp-block-woocommerce-product-price del {
    display: none !important;
}

.boke-purchase-info .stock {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #1a7a1a;
    background: #e6f4e6;
    border: 1px solid #b8ddb8;
    border-radius: 20px;
    padding: 4px 12px;
    margin: 0 0 14px !important;
}

.boke-purchase-info .stock::before {
    content: '●';
    font-size: 8px;
    color: #2d9e2d;
}

.boke-purchase-info form.cart {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 !important;
    flex-wrap: nowrap;
}

.boke-purchase-info form.cart .qty {
    width: 64px !important;
    height: 44px !important;
    border: 2px solid #ccd9e8 !important;
    border-radius: 8px !important;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    color: #2C2A29;
    background: #fff;
    box-sizing: border-box;
}

.boke-purchase-info form.cart .single_add_to_cart_button {
    flex: 1;
    height: 44px !important;
    background: #2271b1 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 8px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    cursor: pointer;
    transition: background 0.2s;
    padding: 0 16px !important;
    white-space: nowrap;
}

.boke-purchase-info form.cart .single_add_to_cart_button:hover {
    background: #135e96 !important;
}

/* Botón de pago express (Google Pay) en columna izquierda */
.boke-purchase-info ~ .wcpay-express-checkout-wrapper {
    margin-top: 10px;
    width: 100%;
}

/* Columnas del producto: fijar anchos para eliminar espacio vacío */
.woocommerce.product .wp-block-columns > .wp-block-column:first-child {
    flex-basis: 38% !important;
    max-width: 38% !important;
    flex-grow: 0 !important;
    flex-shrink: 0 !important;
}
.woocommerce.product .wp-block-columns > .wp-block-column:last-child {
    flex-basis: 0 !important;
    max-width: none !important;
    flex-grow: 1 !important;
    min-width: 0;
}

/* Botón añadir al carrito bloqueado mientras se guarda el diseño */
.single_add_to_cart_button.boke-btn-loading,
.single_add_to_cart_button[disabled] {
    opacity: 0.45 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
    filter: grayscale(40%) !important;
}
