/* =========================================================================
   MatzApp — Carrito / Checkout / Lista de deseos / Comparar (rediseño marca)
   Update-safe: solo child theme (CSS sobre el markup estándar de WooCommerce
   y YITH; no se overridean plantillas). Paleta MATZ navy #2e448e / acero #476faa.
   100% responsive: en móvil las tablas se apilan en tarjetas con etiquetas.
   ========================================================================= */

:root{
    --mw-navy:#2e448e; --mw-dark:#20305f; --mw-steel:#476faa; --mw-red:#f83a3a;
    --mw-ink:#28313f; --mw-muted:#6b7788; --mw-line:#e4e8f0; --mw-soft:#f4f6fb;
    --mw-radius:14px; --mw-shadow:0 10px 30px rgba(32,48,95,.08);
}

/* Contenedor: quitamos el blanco rígido y damos aire */
.woocommerce-cart #contents,
.woocommerce-checkout #contents,
.woocommerce-wishlist #contents,
.woocommerce-page.page-id-15 #contents{
    background:transparent; padding-top:14px;
}
.woocommerce-cart #contents .page .entry-title,
.woocommerce-checkout #contents .page .entry-title,
.woocommerce-wishlist #contents .page .entry-title{ margin-bottom:22px; }

/* Inputs comunes (checkout, cupón, etc.) */
.woocommerce form .form-row input.input-text,
.woocommerce form .form-row textarea,
.woocommerce form .form-row select,
.woocommerce .select2-container .select2-selection--single,
.woocommerce table.cart td.actions .coupon .input-text,
.woocommerce #order_review input.input-text{
    box-sizing:border-box; width:100%;
    min-height:48px; padding:11px 15px;
    border:1.5px solid var(--mw-line) !important;
    border-radius:10px !important; background:#fbfcfe !important;
    font-size:14.5px; color:var(--mw-ink); box-shadow:none !important;
    transition:border-color .15s, box-shadow .15s, background .15s;
}
.woocommerce form .form-row input.input-text:focus,
.woocommerce form .form-row textarea:focus,
.woocommerce form .form-row select:focus,
.woocommerce .select2-container--focus .select2-selection--single{
    border-color:var(--mw-navy) !important; background:#fff !important;
    box-shadow:0 0 0 3px rgba(46,68,142,.12) !important; outline:0;
}
.woocommerce .select2-container .select2-selection--single{ height:48px; display:flex; align-items:center; }
.woocommerce .select2-container .select2-selection__rendered{ line-height:normal; padding:0; }
.woocommerce .select2-container .select2-selection__arrow{ top:12px; }
.woocommerce form .form-row label{ font-weight:600; font-size:13.5px; color:var(--mw-ink); margin-bottom:6px; }
.woocommerce .required, .woocommerce .required *{ color:var(--mw-red); border:0; }

/* Botones de marca (globales de estas páginas) */
.woocommerce-cart .button,
.woocommerce-checkout #payment #place_order,
.woocommerce-wishlist .button,
.woocommerce table.cart td.actions .button,
.woocommerce .wc-proceed-to-checkout a.checkout-button,
.woocommerce a.button.wc-backward{
    background:var(--mw-navy) !important; color:#fff !important;
    border:0 !important; border-radius:26px !important;
    padding:12px 26px !important; min-height:46px;
    font-size:13.5px !important; font-weight:700 !important; letter-spacing:.3px;
    text-transform:uppercase; box-shadow:0 8px 18px rgba(46,68,142,.24) !important;
    transition:background .15s, transform .1s, box-shadow .15s; text-shadow:none !important;
}
.woocommerce-cart .button:hover,
.woocommerce-checkout #payment #place_order:hover,
.woocommerce-wishlist .button:hover,
.woocommerce .wc-proceed-to-checkout a.checkout-button:hover,
.woocommerce a.button.wc-backward:hover{
    background:var(--mw-dark) !important; transform:translateY(-1px);
    box-shadow:0 12px 24px rgba(46,68,142,.32) !important;
}
/* Botones del carrito (cupón / actualizar): navy con texto blanco.
   Prefijo body.* para ganar especificidad al tema (que pisaba el color). */
body.woocommerce-cart table.cart td.actions button.button,
body.woocommerce-cart table.cart td.actions input.button,
body.woocommerce-cart .wc-proceed-to-checkout a.checkout-button,
body.woocommerce-checkout #payment #place_order{
    background:var(--mw-navy) !important; color:#fff !important;
    border:0 !important; text-shadow:none !important;
}
/* Botón "Actualizar carrito" como secundario (contorno) */
body.woocommerce-cart table.cart td.actions button.button[name="update_cart"],
body.woocommerce-cart table.cart td.actions input.button[name="update_cart"]{
    background:#fff !important; color:var(--mw-navy) !important;
    border:1.5px solid var(--mw-navy) !important; box-shadow:none !important;
}
body.woocommerce-cart table.cart td.actions button.button[name="update_cart"]:hover,
body.woocommerce-cart table.cart td.actions input.button[name="update_cart"]:hover{
    background:var(--mw-navy) !important; color:#fff !important;
}

/* ================= TABLAS (carrito / wishlist) ================= */
.woocommerce table.shop_table,
.woocommerce table.wishlist_table{
    border:1px solid var(--mw-line) !important; border-radius:var(--mw-radius) !important;
    border-collapse:separate !important; border-spacing:0; overflow:hidden;
    background:#fff; box-shadow:var(--mw-shadow); margin-bottom:26px;
}
.woocommerce table.shop_table thead th,
.woocommerce table.wishlist_table thead th{
    background:var(--mw-soft); color:var(--mw-ink);
    font-weight:700; font-size:13px; text-transform:uppercase; letter-spacing:.4px;
    padding:15px 16px; border:0 !important;
}
.woocommerce table.shop_table td,
.woocommerce table.wishlist_table td{
    padding:16px !important; border-top:1px solid var(--mw-line) !important;
    vertical-align:middle; background:#fff;
}
.woocommerce table.shop_table tbody tr:first-child td{ border-top:0 !important; }
.woocommerce table.cart img,
.woocommerce table.wishlist_table img{
    width:66px !important; height:auto; border-radius:10px; border:1px solid var(--mw-line);
    background:#fff;
}
.woocommerce table.cart td.product-name a,
.woocommerce table.wishlist_table td.product-name a{
    color:var(--mw-ink); font-weight:600; text-decoration:none;
}
.woocommerce table.cart td.product-name a:hover,
.woocommerce table.wishlist_table td.product-name a:hover{ color:var(--mw-navy); }
.woocommerce .cart .product-subtotal,
.woocommerce table.cart td.product-price{ color:var(--mw-ink); font-weight:600; }

/* Botón eliminar (x) */
.woocommerce a.remove{
    display:inline-flex !important; align-items:center; justify-content:center;
    width:26px; height:26px; border-radius:50%;
    background:#fdecec !important; color:var(--mw-red) !important;
    font-size:18px; line-height:1; text-decoration:none !important;
}
.woocommerce a.remove:hover{ background:var(--mw-red) !important; color:#fff !important; }

/* Stepper de cantidad: se respeta el del tema (ya se ve bien). */

/* Fila de acciones (cupón) del carrito */
.woocommerce table.cart td.actions{ background:var(--mw-soft); }
.woocommerce table.cart td.actions .coupon{ display:flex; gap:10px; flex-wrap:wrap; align-items:center; }
.woocommerce table.cart td.actions .coupon .input-text{ width:auto !important; min-width:180px; flex:1 1 200px; max-width:280px; }

/* ================= TOTALES DEL CARRITO ================= */
.woocommerce .cart-collaterals .cart_totals,
.woocommerce .cart_totals{ float:none; width:100%; max-width:440px; margin-left:auto; }
.woocommerce .cart_totals h2{
    font-size:18px !important; font-weight:800; color:var(--mw-ink); margin-bottom:14px;
}
.woocommerce .cart_totals table.shop_table{ box-shadow:var(--mw-shadow); }
.woocommerce .cart_totals .order-total .amount,
.woocommerce .cart_totals .order-total th{ color:var(--mw-navy); font-size:17px; font-weight:800; }
.woocommerce .wc-proceed-to-checkout{ padding-top:16px; }
.woocommerce .wc-proceed-to-checkout a.checkout-button{
    display:block; width:100%; text-align:center; font-size:15px !important;
}

/* ================= CHECKOUT ================= */
.woocommerce-checkout .col2-set{ display:flex; flex-wrap:wrap; gap:26px; width:100%; margin:0; }
.woocommerce-checkout .col2-set .col-1,
.woocommerce-checkout .col2-set .col-2{ width:auto; flex:1 1 320px; float:none; margin:0; }
.woocommerce-checkout .woocommerce-billing-fields > h3,
.woocommerce-checkout .woocommerce-additional-fields > h3,
.woocommerce-checkout #order_review_heading{
    font-size:19px !important; font-weight:800; color:var(--mw-ink);
    padding-bottom:12px; margin-bottom:18px; border-bottom:2px solid var(--mw-line);
}
/* Tarjeta que envuelve billing + review */
.woocommerce-checkout #customer_details,
.woocommerce-checkout #order_review{
    background:#fff; border:1px solid var(--mw-line); border-radius:var(--mw-radius);
    box-shadow:var(--mw-shadow); padding:26px; margin-bottom:26px;
}
.woocommerce-checkout #order_review{ padding:0; overflow:hidden; }
.woocommerce-checkout #order_review_heading{ padding:22px 26px 12px; margin:0; border-bottom:0; }
.woocommerce-checkout .woocommerce-checkout-review-order-table{
    border:0 !important; border-radius:0 !important; box-shadow:none !important; margin:0;
}
.woocommerce-checkout .woocommerce-checkout-review-order-table thead th{ background:var(--mw-soft); }
.woocommerce-checkout .woocommerce-checkout-review-order-table .order-total .amount{
    color:var(--mw-navy); font-size:18px; font-weight:800;
}
/* Aviso de cupón */
.woocommerce-checkout .woocommerce-form-coupon-toggle .woocommerce-info,
.woocommerce .woocommerce-info{
    background:var(--mw-soft) !important; border-top:3px solid var(--mw-navy) !important;
    color:var(--mw-ink); border-radius:8px;
}
.woocommerce .woocommerce-info::before, .woocommerce .woocommerce-message::before{ color:var(--mw-navy); }
.woocommerce .woocommerce-message{ border-top-color:var(--mw-steel) !important; }
/* Métodos de pago */
.woocommerce-checkout #payment{
    background:transparent !important; border-radius:0;
}
.woocommerce-checkout #payment ul.payment_methods{
    border:0 !important; padding:22px 26px 4px !important; background:transparent;
}
.woocommerce-checkout #payment div.form-row.place-order{ padding:0 26px 26px !important; }
.woocommerce-checkout #payment #place_order{ width:100%; font-size:15px !important; }

/* ================= WISHLIST (YITH) ================= */
.woocommerce .wishlist-title h2,
.wishlist_table caption,
.yith-wcwl-share h4{ color:var(--mw-ink); }
.woocommerce table.wishlist_table td.product-price,
.woocommerce table.wishlist_table td.product-price .amount{ font-weight:700; color:var(--mw-ink) !important; }
.woocommerce table.wishlist_table td.product-stock-status{ font-weight:600; }
.woocommerce table.wishlist_table td.product-stock-status .wishlist-in-stock{ color:#22a559; }
/* Botón "Añadir al carrito" de la wishlist (no trae clase .button) */
.woocommerce table.wishlist_table td.product-add-to-cart a,
.woocommerce table.wishlist_table td.product-add-to-cart a.add_to_cart{
    display:inline-block; background:var(--mw-navy) !important; color:#fff !important;
    border:0 !important; border-radius:24px; padding:10px 20px !important;
    font-size:12.5px !important; font-weight:700; letter-spacing:.3px; text-transform:uppercase;
    text-decoration:none !important; box-shadow:0 6px 14px rgba(46,68,142,.22);
    transition:background .15s, transform .1s;
}
.woocommerce table.wishlist_table td.product-add-to-cart a:hover{
    background:var(--mw-dark) !important; transform:translateY(-1px); color:#fff !important;
}
.yith-wcwl-share{ margin-top:18px; }
.yith-wcwl-share ul li a{ color:var(--mw-navy); }
.hidden-title-form + .wishlist-title, .wishlist-title{ margin-bottom:16px; }

/* ================= COMPARAR (YITH) ================= */
#yith-woocompare table.compare-list td,
#yith-woocompare table.compare-list th{ border-color:var(--mw-line); }
#yith-woocompare table.compare-list tr.title td,
#yith-woocompare table.compare-list th{ background:var(--mw-soft); color:var(--mw-ink); }
#yith-woocompare table.compare-list .add_to_cart{ background:var(--mw-navy) !important; color:#fff !important; border-radius:24px; }

/* ================= ESTADOS VACÍOS ================= */
.woocommerce .cart-empty,
.woocommerce .wishlist-empty,
.woocommerce-page .woocommerce-info.cart-empty{
    background:#fff; border:1px solid var(--mw-line); border-radius:var(--mw-radius);
    box-shadow:var(--mw-shadow); padding:26px; text-align:center;
    font-size:16px; color:var(--mw-muted);
}
.woocommerce .return-to-shop{ text-align:center; margin-top:16px; }

/* ================= RESPONSIVE / MÓVIL ================= */
@media (max-width:767px){
    /* Checkout a una columna */
    .woocommerce-checkout .col2-set{ flex-direction:column; gap:0; }
    .woocommerce-checkout #customer_details,
    .woocommerce-checkout #order_review{ padding:18px; }
    .woocommerce-checkout #order_review_heading{ padding:18px 18px 10px; }
    .woocommerce-checkout .woocommerce-checkout-review-order-table thead{ display:table-header-group; }
    .woocommerce-checkout #payment ul.payment_methods,
    .woocommerce-checkout #payment div.form-row.place-order{ padding-left:18px !important; padding-right:18px !important; }

    /* Totales a ancho completo */
    .woocommerce .cart_totals,
    .woocommerce .cart-collaterals .cart_totals{ max-width:none; }

    /* Tablas carrito/wishlist -> tarjetas apiladas */
    .woocommerce table.shop_table.shop_table_responsive,
    .woocommerce table.wishlist_table{
        border:0 !important; box-shadow:none !important; background:transparent; overflow:visible;
    }
    .woocommerce table.shop_table.shop_table_responsive thead,
    .woocommerce table.wishlist_table thead{ display:none; }
    .woocommerce table.shop_table.shop_table_responsive tbody,
    .woocommerce table.wishlist_table tbody{ display:block; }
    .woocommerce table.shop_table.shop_table_responsive tbody tr,
    .woocommerce table.wishlist_table tbody tr{
        display:block; position:relative;
        background:#fff; border:1px solid var(--mw-line) !important; border-radius:var(--mw-radius);
        box-shadow:var(--mw-shadow); padding:14px 16px 14px 92px; margin-bottom:14px;
    }
    .woocommerce table.shop_table.shop_table_responsive tbody tr td,
    .woocommerce table.wishlist_table tbody tr td{
        display:flex; justify-content:space-between; align-items:center; gap:12px;
        border:0 !important; border-top:1px dashed var(--mw-line) !important;
        padding:9px 0 !important; text-align:right; background:transparent;
    }
    .woocommerce table.shop_table.shop_table_responsive tbody tr td::before,
    .woocommerce table.wishlist_table tbody tr td::before{
        content:attr(data-title); font-weight:700; color:var(--mw-muted);
        font-size:12px; text-transform:uppercase; letter-spacing:.3px; text-align:left;
    }
    /* Miniatura como avatar arriba-izquierda */
    .woocommerce table.shop_table.shop_table_responsive td.product-thumbnail,
    .woocommerce table.wishlist_table td.product-thumbnail{
        position:absolute; left:14px; top:14px; width:64px; padding:0 !important; border:0 !important;
        display:block;
    }
    .woocommerce table.shop_table.shop_table_responsive td.product-thumbnail::before,
    .woocommerce table.wishlist_table td.product-thumbnail::before{ display:none; }
    .woocommerce table.shop_table.shop_table_responsive td.product-thumbnail img,
    .woocommerce table.wishlist_table td.product-thumbnail img{ width:64px !important; }
    /* Primer campo (nombre) sin borde superior */
    .woocommerce table.shop_table.shop_table_responsive td.product-name,
    .woocommerce table.wishlist_table td.product-name{ border-top:0 !important; }
    .woocommerce table.shop_table.shop_table_responsive td.product-name::before,
    .woocommerce table.wishlist_table td.product-name::before{ display:none; }
    .woocommerce table.shop_table.shop_table_responsive td.product-name{
        display:block; text-align:left; font-size:15px; padding-bottom:6px !important;
    }
    /* Botón eliminar arriba-derecha */
    .woocommerce table.shop_table.shop_table_responsive td.product-remove{
        position:absolute; right:12px; top:12px; padding:0 !important; border:0 !important;
    }
    .woocommerce table.shop_table.shop_table_responsive td.product-remove::before{ display:none; }
    /* Fila de acciones (cupón) full width */
    .woocommerce table.cart td.actions{ display:block; padding:14px !important; border-radius:var(--mw-radius); }
    .woocommerce table.cart td.actions::before{ display:none; }
    .woocommerce table.cart td.actions .coupon{ margin-bottom:12px; }
    .woocommerce table.cart td.actions .coupon .input-text{ max-width:none; }
    .woocommerce table.cart td.actions .button[name="update_cart"]{ width:100%; }
    /* Wishlist: botón añadir al carrito full width */
    .woocommerce table.wishlist_table td.product-add-to-cart .button{ width:100%; }
}
