/*
Theme Name: GoGreen Child
Description: Child theme of GoGreen child theme.
Author: Wyde
Template: gogreen
Version: 1.6
*/

/* =============================================
   OCULTAR BANNERS NATIVOS
   ============================================= */

.woocommerce-cart .woocommerce-info,
.woocommerce-cart .woocommerce-message,
.woocommerce-cart #yith-par-message-cart,
.woocommerce-cart #yith-par-message-reward-cart {
    display: none !important;
}

/* =============================================
   BANNER COMPACTO
   ============================================= */

.lorente-cart-notices {
    background: #f8fdf5;
    border: 1px solid #c8e6a0;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
}

.lorente-notice-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 6px 0;
    border-bottom: 1px solid #e4f5cc;
    line-height: 1.4;
}

.lorente-notice-item:first-child { padding-top: 0; }
.lorente-notice-item:last-child { border-bottom: none; padding-bottom: 0; }
.lorente-notice-icon { font-size: 16px; flex-shrink: 0; margin-top: 2px; }
.lorente-notice-text { font-size: 14px; color: #444; flex: 1; }
.lorente-notice-text strong { color: #2e6b1e; }

/* =============================================
   DESKTOP - 2 COLUMNAS CON MARGEN
   Solución sin mover DOM:
   - form ocupa todo el ancho pero tiene padding-right
   - cart-collaterals se posiciona absolute a la derecha
   ============================================= */

@media (min-width: 783px) {

    /* Contenedor relativo para el posicionamiento */
    .woocommerce-cart .woocommerce {
        position: relative !important;
    }

    /* Banner solo columna izquierda */
    .woocommerce-cart .woocommerce > .lorente-cart-notices {
        width: calc(100% - 352px) !important;
        box-sizing: border-box !important;
    }

    /* Form con margen derecho para la columna sticky */
    .woocommerce-cart form.woocommerce-cart-form {
        margin-right: 352px !important;
    }

    /* Cart collaterals - posición absoluta columna derecha */
    .woocommerce-cart .cart-collaterals {
        position: absolute !important;
        top: 0 !important;
        right: 0 !important;
        width: 320px !important;
    }

    /* Totales caja */
    .woocommerce-cart .cart_totals {
        background: #fff !important;
        border: 1px solid #e5e5e5 !important;
        border-radius: 10px !important;
        padding: 20px !important;
        position: sticky !important;
        top: 80px !important;
    }

    .woocommerce-cart .cart_totals h2 {
        font-size: 15px !important;
        font-weight: 600 !important;
        margin-bottom: 14px !important;
        padding-bottom: 10px !important;
        border-bottom: 1px solid #f0f0f0 !important;
    }

    .woocommerce-cart .cart_totals .shop_table tr th,
    .woocommerce-cart .cart_totals .shop_table tr td {
        padding: 7px 0 !important;
        font-size: 14px !important;
        border: none !important;
        border-bottom: 1px solid #f5f5f5 !important;
    }

    .woocommerce-cart .cart_totals .order-total th,
    .woocommerce-cart .cart_totals .order-total td {
        font-size: 18px !important;
        font-weight: 600 !important;
        padding-top: 12px !important;
        border-bottom: none !important;
    }

    .woocommerce-cart .cart_totals .order-total .amount { color: #61a44a !important; }
    .woocommerce-cart .cart_totals .includes_tax { font-size: 12px !important; color: #999 !important; display: block !important; }
    .woocommerce-cart .woocommerce-shipping-destination { font-size: 13px !important; color: #666 !important; }
    .woocommerce-cart .shipping-calculator-button { font-size: 13px !important; }

    /* Ocultar coupon nativo en desktop */
    .woocommerce-cart .cart-coupon { display: none !important; }

    /* CTA desktop */
    .woocommerce-cart .wc-proceed-to-checkout a.checkout-button {
        display: block !important;
        width: 100% !important;
        padding: 15px !important;
        font-size: 16px !important;
        font-weight: 600 !important;
        text-align: center !important;
        border-radius: 8px !important;
        background-color: #61a44a !important;
        color: #fff !important;
        box-sizing: border-box !important;
        margin-top: 12px !important;
    }

    .woocommerce-cart .wc-proceed-to-checkout a.checkout-button:hover {
        background-color: #4d8c38 !important;
        color: #fff !important;
    }

    /* Sellos y métodos de pago */
    .woocommerce-cart ul.PaymentVendors_container__IXXOJ {
        justify-content: center !important;
        margin: 12px 0 6px !important;
        flex-wrap: wrap !important;
    }

    .woocommerce-cart .container-dev { font-size: 12px !important; color: #999 !important; }
    .woocommerce-cart .container-dev li { list-style: none !important; padding-left: 16px !important; position: relative !important; }
    .woocommerce-cart .container-dev li:before { content: "✓" !important; color: #61a44a !important; position: absolute !important; left: 0 !important; }

    /* Ocultar actualizar carrito */
    .woocommerce-cart button[name="update_cart"] { display: none !important; }

    /* Carrusel desktop 4 cols - ancho completo */
    .lorente-related-cart {
        margin-top: 24px !important;
        padding-top: 20px !important;
        border-top: 1px solid #f0f0f0 !important;
        margin-right: 0 !important;
    }

    .lorente-related-products {
        display: grid !important;
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 16px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .lorente-related-products .lorente-related-item {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
    }
}

/* =============================================
   MOBILE
   ============================================= */

@media (max-width: 782px) {

    .woocommerce-cart .shop_table.cart { border: none !important; margin-bottom: 0 !important; }
    .woocommerce-cart .shop_table thead { display: none !important; }

    /* Fila producto - flex wrap: nombre fila 1, cantidad+precio+x fila 2 */
    .woocommerce-cart tr.woocommerce-cart-form__cart-item {
        display: flex !important;
        flex-wrap: wrap !important;
        align-items: center !important;
        gap: 0 !important;
        padding: 14px 0 !important;
        border-bottom: 1px solid #eee !important;
        position: relative !important;
    }

    /* td.product-name: ocupa toda la fila 1 */
    .woocommerce-cart td.product-name {
        display: flex !important;
        flex-direction: row !important;
        align-items: flex-start !important;
        gap: 10px !important;
        flex: 0 0 100% !important;
        padding: 0 0 10px !important;
        border: none !important;
        min-width: 0 !important;
    }

    /* Imagen visible */
    .woocommerce-cart td.product-name .product-thumbnail {
        display: block !important;
        flex-shrink: 0 !important;
        width: 62px !important;
        height: 62px !important;
    }

    .woocommerce-cart td.product-name .product-thumbnail img {
        width: 62px !important;
        height: 62px !important;
        object-fit: cover !important;
        border-radius: 6px !important;
        display: block !important;
    }

    /* Nombre y variación */
    .woocommerce-cart td.product-name .product-info {
        flex: 1 !important;
        min-width: 0 !important;
    }

    .woocommerce-cart td.product-name .product-info a {
        font-size: 14px !important;
        font-weight: 500 !important;
        line-height: 1.3 !important;
        display: block !important;
        color: #333 !important;
    }

    .woocommerce-cart td.product-name .variation,
    .woocommerce-cart td.product-name dl.variation {
        font-size: 12px !important;
        color: #888 !important;
        margin: 3px 0 0 !important;
        display: block !important;
        clear: both !important;
        width: 100% !important;
    }

    /* Ocultar precio unitario y headers */
    .woocommerce-cart td.product-price,
    .woocommerce-cart th.product-price,
    .woocommerce-cart th.product-quantity,
    .woocommerce-cart th.product-subtotal,
    .woocommerce-cart th.product-remove {
        display: none !important;
    }

    /* Cantidad - fila 2 izquierda */
    .woocommerce-cart td.product-quantity {
        flex: 1 !important;
        border: none !important;
        padding: 0 !important;
        display: flex !important;
        align-items: center !important;
    }

    .woocommerce-cart .quantity input.qty {
        width: 50px !important;
        height: 36px !important;
        text-align: center !important;
        font-size: 15px !important;
        border: 1px solid #61a44a !important;
        border-radius: 4px !important;
    }

    /* Subtotal - fila 2 derecha */
    .woocommerce-cart td.product-subtotal {
        flex-shrink: 0 !important;
        border: none !important;
        padding: 0 6px !important;
        font-size: 15px !important;
        font-weight: 600 !important;
        color: #333 !important;
        text-align: right !important;
        white-space: nowrap !important;
    }

    /* Eliminar - fila 2 */
    .woocommerce-cart td.product-remove {
        flex-shrink: 0 !important;
        border: none !important;
        padding: 0 !important;
        position: static !important;
        align-self: center !important;
    }

    .woocommerce-cart td.product-remove a.remove { font-size: 18px !important; color: #ccc !important; }
    .woocommerce-cart button[name="update_cart"] { display: none !important; }

    /* Cupón oculto */
    .woocommerce-cart .cart-coupon { display: none !important; }

    /* Totales */
    .woocommerce-cart .cart_totals {
        background: #fff !important;
        border: 1px solid #eee !important;
        border-radius: 10px !important;
        padding: 16px !important;
        margin-top: 16px !important;
    }

    .woocommerce-cart .cart_totals h2 { font-size: 17px !important; font-weight: 600 !important; margin-bottom: 12px !important; padding-bottom: 10px !important; border-bottom: 1px solid #eee !important; }
    .woocommerce-cart .cart_totals .shop_table tr th,
    .woocommerce-cart .cart_totals .shop_table tr td { padding: 8px 0 !important; font-size: 15px !important; border: none !important; border-bottom: 1px solid #f5f5f5 !important; }
    .woocommerce-cart .cart_totals .order-total th,
    .woocommerce-cart .cart_totals .order-total td { font-size: 20px !important; font-weight: 700 !important; padding-top: 12px !important; border-bottom: none !important; }
    .woocommerce-cart .cart_totals .order-total .amount { color: #61a44a !important; }
    .woocommerce-cart .cart_totals .includes_tax { font-size: 13px !important; color: #999 !important; display: block !important; }
    .woocommerce-cart .woocommerce-shipping-destination { font-size: 14px !important; color: #666 !important; }
    .woocommerce-cart .shipping-calculator-button { font-size: 14px !important; }

    /* CTA mobile */
    .woocommerce-cart .wc-proceed-to-checkout a.checkout-button {
        display: block !important;
        width: 100% !important;
        padding: 18px !important;
        font-size: 18px !important;
        font-weight: 700 !important;
        text-align: center !important;
        border-radius: 10px !important;
        background-color: #61a44a !important;
        color: #fff !important;
        box-sizing: border-box !important;
    }

    .woocommerce-cart .wc-proceed-to-checkout a.checkout-button:hover { background-color: #4d8c38 !important; }

    /* Sellos */
    .woocommerce-cart ul.PaymentVendors_container__IXXOJ { justify-content: center !important; margin: 12px 0 6px !important; flex-wrap: wrap !important; }
    .woocommerce-cart .container-dev { font-size: 14px !important; color: #777 !important; flex-direction: column !important; gap: 4px !important; margin-bottom: 8px !important; }
    .woocommerce-cart .container-dev li { list-style: none !important; padding-left: 18px !important; position: relative !important; }
    .woocommerce-cart .container-dev li:before { content: "✓" !important; color: #61a44a !important; position: absolute !important; left: 0 !important; }

    /* Carrusel mobile */
    .lorente-related-cart { margin-top: 24px !important; padding-top: 16px !important; border-top: 1px solid #f0f0f0 !important; margin-bottom: 0 !important; }

    .lorente-related-products {
        display: flex !important;
        overflow-x: auto !important;
        scroll-snap-type: x mandatory !important;
        gap: 12px !important;
        padding-bottom: 4px !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important;
    }

    .lorente-related-products::-webkit-scrollbar { display: none !important; }
    .lorente-related-products .lorente-related-item { min-width: 155px !important; max-width: 155px !important; scroll-snap-align: start !important; flex-shrink: 0 !important; }
}

/* =============================================
   CUPÓN TOGGLE
   ============================================= */

.lorente-coupon-toggle { margin: 10px 0 14px !important; }

.lorente-coupon-link {
    font-size: 14px !important; color: #999 !important; cursor: pointer !important;
    text-decoration: underline !important; text-underline-offset: 2px !important;
    background: none !important; border: none !important; padding: 0 !important; display: inline-block !important;
}

.lorente-coupon-link:hover { color: #61a44a !important; }
.lorente-coupon-form { display: none !important; margin-top: 8px !important; }
.lorente-coupon-form.active { display: flex !important; gap: 8px !important; align-items: center !important; }

.lorente-coupon-form input[type="text"] {
    flex: 1 !important; height: 38px !important; padding: 0 12px !important;
    font-size: 14px !important; border: 1px solid #ddd !important; border-radius: 6px !important; box-sizing: border-box !important;
}

.lorente-coupon-form button {
    height: 38px !important; padding: 0 16px !important; font-size: 14px !important;
    background: #61a44a !important; color: #fff !important; border: none !important;
    border-radius: 6px !important; cursor: pointer !important; white-space: nowrap !important;
}

/* =============================================
   CARRUSEL RELACIONADOS
   ============================================= */

.lorente-related-cart h3 {
    font-size: 17px !important; font-weight: 500 !important; margin-bottom: 16px !important;
    color: #333 !important; font-family: "Roboto Condensed", Arial, Helvetica, sans-serif !important;
}

.lorente-related-item { background: #fff !important; border: 1px solid #eee !important; border-radius: 8px !important; overflow: hidden !important; }
.lorente-related-item:hover { border-color: #61a44a !important; }
.lorente-related-item a.lorente-related-img { display: block !important; aspect-ratio: 1 !important; overflow: hidden !important; }
.lorente-related-item a.lorente-related-img img { width: 100% !important; height: 100% !important; object-fit: cover !important; display: block !important; }
.lorente-related-item .lorente-related-info { padding: 10px !important; }
.lorente-related-item .lorente-related-name { font-size: 13px !important; font-weight: 500 !important; color: #333 !important; line-height: 1.3 !important; margin-bottom: 5px !important; display: -webkit-box !important; -webkit-line-clamp: 2 !important; -webkit-box-orient: vertical !important; overflow: hidden !important; }
.lorente-related-item .lorente-related-price { font-size: 13px !important; color: #555 !important; margin-bottom: 8px !important; }

/* Botón outline - no compite con CTA principal */
.lorente-related-item .lorente-related-btn {
    display: block !important; width: 100% !important; padding: 7px 0 !important;
    font-size: 12px !important; text-align: center !important;
    background: #fff !important; color: #61a44a !important; border: 1px solid #61a44a !important;
    border-radius: 5px !important; text-decoration: none !important; box-sizing: border-box !important;
}

.lorente-related-item .lorente-related-btn:hover { background: #61a44a !important; color: #fff !important; }

/* =============================================
   PROGRESO MOBILE
   ============================================= */

@media (max-width: 782px) {
    .lorente-cart-steps { display: flex !important; padding: 10px 0 8px !important; margin-bottom: 12px !important; }
    .lorente-cart-steps .step { flex: 1 !important; text-align: center !important; font-size: 13px !important; color: #bbb !important; padding-bottom: 8px !important; }
    .lorente-cart-steps .step.active { color: #61a44a !important; font-weight: 600 !important; border-bottom: 2px solid #61a44a !important; }
    .lorente-cart-steps .step.done { color: #888 !important; border-bottom: 2px solid #9FE1CB !important; }
    .lorente-cart-steps .step.pending { border-bottom: 2px solid #eee !important; }
}

@media (min-width: 783px) { .lorente-cart-steps { display: none !important; } }