
/* 05 · CUSTOM SETS */

/* Custom Sets x2 y x4: ocultar Size y Clear */
body:is(.postid-889, .postid-939, .postid-9870, .postid-9872) .woosb-wrap .variation-pa_size,
body:is(.postid-889, .postid-939, .postid-9870, .postid-9872) .woosb-wrap .reset_variations {
    display: none !important;
}

/* Custom Sets: separación entre cafés */
body:is(.postid-889, .postid-939, .postid-9870, .postid-9872) .woosb-wrap .woosb-product {
    padding-top: 15px !important;
    padding-bottom: 15px !important;
}

/* Custom Sets: moliendas horizontales */
body:is(.postid-889, .postid-939, .postid-9870, .postid-9872) .woosb-wrap .variation-pa_grind .variable-items-wrapper {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 8px !important;
    width: max-content !important;
    max-width: 100% !important;
    margin-top: 8px !important;
}

/* Custom Sets: botones de molienda */
body:is(.postid-889, .postid-939, .postid-9870, .postid-9872) .woosb-wrap .variation-pa_grind .variable-item {
    flex: 0 0 auto !important;
    width: auto !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 6px 10px !important;
}

/* Custom Sets: controles de cantidad */
body:is(.postid-889, .postid-939, .postid-9870, .postid-9872) .woosb-wrap .woosb-quantity {
    display: inline-flex;
    align-items: center;
    gap: 0;
}

/* Custom Sets: tamaño de cantidad */
body:is(.postid-889, .postid-939, .postid-9870, .postid-9872) .woosb-wrap .woosb-quantity .minus,
body:is(.postid-889, .postid-939, .postid-9870, .postid-9872) .woosb-wrap .woosb-quantity .plus,
body:is(.postid-889, .postid-939, .postid-9870, .postid-9872) .woosb-wrap .woosb-quantity input.qty {
    width: 40px !important;
    height: 40px !important;
    min-width: 0 !important;
    padding: 0 !important;
    text-align: center;
    font-size: 13px;
}

/* Custom Sets: alinear cantidad y precio */
body:is(.postid-889, .postid-939, .postid-9870, .postid-9872) .woosb-wrap .woosb-quantity,
body:is(.postid-889, .postid-939, .postid-9870, .postid-9872) .woosb-wrap .woosb-price {
    align-self: center !important;
    transform: translateY(18px);
}

/* Custom Sets: barra fija inferior */
body:is(.postid-889, .postid-939, .postid-9870, .postid-9872) #custom-set-sticky {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    z-index: 99999 !important;
    background: #fff;
    border-top: 1px solid #e5e5e5;
    padding: 15px 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    box-sizing: border-box;
    transform: translateY(110%);
    transition: transform .25s ease;
}

/* Custom Sets: mostrar barra fija */
body:is(.postid-889, .postid-939, .postid-9870, .postid-9872) #custom-set-sticky.is-visible {
    transform: translateY(0) !important;
}

/* Custom Sets: precio de barra */
body:is(.postid-889, .postid-939, .postid-9870, .postid-9872) .custom-set-sticky-price {
    font-size: 16px;
    font-weight: 600;
}

/* Custom Sets: botón de barra */
body:is(.postid-889, .postid-939, .postid-9870, .postid-9872) .custom-set-sticky-button {
    background: #111;
    color: #fff;
    border: 0;
    padding: 12px 28px;
    cursor: pointer;
}

/* Custom Sets: botón desactivado */
body:is(.postid-889, .postid-939, .postid-9870, .postid-9872) .custom-set-sticky-button:disabled {
    background: #aaa !important;
    color: #fff !important;
    opacity: 0.6 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
}

/* Barra fija: ocultar en productos normales */
body.single-product:not(:is(.postid-889, .postid-939, .postid-9870, .postid-9872)) #custom-set-sticky {
    display: none !important;
}

/* Custom Sets x2 y x4: precios siempre en una línea */
body:is(.postid-889, .postid-939, .postid-9870, .postid-9872) .woosb-wrap .woosb-price {
    white-space: nowrap !important;
    width: max-content !important;
    min-width: max-content !important;
}

/* Evitar saltos entre precio original y rebajado */
body:is(.postid-889, .postid-939, .postid-9870, .postid-9872) .woosb-price del,
body:is(.postid-889, .postid-939, .postid-9870, .postid-9872) .woosb-price ins {
    display: inline !important;
    white-space: nowrap !important;
}

/* Custom Sets: diseño móvil */
@media (max-width: 767px) {

    /* Ajustar ancho de la lista */
    body:is(.postid-889, .postid-939, .postid-9870, .postid-9872) .woosb-wrap,
    body:is(.postid-889, .postid-939, .postid-9870, .postid-9872) .woosb-products,
    body:is(.postid-889, .postid-939, .postid-9870, .postid-9872) .woosb-product {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        box-sizing: border-box;
    }

    /* Organizar cada café */
    body:is(.postid-889, .postid-939, .postid-9870, .postid-9872) .woosb-wrap .woosb-product {
        display: flex !important;
        flex-wrap: wrap !important;
        align-items: flex-start !important;
        column-gap: 12px !important;
        row-gap: 8px !important;
        padding: 14px 0 !important;
    }

    /* Nombre y variaciones */
    body:is(.postid-889, .postid-939, .postid-9870, .postid-9872) .woosb-wrap .woosb-title {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
        margin: 0 !important;
    }

    /* Evitar anchuras fijas en variaciones */
    body:is(.postid-889, .postid-939, .postid-9870, .postid-9872) .woosb-wrap .variations_form,
    body:is(.postid-889, .postid-939, .postid-9870, .postid-9872) .woosb-wrap .variations,
    body:is(.postid-889, .postid-939, .postid-9870, .postid-9872) .woosb-wrap .variation-pa_grind {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        box-sizing: border-box;
    }

    /* Moliendas adaptadas al ancho móvil */
    body:is(.postid-889, .postid-939, .postid-9870, .postid-9872) .woosb-wrap .variation-pa_grind .variable-items-wrapper {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 5px !important;
        width: 100% !important;
        max-width: 100% !important;
        margin-top: 6px !important;
        box-sizing: border-box;
    }

    /* Botones de molienda compactos */
    body:is(.postid-889, .postid-939, .postid-9870, .postid-9872) .woosb-wrap .variation-pa_grind .variable-item {
        flex: 0 1 auto !important;
        width: auto !important;
        min-width: 0 !important;
        max-width: 100% !important;
        height: auto !important;
        min-height: 34px !important;
        padding: 6px 8px !important;
        margin: 0 !important;
        font-size: 11px !important;
        box-sizing: border-box;
    }

    /* Texto de las moliendas */
    body:is(.postid-889, .postid-939, .postid-9870, .postid-9872) .woosb-wrap .variation-pa_grind .variable-item span {
        font-size: 11px !important;
        white-space: normal !important;
        line-height: 1.3;
    }

    /* Cantidad sin desplazamiento vertical */
    body:is(.postid-889, .postid-939, .postid-9870, .postid-9872) .woosb-wrap .woosb-quantity {
        display: inline-flex !important;
        flex: 0 0 auto !important;
        width: auto !important;
        margin: 4px 0 0 !important;
        transform: none !important;
        align-self: center !important;
    }

    /* Precio junto a cantidad */
    body:is(.postid-889, .postid-939, .postid-9870, .postid-9872) .woosb-wrap .woosb-price {
        flex: 0 0 auto !important;
        width: auto !important;
        margin: 4px 0 0 !important;
        transform: none !important;
        align-self: center !important;
    }

    /* Controles compactos */
    body:is(.postid-889, .postid-939, .postid-9870, .postid-9872) .woosb-wrap .woosb-quantity .minus,
    body:is(.postid-889, .postid-939, .postid-9870, .postid-9872) .woosb-wrap .woosb-quantity .plus,
    body:is(.postid-889, .postid-939, .postid-9870, .postid-9872) .woosb-wrap .woosb-quantity input.qty {
        width: 36px !important;
        height: 36px !important;
        font-size: 12px !important;
    }

    /* Barra fija móvil */
    body:is(.postid-889, .postid-939, .postid-9870, .postid-9872) #custom-set-sticky {
        padding: 10px 14px !important;
        gap: 12px !important;
        justify-content: space-between !important;
    }

    /* Precio compacto en barra */
    body:is(.postid-889, .postid-939, .postid-9870, .postid-9872) .custom-set-sticky-price {
        font-size: 12px !important;
        line-height: 1.3;
        min-width: 0;
    }

    /* Botón compacto en barra */
    body:is(.postid-889, .postid-939, .postid-9870, .postid-9872) .custom-set-sticky-button {
        padding: 11px 16px !important;
        font-size: 12px !important;
        white-space: nowrap;
        flex-shrink: 0;
    }

    /* Acercar precio al título */
    body:is(.postid-889, .postid-939, .postid-9870, .postid-9872) .summary.entry-summary .product_title {
        margin-bottom: 10px !important;
    }

    body:is(.postid-889, .postid-939, .postid-9870, .postid-9872) .summary.entry-summary > .price {
        margin-top: 0 !important;
        margin-bottom: 20px !important;
    }
}
