/**
 * Páginas Core de WooCommerce: Carrito, Finalizar Compra, Mi Cuenta y Términos y Condiciones
 * - CSS 100% aislado (0 modificaciones a style.css base)
 * - Contenedores acotados .precisur-container (max-width: 1360px)
 * - Botones alineados al sistema oficial (Azul Corporativo #154686 -> Verde #15733e hover)
 *
 * @package PrecisurTheme
 * @version 1.0.0
 */

.precisur-wcc-page {
    background: #f5f7fb;
    color: #1e293b;
}

/* =========================================================
   1. HERO COMPACTO + PASOS DE COMPRA
   ========================================================= */
.precisur-wcc-hero {
    background: linear-gradient(135deg, #0c2d57 0%, #154686 65%, #1b569f 100%);
    color: #ffffff;
    padding: 26px 0 30px;
    border-bottom: 4px solid #15733e;
}

.precisur-wcc-breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.78);
    margin-bottom: 14px;
}

.precisur-wcc-breadcrumbs a {
    color: #ffffff;
    text-decoration: none;
    font-weight: 500;
}

.precisur-wcc-breadcrumbs a:hover {
    text-decoration: underline;
}

.precisur-wcc-breadcrumbs .is-current {
    color: #a3e635;
    font-weight: 600;
}

.precisur-wcc-eyebrow {
    display: inline-block;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #ffffff;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 4px 12px;
    border-radius: 999px;
    margin-bottom: 10px;
}

.precisur-wcc-hero-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}

.precisur-wcc-h1 {
    font-size: clamp(24px, 2.8vw, 34px);
    line-height: 1.15;
    font-weight: 800;
    color: #ffffff;
    margin: 0 0 6px;
}

.precisur-wcc-subtitle {
    font-size: 14.5px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    max-width: 660px;
}

.precisur-wcc-hero-back {
    border: 1.5px solid rgba(255, 255, 255, 0.35) !important;
    white-space: nowrap;
}

/* Barra de 3 Pasos */
.precisur-wcc-steps {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.precisur-wcc-steps li {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
    padding: 7px 14px;
    border-radius: 999px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.78);
}

.precisur-wcc-steps li a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: inherit;
    text-decoration: none;
}

.precisur-wcc-steps li span {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    font-size: 12px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.precisur-wcc-steps li.is-active {
    background: #ffffff;
    color: #0f3566;
    border-color: #ffffff;
}

.precisur-wcc-steps li.is-active span {
    background: #154686;
    color: #ffffff;
}

.precisur-wcc-steps li.is-done {
    background: rgba(21, 115, 62, 0.35);
    border-color: #4ade80;
    color: #ffffff;
}

.precisur-wcc-steps li.is-done span {
    background: #15733e;
    color: #ffffff;
}

/* =========================================================
   2. CUERPO Y TARJETA PRINCIPAL
   ========================================================= */
.precisur-wcc-body {
    padding: 32px 0 44px;
}

.precisur-wcc-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    padding: 28px;
    box-shadow: 0 6px 24px rgba(15, 53, 102, 0.05);
}

.precisur-wcc-trust-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-top: 22px;
}

.precisur-wcc-trust-bar > div {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 13px;
    color: #0f3566;
}

/* =========================================================
   3. ESTILOS LIMPIOS PARA WOOCOMMERCE (CARRITO, CHECKOUT, CUENTA)
   ========================================================= */
.precisur-wcc-page .woocommerce-message,
.precisur-wcc-page .woocommerce-info,
.precisur-wcc-page .woocommerce-error {
    border-radius: 12px;
    padding: 14px 18px;
    margin: 0 0 20px;
    font-size: 14px;
    border-top-width: 3px;
    background: #f8fafc;
}

.precisur-wcc-page .woocommerce-message { border-top-color: #15733e; }
.precisur-wcc-page .woocommerce-info { border-top-color: #154686; }
.precisur-wcc-page .woocommerce-error { border-top-color: #dc2626; }

/* Botones nativos de WooCommerce alineados al sistema oficial */
.precisur-wcc-page .woocommerce a.button,
.precisur-wcc-page .woocommerce button.button,
.precisur-wcc-page .woocommerce input.button,
.precisur-wcc-page .woocommerce #respond input#submit {
    background: linear-gradient(135deg, #0a3d7a 0%, #0d4a94 100%) !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 999px !important;
    padding: 12px 24px !important;
    font-size: 14.5px !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.precisur-wcc-page .woocommerce a.button:hover,
.precisur-wcc-page .woocommerce button.button:hover,
.precisur-wcc-page .woocommerce input.button:hover {
    background: linear-gradient(135deg, #1b8e3c 0%, #22a746 100%) !important;
    color: #ffffff !important;
    transform: translateY(-1px);
}

/* Inputs y selects limpios */
.precisur-wcc-page .woocommerce form .form-row input.input-text,
.precisur-wcc-page .woocommerce form .form-row textarea,
.precisur-wcc-page .woocommerce form .form-row select,
.precisur-wcc-page .select2-container--default .select2-selection--single {
    width: 100%;
    min-height: 44px;
    border: 1.5px solid #cbd5e1;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 14px;
    color: #0f172a;
    background: #ffffff;
    box-sizing: border-box;
}

.precisur-wcc-page .woocommerce form .form-row input.input-text:focus,
.precisur-wcc-page .woocommerce form .form-row textarea:focus,
.precisur-wcc-page .woocommerce form .form-row select:focus {
    border-color: #154686;
    outline: none;
    box-shadow: 0 0 0 3px rgba(21, 70, 134, 0.12);
}

.precisur-wcc-page .woocommerce form .form-row label {
    font-size: 13px;
    font-weight: 700;
    color: #0f3566;
    margin-bottom: 5px;
    display: block;
}

/* Tabla de Carrito */
.precisur-wcc-page .woocommerce table.shop_table {
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    overflow: hidden;
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
}

.precisur-wcc-page .woocommerce table.shop_table th {
    background: #f8fafc;
    color: #0f3566;
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    padding: 13px 14px;
    border-bottom: 1px solid #e2e8f0;
}

.precisur-wcc-page .woocommerce table.shop_table td {
    padding: 14px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.precisur-wcc-page .woocommerce table.cart img {
    width: 68px;
    height: 68px;
    object-fit: contain;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 4px;
    background: #ffffff;
}

/* Input de Código de cupón amplio y alineado */
.precisur-wcc-page .woocommerce table.cart td.actions .coupon {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.precisur-wcc-page .woocommerce table.cart td.actions .coupon .input-text {
    width: 230px !important;
    min-width: 200px;
    height: 42px;
    border: 1.5px solid #cbd5e1;
    border-radius: 999px;
    padding: 0 16px;
    font-size: 14px;
    color: #0f172a;
    background: #ffffff;
    margin: 0 !important;
    float: none !important;
}

/* Totales del Carrito ocupando el 100% del ancho (cero hueco izquierdo) */
.precisur-wcc-page .woocommerce .cart-collaterals {
    width: 100% !important;
    margin-top: 24px;
}

.precisur-wcc-page .woocommerce .cart-collaterals .cart_totals {
    float: none !important;
    width: 100% !important;
    background: #f8fafc;
    border: 1px solid #dbe4f0;
    border-radius: 16px;
    padding: 24px;
    box-sizing: border-box;
}

.precisur-wcc-page .woocommerce .cart-collaterals .cart_totals h2 {
    font-size: 20px;
    font-weight: 800;
    color: #0f3566;
    margin: 0 0 16px;
}

/* Tabla de Totales limpia: columna etiqueta compacta (140px) y contenido al resto del ancho */
.precisur-wcc-cart-card .cart_totals table.shop_table th {
    width: 150px;
    vertical-align: top;
}

.precisur-wcc-cart-card .cart_totals table.shop_table td {
    width: auto;
}

/* Cuadrícula de Agencias de Envío como Botones de Selección (Carrito y Checkout) */
.precisur-wcc-page ul#shipping_method {
    list-style: none;
    margin: 4px 0 12px;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.precisur-wcc-checkout-card ul#shipping_method {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.precisur-wcc-page ul#shipping_method li {
    margin: 0 !important;
    padding: 0 !important;
    text-indent: 0 !important;
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    border-radius: 12px;
    transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease, transform 0.15s ease;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px !important;
    cursor: pointer;
}

.precisur-wcc-page ul#shipping_method li:hover {
    border-color: #154686;
    background: #f0f7ff;
    transform: translateY(-1px);
}

.precisur-wcc-page ul#shipping_method li:has(input[type="radio"]:checked) {
    border-color: #154686;
    border-width: 2px;
    background: #eff6ff;
    box-shadow: 0 4px 14px rgba(21, 70, 134, 0.14);
}

.precisur-wcc-page ul#shipping_method li input.shipping_method {
    margin: 3px 0 0 !important;
    flex-shrink: 0;
    width: 17px;
    height: 17px;
    accent-color: #154686;
    cursor: pointer;
}

.precisur-wcc-page ul#shipping_method li label {
    display: block !important;
    flex: 1 1 auto;
    margin: 0 !important;
    font-size: 13px !important;
    line-height: 1.4 !important;
    font-weight: 600 !important;
    color: #1e293b;
    cursor: pointer;
}

.precisur-wcc-page ul#shipping_method li:has(input[type="radio"]:checked) label {
    color: #0f3566;
    font-weight: 700 !important;
}

.precisur-wcc-page .wc-proceed-to-checkout {
    display: flex;
    justify-content: flex-end;
    padding-top: 14px !important;
}

.precisur-wcc-page .wc-proceed-to-checkout a.checkout-button {
    min-width: 280px;
    font-size: 16px !important;
    padding: 15px 30px !important;
}

/* Checkout 2 columnas */
.precisur-wcc-checkout-card .woocommerce-checkout {
    display: block;
}

.precisur-wcc-checkout-card #customer_details {
    margin-bottom: 24px;
}

.precisur-wcc-checkout-card h3 {
    color: #0f3566;
    font-size: 19px;
    font-weight: 800;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 10px;
    margin-bottom: 16px;
}

.precisur-wcc-checkout-card #payment {
    background: #f8fafc;
    border: 1px solid #dbe4f0;
    border-radius: 14px;
    padding: 18px;
    margin-top: 18px;
}

.precisur-wcc-checkout-card #payment .payment_box {
    background: #ffffff !important;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    color: #334155;
}

/* Mi Cuenta Dashboard */
.precisur-wcc-account-card.is-logged-in .woocommerce {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 28px;
    align-items: start;
}

.precisur-wcc-account-card .woocommerce-MyAccount-navigation {
    width: 100% !important;
    float: none !important;
}

.precisur-wcc-account-card .woocommerce-MyAccount-navigation ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.precisur-wcc-account-card .woocommerce-MyAccount-navigation li a {
    display: block;
    padding: 11px 16px;
    border-radius: 10px;
    background: #f8fafc;
    color: #0f3566;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    border: 1px solid #e2e8f0;
    transition: all 0.15s ease;
}

.precisur-wcc-account-card .woocommerce-MyAccount-navigation li.is-active a,
.precisur-wcc-account-card .woocommerce-MyAccount-navigation li a:hover {
    background: #154686;
    color: #ffffff;
    border-color: #154686;
}

.precisur-wcc-account-card .woocommerce-MyAccount-content {
    width: 100% !important;
    float: none !important;
}

.precisur-wcc-account-card.is-logged-out .woocommerce-form-login,
.precisur-wcc-account-card.is-logged-out .woocommerce-form-register {
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 24px;
    background: #f8fafc;
}

/* =========================================================
   4. TÉRMINOS Y CONDICIONES (DOCUMENTO LEGAL LEGIBLE)
   ========================================================= */
.precisur-wcc-legal-card {
    max-width: 980px;
    margin: 0 auto;
    padding: 36px 40px;
}

.precisur-wcc-legal-prose {
    font-size: 15px;
    line-height: 1.75;
    color: #334155;
}

.precisur-wcc-legal-prose h2,
.precisur-wcc-legal-prose h3,
.precisur-wcc-legal-prose h4 {
    color: #0f3566;
    margin: 26px 0 10px;
    line-height: 1.3;
}

.precisur-wcc-legal-prose p {
    margin: 0 0 14px;
}

.precisur-wcc-legal-prose strong {
    color: #0f3566;
}

.precisur-wcc-legal-prose a {
    color: #154686;
    font-weight: 600;
}

.precisur-wcc-legal-prose ul,
.precisur-wcc-legal-prose ol {
    padding-left: 22px;
    margin: 0 0 16px;
}

.precisur-wcc-legal-footer {
    margin-top: 32px;
    padding-top: 22px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* =========================================================
   5. RESPONSIVE
   ========================================================= */
@media (max-width: 960px) {
    .precisur-wcc-trust-bar {
        grid-template-columns: repeat(2, 1fr);
    }

    .precisur-wcc-account-card.is-logged-in .woocommerce {
        grid-template-columns: 1fr;
    }

    .precisur-wcc-page ul#shipping_method {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .precisur-wcc-page ul#shipping_method,
    .precisur-wcc-checkout-card ul#shipping_method {
        grid-template-columns: minmax(0, 1fr);
    }

    .precisur-wcc-page .wc-proceed-to-checkout a.checkout-button {
        width: 100%;
    }
    .precisur-wcc-card {
        padding: 18px 16px;
        border-radius: 14px;
    }

    .precisur-wcc-legal-card {
        padding: 22px 18px;
    }

    .precisur-wcc-trust-bar {
        grid-template-columns: 1fr;
    }

    .precisur-wcc-steps {
        gap: 6px;
    }

    .precisur-wcc-steps li {
        padding: 6px 10px;
        font-size: 12px;
    }
}
