/* ==========================================================================
   HUG - PREMIUM WOOCOMMERCE CART REDESIGN
   Selectores ultra-específicos para Kadence theme
   ========================================================================== */

/* -----------------------------------------------------------------------
   1. FORZAR ANCHO DE CONTENEDORES KADENCE
   La cadena DOM real es:
   body > #wrapper > #inner-wrap > #primary > .content-container.site-container
   > #main > .content-wrap > article > .entry-content-wrap > .entry-content > .woocommerce
   ----------------------------------------------------------------------- */

/* Fondo oscuro para la página del carrito */
body.woocommerce-cart {
    background-color: #050806 !important;
    color: #e2e8f0 !important;
}

body.woocommerce-cart #masthead {
    background: rgba(5,8,6,0.95) !important;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

/* Expandir todos los contenedores de Kadence */
body.woocommerce-cart .content-container.site-container {
    max-width: 1280px !important;
    width: 100% !important;
    margin: 0 auto !important;
    padding: 0 1.5rem !important;
}

body.woocommerce-cart #main.site-main {
    max-width: 100% !important;
    width: 100% !important;
}

body.woocommerce-cart .content-wrap {
    max-width: 100% !important;
    width: 100% !important;
}

body.woocommerce-cart article.entry {
    max-width: 100% !important;
    width: 100% !important;
    box-shadow: none !important;
    background: transparent !important;
}

body.woocommerce-cart .entry-content-wrap {
    max-width: 100% !important;
    width: 100% !important;
    padding: 2rem 0 !important;
    background: transparent !important;
}

body.woocommerce-cart .entry-content.single-content {
    max-width: 100% !important;
    width: 100% !important;
}

/* Quitar estilos boxed de Kadence */
body.woocommerce-cart.content-style-boxed .entry-content-wrap {
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
}

body.woocommerce-cart.content-style-boxed .content-bg {
    background: transparent !important;
}

/* -----------------------------------------------------------------------
   2. BARRA DE GAMIFICACIÓN (Envío gratis)
   ----------------------------------------------------------------------- */
.hug-cart-gamification-wrap {
    background: rgba(20, 28, 36, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    text-align: center;
}

.hug-free-shipping-success {
    color: #10b981;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.hug-free-shipping-success svg {
    width: 28px;
    height: 28px;
}

.hug-free-shipping-progress {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.hug-fs-text {
    color: #fff;
    font-size: 1.1rem;
}

.hug-fs-text strong {
    color: #10b981;
}

.hug-fs-bar-bg {
    background: rgba(0, 0, 0, 0.4);
    height: 12px;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.5);
}

.hug-fs-bar-fill {
    background: linear-gradient(90deg, #059669, #10b981);
    height: 100%;
    border-radius: 20px;
    transition: width 0.5s ease-out;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

/* -----------------------------------------------------------------------
   3. LAYOUT PRINCIPAL DEL CARRITO (2 columnas con Flexbox)
   ----------------------------------------------------------------------- */
body.woocommerce-cart .entry-content .woocommerce {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 2.5rem !important;
    align-items: flex-start !important;
}

/* -----------------------------------------------------------------------
   4. COLUMNA IZQUIERDA – Tabla del carrito
   ----------------------------------------------------------------------- */
body.woocommerce-cart .entry-content .woocommerce > .woocommerce-notices-wrapper {
    flex: 0 0 100%;
    width: 100%;
}

body.woocommerce-cart .entry-content .woocommerce > .woocommerce-cart-form {
    flex: 1 1 0;
    min-width: 0;
    background: rgba(20, 28, 36, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 24px;
    padding: 2rem;
    overflow-x: auto;
}

/* Tabla */
body.woocommerce-cart .woocommerce table.shop_table {
    border: none !important;
    border-radius: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    border-collapse: collapse !important;
}

body.woocommerce-cart .woocommerce table.shop_table thead th {
    background: transparent !important;
    color: #94a3b8 !important;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    border: none !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    padding: 0.75rem 0.5rem 1rem !important;
}

body.woocommerce-cart .woocommerce table.shop_table tbody td {
    border: none !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
    padding: 1.25rem 0.5rem !important;
    vertical-align: middle !important;
    color: #e2e8f0 !important;
}

body.woocommerce-cart .woocommerce table.shop_table tbody tr:last-child td {
    border-bottom: none !important;
}

/* Imagen del producto */
body.woocommerce-cart table.shop_table td.product-thumbnail img {
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    padding: 5px;
    width: 80px;
    height: auto;
}

/* Nombre del producto */
body.woocommerce-cart table.shop_table td.product-name a {
    color: #fff !important;
    font-weight: 700;
    font-size: 1.05rem;
    text-decoration: none;
    transition: color 0.2s;
}

body.woocommerce-cart table.shop_table td.product-name a:hover {
    color: #10b981 !important;
}

/* Precio y subtotal */
body.woocommerce-cart table.shop_table td.product-price,
body.woocommerce-cart table.shop_table td.product-subtotal {
    color: #fff !important;
    font-weight: 600;
}

/* Cantidad */
body.woocommerce-cart table.shop_table .quantity input.qty {
    background: rgba(0, 0, 0, 0.3) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #fff !important;
    border-radius: 8px;
    padding: 8px;
    width: 60px;
    text-align: center;
}

/* Botón eliminar */
body.woocommerce-cart table.shop_table a.remove {
    color: #ef4444 !important;
    background: rgba(239, 68, 68, 0.1) !important;
    border-radius: 50% !important;
    width: 30px !important;
    height: 30px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s;
    font-size: 1.3rem !important;
    line-height: 1 !important;
}

body.woocommerce-cart table.shop_table a.remove:hover {
    background: #ef4444 !important;
    color: #fff !important;
}

/* Fila de acciones (cupón + actualizar) */
body.woocommerce-cart table.shop_table td.actions {
    padding-top: 2rem !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 1.5rem;
}

body.woocommerce-cart .coupon {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

body.woocommerce-cart .coupon input.input-text {
    background: rgba(0,0,0,0.3) !important;
    border: 1px solid rgba(255,255,255,0.1) !important;
    color: #fff !important;
    padding: 1.2rem 1.5rem !important;
    border-radius: 12px !important;
    min-width: 200px;
}

body.woocommerce-cart .coupon button.button,
body.woocommerce-cart button[name="update_cart"] {
    background: linear-gradient(145deg, rgba(30,41,59,0.6), rgba(15,23,42,0.9)) !important;
    color: #fff !important;
    border: 1px solid rgba(16, 185, 129, 0.25) !important;
    padding: 1.2rem 2.5rem !important;
    border-radius: 12px !important;
    font-weight: 700 !important;
    font-size: 0.95rem !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    white-space: nowrap !important;
    width: auto !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    height: auto !important;
    line-height: 1 !important;
    min-height: 0 !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2) !important;
    backdrop-filter: blur(8px);
}

body.woocommerce-cart .coupon button.button:hover,
body.woocommerce-cart button[name="update_cart"]:hover {
    background: linear-gradient(145deg, rgba(30,41,59,0.9), rgba(15,23,42,1)) !important;
    border-color: rgba(16, 185, 129, 0.7) !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.2) !important;
}

/* -----------------------------------------------------------------------
   10. SUGERENCIAS DE COMPRA (Cross-Sells integrados)
   ----------------------------------------------------------------------- */
.hug-cart-suggestions-inline {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px dashed rgba(255,255,255,0.1);
    width: 100%;
}

.hug-cart-suggestions-title {
    color: #fff;
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 1.2rem;
}

.hug-cart-suggestions-grid {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: stretch;
    gap: 1.2rem;
}

.hug-cart-suggestion-card {
    display: flex;
    flex-direction: column;
    flex: 1 1 0; /* Fuerza a que midan lo mismo en horizontal */
    min-width: 0;
    background: linear-gradient(145deg, rgba(20,28,36,0.5), rgba(11,17,22,0.8));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 12px;
    padding: 0.8rem;
    text-decoration: none !important;
    transition: all 0.3s ease;
}

.hug-cart-suggestion-card:hover {
    background: linear-gradient(145deg, rgba(20,28,36,0.8), rgba(11,17,22,0.9));
    border-color: rgba(16, 185, 129, 0.3);
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.hcsc-img {
    width: 100%;
    height: 80px; /* Imagen más pequeña */
    background: rgba(255,255,255,0.02);
    border-radius: 8px;
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hcsc-img img {
    max-width: 85%;
    max-height: 85%;
    object-fit: contain;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.4));
    transition: transform 0.3s ease;
}

.hug-cart-suggestion-card:hover .hcsc-img img {
    transform: scale(1.05);
}

.hcsc-info {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.hcsc-title {
    color: #e2e8f0;
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s;
}

.hug-cart-suggestion-card:hover .hcsc-title {
    color: #10b981;
}

.hcsc-price {
    color: #10b981;
    font-size: 1rem;
    font-weight: 800;
    margin-top: auto;
}

.hcsc-price del {
    color: #64748b;
    font-size: 0.8rem;
    margin-right: 6px;
    font-weight: 400;
}

.hcsc-price ins {
    background: transparent;
    text-decoration: none;
}

@media (max-width: 768px) {
    .hug-cart-suggestions-grid {
        flex-wrap: wrap !important;
    }
    .hug-cart-suggestion-card {
        flex: 1 1 calc(50% - 0.6rem);
    }
}

@media (max-width: 480px) {
    .hug-cart-suggestion-card {
        flex: 1 1 100%;
    }
}

/* -----------------------------------------------------------------------
   5. COLUMNA DERECHA – Totales del carrito
   ----------------------------------------------------------------------- */
body.woocommerce-cart .entry-content .woocommerce > .cart-collaterals {
    flex: 0 0 380px !important;
    width: 380px !important;
    max-width: 100% !important;
    min-width: 0;
}

body.woocommerce-cart .cart-collaterals .cart_totals {
    background: linear-gradient(145deg, rgba(20,28,36,0.85), rgba(11,17,22,0.95)) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(16, 185, 129, 0.15) !important;
    border-radius: 24px !important;
    padding: 2.5rem !important;
    box-shadow: 0 15px 35px rgba(0,0,0,0.3);
    width: 100% !important;
    float: none !important;
    position: sticky;
    top: 100px;
}

body.woocommerce-cart .cart_totals h2 {
    color: #fff !important;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 1rem;
}

body.woocommerce-cart .cart_totals table {
    width: 100% !important;
    border: none !important;
    margin-bottom: 2rem !important;
    border-collapse: collapse !important;
}

body.woocommerce-cart .cart_totals table th {
    color: #94a3b8 !important;
    font-weight: 500;
    border: none !important;
    padding: 15px 0 !important;
    text-align: left !important;
    background: transparent !important;
}

body.woocommerce-cart .cart_totals table td {
    color: #fff !important;
    text-align: right !important;
    border: none !important;
    padding: 15px 0 !important;
    background: transparent !important;
}

body.woocommerce-cart .cart_totals table tr.order-total th,
body.woocommerce-cart .cart_totals table tr.order-total td {
    border-top: 1px solid rgba(255,255,255,0.1) !important;
    padding-top: 1.5rem !important;
}

body.woocommerce-cart .cart_totals table tr.order-total td strong {
    color: #10b981 !important;
    font-size: 1.8rem;
    font-weight: 800;
}

/* Precio del envío y otros textos dentro de totales */
body.woocommerce-cart .cart_totals .woocommerce-shipping-methods {
    list-style: none;
    padding: 0;
    margin: 0;
}

body.woocommerce-cart .cart_totals .woocommerce-shipping-methods li {
    color: #e2e8f0;
    padding: 4px 0;
}

body.woocommerce-cart .cart_totals .woocommerce-shipping-methods label {
    color: #e2e8f0;
}

body.woocommerce-cart .cart_totals .woocommerce-shipping-destination {
    color: #94a3b8;
    font-size: 0.9rem;
}

body.woocommerce-cart .cart_totals a {
    color: #10b981;
}

/* -----------------------------------------------------------------------
   6. BOTÓN DE CHECKOUT
   ----------------------------------------------------------------------- */
body.woocommerce-cart .wc-proceed-to-checkout {
    padding: 0 !important;
    margin-top: 0.5rem;
}

body.woocommerce-cart .wc-proceed-to-checkout a.checkout-button {
    display: block !important;
    width: 100% !important;
    text-align: center !important;
    background: #10b981 !important;
    color: #050806 !important;
    font-size: 1.15rem !important;
    font-weight: 800 !important;
    padding: 1.2rem !important;
    border-radius: 12px !important;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all 0.3s;
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.3);
    border: none !important;
    text-decoration: none !important;
}

body.woocommerce-cart .wc-proceed-to-checkout a.checkout-button:hover {
    background: #fff !important;
    color: #050806 !important;
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(255, 255, 255, 0.2);
}

/* -----------------------------------------------------------------------
   7. TRUST BADGES
   ----------------------------------------------------------------------- */
.hug-cart-trust-badges {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.05);
    padding-top: 1.5rem;
}

.hug-trust-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #94a3b8;
    font-size: 0.95rem;
}

.hug-trust-badge svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: #10b981;
}

/* -----------------------------------------------------------------------
   8. CARRITO VACÍO
   ----------------------------------------------------------------------- */
body.woocommerce-cart .wc-empty-cart-message .cart-empty {
    background: rgba(20, 28, 36, 0.4) !important;
    color: #e2e8f0 !important;
    border: 1px solid rgba(255,255,255,0.08) !important;
    border-radius: 16px;
    padding: 3rem;
    text-align: center;
    font-size: 1.2rem;
}

body.woocommerce-cart .wc-empty-cart-message .cart-empty::before {
    color: #10b981 !important;
}

body.woocommerce-cart .return-to-shop a.button {
    background: #10b981 !important;
    color: #050806 !important;
    font-weight: 800;
    padding: 1rem 2.5rem !important;
    border-radius: 12px !important;
    border: none !important;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all 0.3s;
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.3);
}

body.woocommerce-cart .return-to-shop a.button:hover {
    background: #fff !important;
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(255, 255, 255, 0.2);
}

/* -----------------------------------------------------------------------
   9. RESPONSIVE
   ----------------------------------------------------------------------- */
@media (max-width: 992px) {
    body.woocommerce-cart .entry-content .woocommerce > .cart-collaterals {
        flex: 0 0 100% !important;
        width: 100% !important;
    }

    body.woocommerce-cart .cart-collaterals .cart_totals {
        position: static;
    }
}

@media (max-width: 768px) {
    body.woocommerce-cart .content-container.site-container {
        padding: 0 1rem !important;
    }

    body.woocommerce-cart .entry-content .woocommerce > .woocommerce-cart-form {
        padding: 1.25rem;
        border-radius: 16px;
    }

    body.woocommerce-cart table.shop_table td.actions {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 1rem;
    }

    body.woocommerce-cart .coupon {
        display: flex;
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }

    body.woocommerce-cart .coupon input.input-text {
        width: 100% !important;
        margin: 0 !important;
    }

    body.woocommerce-cart .cart_totals .cart_totals {
        padding: 1.5rem !important;
        border-radius: 16px !important;
    }
}

@media (max-width: 480px) {
    body.woocommerce-cart .woocommerce table.shop_table thead {
        display: none;
    }

    body.woocommerce-cart .woocommerce table.shop_table tbody td {
        display: block !important;
        text-align: left !important;
        padding: 0.5rem 0.5rem !important;
        border-bottom: none !important;
    }

    body.woocommerce-cart .woocommerce table.shop_table tbody td::before {
        content: attr(data-title);
        font-weight: 600;
        color: #94a3b8;
        display: block;
        margin-bottom: 4px;
        font-size: 0.8rem;
        text-transform: uppercase;
    }

    body.woocommerce-cart .woocommerce table.shop_table tbody tr {
        display: block;
        border-bottom: 1px solid rgba(255,255,255,0.05);
        padding: 1rem 0;
    }
}
