/*===================================PRODUCT IMAGES====================================*/

#product-images .flex-viewport {
    max-height: 450px !important;
}


/* Ocultar thumbnails a partir del 5to */

#product-images .flex-control-thumbs li:nth-child(n+5) {
    display: none !important;
}


/*===================================PRICE PER UNITY====================================*/

#price-per-unity.price {
    max-width: 300px;
}


/*===================================ADD TO CART BUTTON====================================*/

#add-to-cart .stock.out-of-stock {
    width: fit-content;
    padding: 12px 24px;
    background: #fafafa;
    border-radius: 50px;
    margin-right: 20px;
}


/*===================================QUANTITY INPUT (+ / -)====================================*/


/* Contenedor .quantity de WooCommerce */

body:not(.woocommerce-cart) .woocommerce div.product form.cart .quantity,
body:not(.woocommerce-cart) .woocommerce .quantity {
    display: flex;
    align-items: center;
    border: 1px solid #d1d5dc;
    border-radius: 10px;
    overflow: hidden;
    height: 48px;
}


/* Botones + / - inyectados por JS */

body:not(.woocommerce-cart) .woocommerce .quantity .monpizza-qty-btn {
    width: 40px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #0a0a0a;
    transition: background 0.2s;
    flex-shrink: 0;
    padding: 0;
    font-size: 0;
    line-height: 1;
}

body:not(.woocommerce-cart) .woocommerce .quantity .monpizza-qty-btn:hover {
    background: #f3f4f6;
}

body:not(.woocommerce-cart) .woocommerce .quantity .monpizza-qty-btn svg {
    width: 16px;
    height: 16px;
    pointer-events: none;
}


/* Input numérico */

body:not(.woocommerce-cart) .woocommerce .quantity input.qty {
    width: 64px;
    height: 100%;
    text-align: center;
    border: none;
    border-left: 1px solid #d1d5dc;
    border-right: 1px solid #d1d5dc;
    font-family: 'Poppins', sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 24px;
    color: #0a0a0a;
    -moz-appearance: textfield;
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
    padding: 0;
    outline: none;
    background: transparent;
}


/* Ocultar flechas nativas del input number */

body:not(.woocommerce-cart) .woocommerce .quantity input.qty::-webkit-outer-spin-button,
body:not(.woocommerce-cart) .woocommerce .quantity input.qty::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}


/* Label "Unidad/es" encima del qty */

.monpizza-qty-label {
    display: block;
    font-family: 'Poppins', sans-serif;
    font-weight: 400;
    font-size: 14px;
    line-height: 20px;
    color: #6a7282;
    margin-bottom: 4px;
}


/*===================================AÑADIR AL CARRITO SHORTCODE====================================*/

.monpizza-add-to-cart {
    display: flex;
    flex-direction: column;
    align-items: start;
    gap: 12px;
}

.monpizza-atc-cantidad {
    display: flex;
    align-items: center;
    border: 1px solid #d1d5dc;
    border-radius: 10px;
    overflow: hidden;
    height: 48px;
}

.monpizza-atc-btn {
    width: 32px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #0a0a0a;
    transition: background 0.2s;
    flex-shrink: 0;
    padding: 0;
}

.monpizza-atc-btn:hover,
.monpizza-atc-btn:focus {
    background: #680809;
    color: #fff;
    outline: none;
}

.monpizza-atc-btn svg {
    width: 16px;
    height: 16px;
    pointer-events: none;
}

.monpizza-atc-input {
    width: 42px;
    padding: 0px !important;
    height: 100%;
    text-align: center;
    border: none;
    border-left: 1px solid #d1d5dc;
    border-right: 1px solid #d1d5dc;
    font-family: 'Poppins', sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 24px;
    color: #0a0a0a;
    -moz-appearance: textfield;
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
    outline: none;
    background: transparent;
}

.monpizza-atc-input::-webkit-outer-spin-button,
.monpizza-atc-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.monpizza-atc-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 48px;
    padding: 0 24px;
    background: #680809;
    color: #fff;
    border: none;
    border-radius: 100px;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    font-size: 14px;
    line-height: 20px;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

.monpizza-atc-submit:hover {
    background: #520607;
}

.monpizza-atc-submit:disabled,
.monpizza-atc-submit.out-of-stock {
    background: #d1d5dc;
    color: #6a7282;
    cursor: not-allowed;
    pointer-events: none;
}

.monpizza-atc-submit.loading {
    opacity: 0.7;
    pointer-events: none;
}

.monpizza-atc-submit svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}


/* Notificación flotante */

.atc-floating-notice {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    z-index: 99999;
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    width: calc(100% - 40px);
    max-width: 1390px;
}

.atc-floating-notice.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.atc-floating-notice .woocommerce-message {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff;
    padding: 16px 20px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-left: 4px solid #680809;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    width: 100%;
}

.atc-close-notice {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: #6a7282;
    flex-shrink: 0;
}


/*===================================QUITAMIEDOS====================================*/

#quitamiedos .elementor-icon-list-items {
    display: flex;
    gap: 8px;
}

#quitamiedos .elementor-icon-list-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    text-align: center;
    margin-block-start: 0px !important;
    gap: 8px;
    flex: 1 1;
}


/*===================================ACORDEONES====================================*/

#acordeon-product,
#acordeon-faqs {
    details {
        box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.10), 0 1px 2px -1px rgba(0, 0, 0, 0.10);
        border-radius: 10px;
        border: 1px solid #E5E7EB;
    }
    details[open] {
        .e-n-accordion-item-title {
            border-width: 0px !important;
        }
    }
}


/*===================================BADGES GLOBALES====================================*/


/* Contenedor de badges */

.monpizza-badges {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 6px;
    pointer-events: none;
}


/* Badges en producto individual */

.monpizza-badges-single {
    top: 16px;
    left: 16px;
    z-index: 100;
}


/* Estilo base del badge - Diseño Figma */

.monpizza-badge {
    display: inline-block;
    padding: 7px 16px;
    font-family: 'Poppins', sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 24px;
    color: #680809;
    border-radius: 9999px;
    white-space: nowrap;
    width: fit-content;
    box-shadow: 0px 4px 6px -1px rgba(0, 0, 0, 0.1), 0px 2px 4px -2px rgba(0, 0, 0, 0.1);
}


/* Más vendido - Amarillo (diseño Figma) */

.monpizza-badge-bestseller {
    background: #fecc32;
    color: #680809;
}


/* Nuevo - Azul */

.monpizza-badge-nuevo {
    background: #dbeafe;
    color: #1e40af;
}


/* Oferta - Rojo */

.monpizza-badge-oferta {
    background: #fee2e2;
    color: #b91c1c;
}


/* Saludable - Verde */

.monpizza-badge-saludable {
    background: #d1fae5;
    color: #047857;
}


/* === GeneratePress específico === */


/* Contenedor del producto en el loop */

.woocommerce ul.products li.product {
    position: relative !important;
}


/* Imagen del producto en GeneratePress */

.woocommerce ul.products li.product .woocommerce-LoopProduct-link,
.woocommerce ul.products li.product .woocommerce-loop-product__link,
.woocommerce ul.products li.product>a:first-child {
    position: relative !important;
    display: block;
}


/* Contenedor de imagen específico de GeneratePress */

.woocommerce ul.products li.product .attachment-woocommerce_thumbnail,
.woocommerce ul.products li.product img {
    display: block;
}


/* Asegurar que el contenedor del producto tenga position relative */

.wc-block-grid__product,
.product-small {
    position: relative;
}


/* Galería de producto individual */

.woocommerce-product-gallery {
    position: relative !important;
}


/* Producto individual - galería GeneratePress */

.woocommerce div.product div.images {
    position: relative !important;
}


/* Badge dentro de TTPI cards */

.ttpi-imagen {
    position: relative;
}

.ttpi-imagen .monpizza-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 10;
}


/*===================================PRODUCTO RECOMENDADO====================================*/

.producto-recomendado-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    padding: 12px;
}

.producto-recomendado-imagen {
    flex-shrink: 0;
    width: 120px;
    height: 120px;
    background: #f9fafb;
    border-radius: 10px;
    overflow: hidden;
    display: block;
    text-decoration: none;
    position: relative;
}

.producto-recomendado-imagen:hover {
    opacity: 0.9;
}

.producto-recomendado-imagen img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}


/* Badge circular con icono */

.pr-badge-circle {
    position: absolute;
    top: 0;
    left: 0;
    width: fit-content;
    height: 32px;
    border-radius: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.15);
    z-index: 10;
    padding: 8px;
    font-size: 10px;
}


/* Más vendido - Amarillo */

.pr-badge-bestseller {
    background: #fecc32;
    color: #680809;
}


/* Nuevo - Azul */

.pr-badge-nuevo {
    background: #dbeafe;
    color: #1e40af;
}


/* Oferta - Rojo */

.pr-badge-oferta {
    background: #fee2e2;
    color: #b91c1c;
}


/* Saludable - Verde */

.pr-badge-saludable {
    background: #d1fae5;
    color: #047857;
}

.producto-recomendado-contenido {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.producto-recomendado-titulo-link {
    text-decoration: none;
}

.producto-recomendado-titulo-link:hover .producto-recomendado-titulo {
    color: #680809;
}

.producto-recomendado-titulo {
    font-family: 'Gentium Book Basic', serif;
    font-weight: 700;
    font-size: 18px;
    line-height: 22.5px;
    color: #0a0a0a;
    margin: 0;
    transition: color 0.2s;
}

.producto-recomendado-descripcion {
    font-family: 'Poppins', sans-serif;
    font-weight: 400;
    font-size: 12px;
    line-height: 16px;
    color: #6a7282;
    margin: 0;
}

.producto-recomendado-acciones {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 48px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.producto-recomendado-cantidad-precio {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.producto-recomendado-cantidad {
    display: flex;
    align-items: center;
    border: 1px solid #d1d5dc;
    border-radius: 10px;
    overflow: hidden;
    height: 40px;
    flex-shrink: 0;
}

.producto-recomendado-cantidad .cantidad-btn {
    width: 32px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #0a0a0a !important;
    transition: background 0.2s;
    flex-shrink: 0;
    padding: 0px !important;
}

.producto-recomendado-cantidad .cantidad-btn svg {
    width: 16px;
    height: 16px;
    color: #0a0a0a !important;
}

.producto-recomendado-cantidad .cantidad-btn svg path {
    stroke: #0a0a0a !important;
}

.producto-recomendado-cantidad .cantidad-btn:hover {
    background: #f3f4f6;
}

.producto-recomendado-cantidad .cantidad-input {
    width: auto;
    min-width: 48px;
    max-width: 60px;
    height: 100%;
    text-align: center;
    border: none;
    border-left: 1px solid #d1d5dc;
    border-right: 1px solid #d1d5dc;
    font-family: 'Poppins', sans-serif;
    font-weight: 400;
    font-size: 14px;
    line-height: 20px;
    color: #0a0a0a;
    -moz-appearance: textfield;
    flex-shrink: 0;
}

.producto-recomendado-cantidad .cantidad-input::-webkit-outer-spin-button,
.producto-recomendado-cantidad .cantidad-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.producto-recomendado-cantidad .cantidad-input:focus {
    outline: none;
}

.producto-recomendado-precio {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 20px;
    line-height: 28px;
    color: #fecc32;
    white-space: nowrap;
    flex-shrink: 0;
}

.producto-recomendado-añadir {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #680809;
    color: #f7f7f7;
    border: none;
    border-radius: 100px;
    padding: 0 20px;
    height: 40px;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    font-size: 12px;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    transition: background 0.2s;
    white-space: nowrap;
    flex: 1;
    max-width: 300px;
}

.producto-recomendado-añadir:hover {
    background: #7a1011;
}

.producto-recomendado-añadir.loading {
    opacity: 0.7;
    pointer-events: none;
}

.producto-recomendado-añadir svg {
    width: 16px;
    height: 16px;
}


/*===================================FLOATING NOTICES====================================*/


/* --- Floating Notices (PR + TTPI) --- */

.pr-floating-notice,
.ttpi-floating-notice {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 99999;
    transform: translateY(-100%);
    transition: transform 0.3s ease-in-out;
}

.pr-floating-notice.show,
.ttpi-floating-notice.show {
    transform: translateY(0);
}

.pr-floating-notice .woocommerce-message,
.ttpi-floating-notice .woocommerce-message {
    margin: 0;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 15px 20px;
    background-color: #fff;
    color: #680809;
    font-size: 14px;
    border-bottom: 2px solid #680809;
    border-top-color: #680809;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.pr-floating-notice .woocommerce-message::before,
.ttpi-floating-notice .woocommerce-message::before {
    display: none;
}

.pr-floating-notice .woocommerce-message a.button,
.ttpi-floating-notice .woocommerce-message a.button {
    background-color: #680809;
    border: 1px solid #680809;
    color: #fff !important;
    padding: 8px 20px;
    border-radius: 100px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
    margin-left: auto;
}

.pr-floating-notice .woocommerce-message a.button:hover,
.ttpi-floating-notice .woocommerce-message a.button:hover {
    background-color: #fff;
    color: #680809 !important;
    border: 2px solid #680809;
}


/* Close button - color diferente por variante */

.pr-floating-notice .pr-close-notice,
.ttpi-floating-notice .ttpi-close-notice {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    margin-left: 10px;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.pr-floating-notice .pr-close-notice:hover,
.ttpi-floating-notice .ttpi-close-notice:hover {
    opacity: 1;
}

.pr-floating-notice .pr-close-notice {
    color: #680809;
}

.ttpi-floating-notice .ttpi-close-notice {
    color: #fff;
}


/*===================================RESPONSIVE====================================*/

@media (max-width: 768px) {
    /* Badges */
    .monpizza-badge {
        font-size: 14px;
        padding: 5px 12px;
        line-height: 20px;
    }
    .monpizza-badges {
        top: 8px;
        left: 8px;
    }
    .monpizza-badges-single {
        top: 12px;
        left: 12px;
    }
    .ttpi-imagen .monpizza-badge {
        font-size: 12px;
        padding: 4px 10px;
        top: 6px;
        left: 6px;
    }
}

@media (max-width: 600px) {
    /* Producto Recomendado */
    .producto-recomendado-card {
        padding: 8px;
        gap: 8px;
        box-shadow: 0px 1px 3px 0px rgba(0, 0, 0, 0.1), 0px 1px 2px -1px rgba(0, 0, 0, 0.1);
    }
    .producto-recomendado-imagen {
        width: 80px;
        height: 80px;
    }
    .pr-badge-circle {
        width: 24px;
        height: 24px;
        top: 4px;
        left: 4px;
    }
    .pr-badge-circle svg {
        width: 12px;
        height: 12px;
    }
    .producto-recomendado-titulo {
        font-size: 16px;
        line-height: 17.5px;
    }
    .producto-recomendado-descripcion {
        font-size: 10px;
        line-height: 15px;
    }
    .producto-recomendado-acciones {
        gap: 8px;
        margin-top: 4px;
    }
    .producto-recomendado-cantidad-precio {
        gap: 8px;
    }
    .producto-recomendado-cantidad {
        height: 36px;
    }
    .producto-recomendado-cantidad .cantidad-btn {
        width: 24px;
    }
    .producto-recomendado-cantidad .cantidad-btn svg {
        width: 12px;
        height: 12px;
    }
    .producto-recomendado-cantidad .cantidad-input {
        min-width: 40px;
        max-width: 48px;
        font-size: 12px;
        line-height: 16px;
    }
    .producto-recomendado-precio {
        font-size: 16px;
        line-height: 24px;
    }
    .producto-recomendado-añadir {
        width: auto;
        height: 38px;
        min-width: 38px;
        padding: 0px 32px;
        flex: none;
    }
    .producto-recomendado-añadir span {
        display: none;
    }
    .producto-recomendado-añadir svg {
        margin: 0;
    }
    /* Icon List */
    #icon-list .elementor-icon-list-items {
        gap: 12px;
    }
    /* Quitamiedos */
    #quitamiedos .elementor-icon-list-items {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    /* Badges */
    .monpizza-badge {
        font-size: 12px;
        padding: 4px 10px;
        line-height: 18px;
    }
    /* Add to Cart */
    #add-to-cart.dynamic-price .price {
        bottom: 0px !important;
        right: 0 !important;
        width: fit-content !important;
    }
}

@media screen and (min-width: 991px) {
    /* Add to Cart */
    #add-to-cart.dynamic-price .price {
        position: absolute;
        left: 120px;
        top: 16px;
        width: fit-content;
        min-width: 250px;
    }
}


/* Shortcode añadir_al_carrito en contexto loop (home, distribuidora, archivo) */

.monpizza-add-to-cart[data-context="loop"] {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    max-width: 100%;
    min-width: 0;
}

.monpizza-add-to-cart[data-context="loop"] .monpizza-atc-cantidad {
    flex-shrink: 0;
}

.monpizza-add-to-cart[data-context="loop"] .monpizza-atc-submit {
    border-radius: 100px;
    flex: 1;
    width: auto;
    min-width: 0;
    overflow: hidden;
}

.monpizza-add-to-cart[data-context="loop"] .monpizza-atc-submit span {
    overflow: hidden;
    text-overflow: ellipsis;
}

:is(.elementor-shortcode, .elementor-widget-container):has(.monpizza-add-to-cart[data-context="loop"]) {
    min-width: 0;
    max-width: 100%;
}


/* Shortcode añadir_al_carrito en contexto loop - Mobile */

@media (max-width: 768px) {
    .monpizza-add-to-cart[data-context="loop"] .monpizza-atc-cantidad {
        height: 40px;
        flex-shrink: 0;
    }
    .monpizza-add-to-cart[data-context="loop"] .monpizza-atc-btn {
        width: 32px;
    }
    .monpizza-add-to-cart[data-context="loop"] .monpizza-atc-input {
        width: 32px;
        font-size: 14px;
    }
    .monpizza-add-to-cart[data-context="loop"] .monpizza-atc-submit {
        height: 40px;
        padding: 0 16px;
        font-size: 0;
        gap: 0;
        min-width: 40px;
    }
    .monpizza-add-to-cart[data-context="loop"] .monpizza-atc-submit span {
        display: none;
    }
    .monpizza-add-to-cart[data-context="loop"] .monpizza-atc-submit svg {
        width: 18px;
        height: 18px;
    }
}