/* Avisos de WooCommerce: tarjeta con chip de ícono, sin barra lateral (el
       border-left de 4px se veía genérico). Mismo lenguaje que las cards de la
       ficha: superficie clara, radio 12, chip 26px con gradiente. */
    .woocommerce-message:not(.chs-free-shipping-message),
    .woocommerce-info:not(.chs-free-shipping-message),
    .woocommerce-error,
    .woocommerce .woocommerce-message:not(.chs-free-shipping-message),
    .woocommerce .woocommerce-info:not(.chs-free-shipping-message),
    .woocommerce .woocommerce-error {
        position: relative !important;
        background: #f7fafd !important;
        border: 1px solid #e6ecf5 !important;
        border-radius: 12px !important;
        box-shadow: none !important;
        padding: 14px 18px 14px 52px !important;
        margin: 0 0 14px !important;
        list-style: none !important;
        font-size: 14px !important;
        font-weight: 600 !important;
        color: #0f1729 !important;
        line-height: 1.45 !important;
    }
    .woocommerce-error li { list-style: none !important; margin: 0 !important; padding: 0 !important; }
    .woocommerce-error li + li { margin-top: 4px !important; }

    /* Chip del ícono */
    .woocommerce-message:not(.chs-free-shipping-message)::before,
    .woocommerce-info:not(.chs-free-shipping-message)::before,
    .woocommerce-error::before {
        position: absolute !important;
        left: 15px !important; top: 14px !important;
        display: block !important;
        width: 24px !important; height: 24px !important;
        border-radius: 8px !important;
        font-family: inherit !important;
        font-size: 13px !important; font-weight: 900 !important;
        line-height: 24px !important; text-align: center !important;
        color: #fff !important;
    }
    .woocommerce-message:not(.chs-free-shipping-message),
    .woocommerce .woocommerce-message:not(.chs-free-shipping-message) {
        background: #f2fbf6 !important; border-color: #cdead8 !important; color: #14532d !important;
    }
    .woocommerce-message:not(.chs-free-shipping-message)::before,
    .woocommerce .woocommerce-message:not(.chs-free-shipping-message)::before {
        content: "\2713" !important;
        background: linear-gradient(135deg, #15803d, #22c55e) !important;
        box-shadow: 0 2px 6px rgba(21,128,61,.28) !important;
    }
    .woocommerce-info:not(.chs-free-shipping-message),
    .woocommerce .woocommerce-info:not(.chs-free-shipping-message) {
        background: #f5f9ff !important; border-color: #dbe6f8 !important; color: #12233f !important;
    }
    .woocommerce-info:not(.chs-free-shipping-message)::before,
    .woocommerce .woocommerce-info:not(.chs-free-shipping-message)::before {
        content: "i" !important; font-style: italic !important;
        background: linear-gradient(135deg, #1e40af, #3399FF) !important;
        box-shadow: 0 2px 6px rgba(30,64,175,.28) !important;
    }
    .woocommerce-error, .woocommerce .woocommerce-error {
        background: #fef4f4 !important; border-color: #f6d2d2 !important; color: #7f1d1d !important;
    }
    .woocommerce-error::before {
        content: "!" !important;
        background: linear-gradient(135deg, #b91c1c, #ef4444) !important;
        box-shadow: 0 2px 6px rgba(185,28,28,.28) !important;
    }
    /* clearfix real: el botón "Deshacer" va flotado a la derecha */
    .woocommerce-message:not(.chs-free-shipping-message)::after {
        content: "" !important; display: table !important; clear: both !important;
    }

    /* Barra "Envío gratis a todo Chile" (plugin SAM - Envio Gratis): usa la clase
       woocommerce-message, así que se saca de las reglas de arriba y se define acá
       (antes los !important le pisaban su fondo navy y quedaba como aviso blanco). */
    .chs-free-shipping-message,
    .woocommerce .chs-free-shipping-message {
        background: linear-gradient(135deg, #000033, #1e40af) !important;
        border: 0 !important; border-radius: 12px !important;
        box-shadow: 0 4px 14px rgba(0,0,51,.18) !important;
        padding: 12px 16px !important; margin: 0 0 14px !important;
        color: #fff !important; text-align: center !important;
        font-size: 14px !important; font-weight: 800 !important; letter-spacing: .2px !important;
    }
    .chs-free-shipping-message::before,
    .chs-free-shipping-message::after { display: none !important; content: none !important; }

    .return-to-shop .wc-backward {
        background: #000033 !important; color: #fff !important;
        border: none !important; border-radius: 8px !important;
        padding: 12px 24px !important; font-weight: 700 !important;
    }
    .return-to-shop .wc-backward:hover { background: #000066 !important; }

    .woocommerce-message a.button,
    .woocommerce-message a.restore-item {
        background: #000033 !important; color: #fff !important;
        border: none !important; border-radius: 6px !important;
        padding: 8px 16px !important; font-size: 13px !important;
        font-weight: 600 !important; text-decoration: none !important; float: right !important;
    }
    .woocommerce-message a.button:hover { background: #000066 !important; }

    /* Responsive de los avisos. Va DESPUÉS de las reglas del botón: en móvil el
       botón deja de flotar (choca con el texto en 375px) y pasa a su propia línea. */
    @media (max-width: 768px) {
        .woocommerce-message:not(.chs-free-shipping-message),
        .woocommerce-info:not(.chs-free-shipping-message),
        .woocommerce-error,
        .woocommerce .woocommerce-message:not(.chs-free-shipping-message),
        .woocommerce .woocommerce-info:not(.chs-free-shipping-message),
        .woocommerce .woocommerce-error {
            font-size: 13px !important;
            padding: 12px 14px 12px 46px !important;
        }
        .woocommerce-message:not(.chs-free-shipping-message)::before,
        .woocommerce-info:not(.chs-free-shipping-message)::before,
        .woocommerce-error::before,
        .woocommerce .woocommerce-message:not(.chs-free-shipping-message)::before,
        .woocommerce .woocommerce-info:not(.chs-free-shipping-message)::before,
        .woocommerce .woocommerce-error::before { left: 12px !important; top: 12px !important; }
        .chs-free-shipping-message,
        .woocommerce .chs-free-shipping-message { font-size: 13px !important; padding: 11px 14px !important; }
        /* El <a> viene PRIMERO en el DOM de WooCommerce: se manda al final con order
           (el texto suelto es un item anónimo con order 0), así queda texto arriba y
           botón debajo alineado a la izquierda. */
        .woocommerce-message:not(.chs-free-shipping-message),
        .woocommerce .woocommerce-message:not(.chs-free-shipping-message) {
            display: flex !important;
            flex-direction: column !important;
            align-items: flex-start !important;
            gap: 9px !important;
        }
        .woocommerce-message a.button,
        .woocommerce-message a.restore-item {
            order: 2 !important;
            float: none !important; display: inline-block !important;
            margin: 0 !important; padding: 9px 16px !important;
        }
    }

    /* Single product add-to-cart button */
    .single_add_to_cart_button.button.alt {
        background: linear-gradient(120deg, #1e40af, #1e6fd0) !important; color: #fff !important;
        border: none !important; border-radius: 999px !important;
        padding: 13px 28px !important; font-size: 15px !important;
        font-weight: 800 !important; cursor: pointer !important;
        display: inline-flex !important; align-items: center; gap: 9px;
        box-shadow: 0 6px 18px rgba(30,64,175,0.28);
        transition: transform 0.15s, box-shadow 0.2s !important; letter-spacing: 0.5px !important;
    }
    .single_add_to_cart_button.button.alt:hover { background: linear-gradient(120deg, #000033, #1e40af) !important; transform: translateY(-2px); }
    .single_add_to_cart_button.button.alt.disabled,
    .single_add_to_cart_button.button.alt:disabled { background: #cbd5e1 !important; cursor: not-allowed !important; }

    .stock.in-stock { color: #16a34a !important; font-weight: 600; }
    .stock.out-of-stock { color: #dc2626 !important; font-weight: 600; }

    .quantity .qty {
        border: 1px solid #e2e8f0 !important; border-radius: 8px !important;
        padding: 10px !important; font-size: 16px !important;
        width: 70px !important; text-align: center !important;
    }

    /* ══════════════════════════════════════════════ */
    /* MI CUENTA — Estilo unificado todas las pestañas */
    /* ══════════════════════════════════════════════ */

    /* Hide sidebar nav + title on ALL my-account pages */
    .woocommerce-account .woocommerce-MyAccount-navigation { display: none !important; }
    .woocommerce-account .entry-header,
    .woocommerce-account .entry-title { display: none !important; }
    .woocommerce-account .woocommerce-MyAccount-content {
        width: 100% !important; float: none !important;
        max-width: 800px; margin: 0 auto;
        padding: 0 !important; border: none !important;
        box-shadow: none !important; background: transparent !important;
    }
    /* Back to dashboard link on sub-pages */
    .sam-back-link {
        display: inline-flex; align-items: center; gap: 6px;
        color: #000033; font-size: 13px; font-weight: 600;
        text-decoration: none; margin-bottom: 16px;
    }
    /* .sam-ma-nav / .sam-ma-item: movido a sam-cuenta.css (sección 16, al
       final) el 2026-08-21, reescrito con los tokens --sam-c-*. Vivía acá
       con hex sueltos; con 10 items (se sumó "Avisos") necesitaba revisar
       el grid de todas formas, así que se aprovechó para unificarlo con el
       resto del sistema de diseño en vez de duplicarlo otra vez. */
    .woocommerce-account .woocommerce-MyAccount-content h2,
    .woocommerce-account .woocommerce-MyAccount-content h3 {
        font-weight: 800; color: #000033; margin-bottom: 16px;
    }

    /* Orders table */
    .woocommerce-account .woocommerce-orders-table {
        width: 100%; border-collapse: collapse;
    }
    .woocommerce-account .woocommerce-orders-table th {
        background: #f1f5f9; padding: 12px 16px; text-align: left;
        font-size: 12px; font-weight: 700; text-transform: uppercase;
        letter-spacing: 0.5px; color: #64748b; border-bottom: 2px solid #e2e8f0;
    }
    .woocommerce-account .woocommerce-orders-table td {
        padding: 14px 16px; border-bottom: 1px solid #f1f5f9;
        font-size: 14px; vertical-align: middle;
    }
    .woocommerce-account .woocommerce-orders-table tbody tr:hover { background: #f8fafc; }
    .woocommerce-account .woocommerce-orders-table .woocommerce-orders-table__cell-order-actions a {
        background: #000033; color: #fff !important; padding: 6px 14px;
        border-radius: 6px; font-size: 12px; font-weight: 600;
        text-decoration: none; display: inline-block; margin: 2px;
    }
    .woocommerce-account .woocommerce-orders-table .woocommerce-orders-table__cell-order-actions a:hover {
        background: #000066;
    }

    /* Forms — edit-account, edit-address.
       Los inputs ya tenían estilo SAM, pero el FORM no era una tarjeta: quedaba
       transparente y los campos flotaban sueltos (el resto del sitio va en
       tarjetas blancas redondeadas). Se les da el mismo lenguaje. */
    .woocommerce-account .woocommerce-EditAccountForm,
    .woocommerce-account .woocommerce-address-fields {
        max-width: 640px;
        background: #fff; border: 1px solid #dbe6f8; border-radius: 16px;
        padding: 22px 22px 20px; box-shadow: 0 4px 14px rgba(0,0,51,.06);
    }
    /* Fila de 2 columnas prolija (Nombre / Apellidos) */
    .woocommerce-account .woocommerce-MyAccount-content .form-row-first,
    .woocommerce-account .woocommerce-MyAccount-content .form-row-last {
        width: 48%; float: none; display: inline-block; vertical-align: top;
    }
    .woocommerce-account .woocommerce-MyAccount-content .form-row-first { margin-right: 3%; }
    @media (max-width: 600px) {
        .woocommerce-account .woocommerce-MyAccount-content .form-row-first,
        .woocommerce-account .woocommerce-MyAccount-content .form-row-last { width: 100%; margin-right: 0; }
    }
    /* "Cambio de contraseña" como separador de sección, no texto suelto */
    .woocommerce-account .woocommerce-MyAccount-content fieldset {
        border: 0; border-top: 1px solid #eef2f7; margin: 18px 0 0; padding: 16px 0 0;
    }
    .woocommerce-account .woocommerce-MyAccount-content fieldset legend {
        font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .4px;
        color: #000033; padding: 0; margin-bottom: 8px;
    }
    /* (el estilo del botón de acción vive más abajo, en una sola regla) */
    /* ── Pestaña "Dirección": las tarjetas de dirección venían crudas (caja plana
       con cabecera gris y el "Editar" como link). Mismo lenguaje que la ficha. ── */
    .woocommerce-account .woocommerce-Addresses { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
    .woocommerce-account .woocommerce-Address {
        background: #fff; border: 1px solid #dbe6f8; border-radius: 16px;
        overflow: hidden; box-shadow: 0 4px 14px rgba(0,0,51,.06); width: auto !important; float: none !important;
    }
    /* Con una sola dirección habilitada Woo no imprime .woocommerce-Addresses:
       la tarjeta queda sola y sin tope de ancho se estira a todo el contenido. */
    .woocommerce-account .woocommerce-MyAccount-content > .woocommerce-Address { max-width: 460px; }
    /* !important: la hoja de WooCommerce carga después de este <style> y su
       `.woocommerce .woocommerce-Address-title` empata en especificidad. */
    .woocommerce-account .woocommerce-Address-title {
        background: linear-gradient(135deg, #000033 0%, #1e40af 100%) !important;
        padding: 13px 18px !important; margin: 0 !important; border: 0 !important;
        display: flex; align-items: center;
        justify-content: space-between; gap: 12px; flex-wrap: wrap;
    }
    .woocommerce-account .woocommerce-Address-title h2,
    .woocommerce-account .woocommerce-Address-title h3 {
        margin: 0 !important; color: #fff !important; font-size: 12.5px !important;
        font-weight: 800 !important; text-transform: uppercase; letter-spacing: .5px;
        border: 0 !important; padding: 0 !important;
    }
    .woocommerce-account .woocommerce-Address-title a.edit {
        background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.35);
        color: #fff !important; border-radius: 999px; padding: 6px 14px;
        font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .4px;
        text-decoration: none !important; transition: background .15s;
    }
    .woocommerce-account .woocommerce-Address-title a.edit:hover { background: rgba(255,255,255,.28); }
    .woocommerce-account .woocommerce-Address address {
        margin: 0; padding: 16px 18px; font-style: normal; font-size: 13.5px;
        line-height: 1.7; color: #334155; border: 0;
    }
    .woocommerce-account .woocommerce-MyAccount-content .form-row label {
        font-size: 13px; font-weight: 600; color: #374151; margin-bottom: 4px; display: block;
    }
    .woocommerce-account .woocommerce-MyAccount-content input[type="text"],
    .woocommerce-account .woocommerce-MyAccount-content input[type="email"],
    .woocommerce-account .woocommerce-MyAccount-content input[type="tel"],
    .woocommerce-account .woocommerce-MyAccount-content input[type="password"],
    .woocommerce-account .woocommerce-MyAccount-content select,
    .woocommerce-account .woocommerce-MyAccount-content textarea {
        border: 1px solid #e2e8f0 !important; border-radius: 8px !important;
        padding: 10px 14px !important; font-size: 14px !important;
        width: 100% !important; transition: border-color 0.2s;
        color: #1e293b;
    }
    .woocommerce-account .woocommerce-MyAccount-content input:focus,
    .woocommerce-account .woocommerce-MyAccount-content select:focus {
        border-color: #3399FF !important; outline: none !important;
        box-shadow: 0 0 0 3px rgba(51,153,255,0.1) !important;
    }

    /* Ojo de "ver contraseña" (2026-07-31) — en Mi Cuenta salía como un botón vacío
       con borde DEBAJO de cada campo de contraseña. Dos causas:
         1. las reglas de WooCommerce que lo posicionan dentro del campo no llegan
            a este layout propio, así que el <button> caía en el flujo normal;
         2. el glifo del ojo es un ::after con font-family WooCommerce, y la
            tipografía global fuerza var(--sam-font) !important en `button` → el
            carácter de la fuente de iconos quedaba en blanco.
       Se posiciona a mano dentro del input y el ícono pasa a ser un SVG en
       background (no depende de ninguna fuente de iconos). */
    .woocommerce-account .woocommerce-MyAccount-content .password-input {
        display: block !important; position: relative !important;
    }
    .woocommerce-account .woocommerce-MyAccount-content .password-input input[type="password"],
    .woocommerce-account .woocommerce-MyAccount-content .password-input input[type="text"] {
        padding-right: 46px !important;
    }
    .woocommerce-account .woocommerce-MyAccount-content button.show-password-input,
    .woocommerce-account .woocommerce-MyAccount-content .show-password-input {
        position: absolute !important; top: 50% !important; right: 7px !important; left: auto !important;
        transform: translateY(-50%) !important;
        width: 32px !important; height: 32px !important; min-width: 0 !important; min-height: 0 !important;
        margin: 0 !important; padding: 0 !important; border: 0 !important;
        background-color: transparent !important; box-shadow: none !important;
        border-radius: 8px !important; cursor: pointer !important;
        font-size: 0 !important; line-height: 0 !important; text-indent: -9999px !important;
        overflow: hidden !important; opacity: .65; transition: opacity .15s ease, background-color .15s ease;
        background-repeat: no-repeat !important; background-position: center !important;
        background-size: 19px 19px !important;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000033' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E") !important;
    }
    .woocommerce-account .woocommerce-MyAccount-content .show-password-input::after,
    .woocommerce-account .woocommerce-MyAccount-content .show-password-input::before { content: none !important; }
    .woocommerce-account .woocommerce-MyAccount-content .show-password-input:hover {
        opacity: 1; background-color: #f1f5f9 !important;
    }
    /* WooCommerce agrega .display-password mientras la contraseña está visible */
    .woocommerce-account .woocommerce-MyAccount-content .show-password-input.display-password {
        opacity: 1;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231e40af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24'/%3E%3Cline x1='1' y1='1' x2='23' y2='23'/%3E%3C/svg%3E") !important;
    }

    /* Buttons */
    /* Botones de acción de Mi Cuenta = píldora con el degradado de marca (antes
       eran navy plano con radio 8px, que no calzaba con el resto del sitio).
       Esta es la ÚNICA regla del botón: va después de las de arriba, así que
       cualquier estilo de botón para Mi Cuenta se define acá. */
    .woocommerce-account .woocommerce-MyAccount-content .woocommerce-Button,
    .woocommerce-account .woocommerce-MyAccount-content button[type="submit"],
    .woocommerce-account .woocommerce-MyAccount-content input[type="submit"] {
        background: linear-gradient(120deg, #1e40af, #1e6fd0) !important; color: #fff !important;
        border: none !important; border-radius: 999px !important;
        padding: 12px 26px !important; font-size: 12.5px !important;
        font-weight: 800 !important; text-transform: uppercase; letter-spacing: .5px;
        cursor: pointer !important; box-shadow: 0 6px 18px rgba(30,64,175,.28);
        transition: transform .15s, box-shadow .2s, filter .15s !important;
    }
    .woocommerce-account .woocommerce-MyAccount-content .woocommerce-Button:hover,
    .woocommerce-account .woocommerce-MyAccount-content button[type="submit"]:hover,
    .woocommerce-account .woocommerce-MyAccount-content input[type="submit"]:hover {
        filter: brightness(1.06); transform: translateY(-2px);
        box-shadow: 0 10px 26px rgba(0,0,51,.28);
    }
    /* El botón del ojo (ver contraseña) NO es un botón de acción: se excluye. */
    .woocommerce-account .woocommerce-MyAccount-content button.show-password-input {
        background: transparent !important; box-shadow: none !important; padding: 0 !important;
    }

    /* (Las tarjetas de dirección se definen arriba, en un solo bloque: el estilo
       viejo de caja gris con botón navy cuadrado vivía acá y, por ser posterior
       y más específico, pisaba la tarjeta nueva cuando había 2 direcciones.) */

    /* SAM Pesos page */
    .woocommerce-account .sam-pesos-wrap {
        background: #f8fafc; border-radius: 10px; padding: 24px;
        border: 1px solid #e2e8f0;
    }

    /* Mobile */
    @media (max-width: 768px) {
        .woocommerce-account .woocommerce-MyAccount-content {
            padding: 16px; border-radius: 10px;
        }
        .woocommerce-account .woocommerce-Addresses {
            grid-template-columns: 1fr;
        }
        .woocommerce-account .woocommerce-orders-table th,
        .woocommerce-account .woocommerce-orders-table td {
            padding: 8px 10px; font-size: 12px;
        }
    }