/* =========================================================
   CANARYMX · MI CUENTA
   Solo la zona de clientes. El fondo general de la tienda
   sigue viniendo de shop.css.
   ========================================================= */

body.woocommerce-account {
    --canarymx-account-bg: #101010;
    --canarymx-account-panel: #171717;
    --canarymx-account-field: #222222;
    --canarymx-account-text: #ffffff;
    --canarymx-account-muted: #cccccc;
    --canarymx-account-accent: #ef4444;
    --canarymx-account-border: #383838;
    color: var(--canarymx-account-text);
}

/* Astra pinta el lienzo blanco con esta variable y otra regla la pisa en :root. */
body.woocommerce-account,
body.woocommerce-account .site,
body.woocommerce-account .site-content,
body.woocommerce-account .ast-container,
body.woocommerce-account .site-main,
body.woocommerce-account article,
body.woocommerce-account .ast-article-single,
body.woocommerce-account .entry-content,
body.woocommerce-account .woocommerce {
    --ast-global-color-5: #101010 !important;
}


/* ---------------------------------------------------------
   LIENZO
   Astra pinta el artículo de blanco y tapa el panel oscuro
   de .site-main. Misma corrección que en el carrito.
   --------------------------------------------------------- */

body.woocommerce-account article,
body.woocommerce-account .ast-article-single,
body.woocommerce-account .ast-article-inner,
body.woocommerce-account .entry-header,
body.woocommerce-account .entry-content,
body.woocommerce-account .woocommerce {
    background: transparent !important;
    box-shadow: none;
}

body.woocommerce-account .entry-title,
body.woocommerce-account h1 {
    color: var(--canarymx-account-text) !important;
}


/* ---------------------------------------------------------
   CONTENEDORES
   --------------------------------------------------------- */

body.woocommerce-account .woocommerce-MyAccount-navigation,
body.woocommerce-account .woocommerce-MyAccount-content,
body.woocommerce-account #customer_login .u-column1,
body.woocommerce-account #customer_login .u-column2,
body.woocommerce-account form.woocommerce-ResetPassword,
body.woocommerce-account form.lost_reset_password {
    background: var(--canarymx-account-panel);
    border: 1px solid var(--canarymx-account-border);
    border-radius: 8px;
    box-sizing: border-box;
    color: var(--canarymx-account-muted);
}

body.woocommerce-account .woocommerce-MyAccount-content,
body.woocommerce-account #customer_login .u-column1,
body.woocommerce-account #customer_login .u-column2,
body.woocommerce-account form.woocommerce-ResetPassword,
body.woocommerce-account form.lost_reset_password {
    padding: 24px;
}

body.woocommerce-account .entry-title,
body.woocommerce-account .woocommerce h2,
body.woocommerce-account .woocommerce h3,
body.woocommerce-account .woocommerce legend {
    color: var(--canarymx-account-text);
}

body.woocommerce-account .woocommerce-MyAccount-content p,
body.woocommerce-account .woocommerce-MyAccount-content .woocommerce-order-overview,
body.woocommerce-account .woocommerce address,
body.woocommerce-account .woocommerce-privacy-policy-text {
    color: var(--canarymx-account-muted);
}

body.woocommerce-account .woocommerce a:not(.button) {
    color: var(--canarymx-account-accent);
}

body.woocommerce-account .woocommerce a:not(.button):hover,
body.woocommerce-account .woocommerce a:not(.button):focus {
    color: var(--canarymx-account-text);
}


/* ---------------------------------------------------------
   NAVEGACIÓN
   --------------------------------------------------------- */

body.woocommerce-account .woocommerce-MyAccount-navigation ul {
    margin: 0;
    padding: 0;
    list-style: none;
    overflow: hidden;
    background: var(--canarymx-account-panel);
    border-radius: 8px;
}

body.woocommerce-account .woocommerce-MyAccount-navigation ul li {
    margin: 0;
    border-bottom: 1px solid var(--canarymx-account-border);
    background: transparent;
}

body.woocommerce-account .woocommerce-MyAccount-navigation ul li:last-child {
    border-bottom: 0;
}

body.woocommerce-account .woocommerce-MyAccount-navigation ul li a {
    display: block;
    padding: 14px 16px;
    background: transparent;
    color: var(--canarymx-account-muted);
    text-decoration: none;
}

body.woocommerce-account .woocommerce-MyAccount-navigation ul li a:hover,
body.woocommerce-account .woocommerce-MyAccount-navigation ul li a:focus {
    background: var(--canarymx-account-field);
    color: var(--canarymx-account-text);
    outline: none;
}

body.woocommerce-account .woocommerce-MyAccount-navigation ul li.is-active a {
    background: var(--canarymx-account-bg);
    color: var(--canarymx-account-accent);
    box-shadow: inset 3px 0 0 var(--canarymx-account-accent);
}


/* ---------------------------------------------------------
   PEDIDOS, DESCARGAS Y DETALLE
   --------------------------------------------------------- */

body.woocommerce-account table.shop_table {
    width: 100%;
    margin: 0 0 24px;
    background: var(--canarymx-account-panel);
    border: 1px solid var(--canarymx-account-border);
    border-collapse: collapse;
    border-radius: 8px;
    color: var(--canarymx-account-text);
}

body.woocommerce-account table.shop_table th,
body.woocommerce-account table.shop_table td {
    padding: 14px 16px;
    border: 1px solid var(--canarymx-account-border);
    background: var(--canarymx-account-panel);
    color: var(--canarymx-account-text);
}

body.woocommerce-account table.shop_table thead th {
    background: var(--canarymx-account-bg);
    color: var(--canarymx-account-text);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

body.woocommerce-account table.shop_table tbody tr:nth-child(even) td {
    background: var(--canarymx-account-bg);
}

body.woocommerce-account table.shop_table a:not(.button) {
    color: var(--canarymx-account-accent);
    font-weight: 600;
}

body.woocommerce-account mark,
body.woocommerce-account .order-status {
    background: transparent;
    color: var(--canarymx-account-text);
    font-weight: 700;
}

body.woocommerce-account .woocommerce-customer-details address,
body.woocommerce-account .woocommerce-Address address,
body.woocommerce-account .woocommerce-column--billing-address address,
body.woocommerce-account .woocommerce-column--shipping-address address {
    display: block;
    margin: 0;
    padding: 16px;
    background: var(--canarymx-account-bg);
    border: 1px solid var(--canarymx-account-border);
    border-radius: 8px;
    color: var(--canarymx-account-muted);
    font-style: normal;
    line-height: 1.6;
}

body.woocommerce-account .canarymx-purchase-receipt,
body.woocommerce-account .canarymx-rental-receipt {
    margin: 16px 0 0;
}

body.woocommerce-account .canarymx-purchase-receipt a.button,
body.woocommerce-account .canarymx-rental-receipt a.button {
    display: inline-block;
}


/* ---------------------------------------------------------
   BOTONES
   --------------------------------------------------------- */

body.woocommerce-account .woocommerce a.button,
body.woocommerce-account .woocommerce button.button,
body.woocommerce-account .woocommerce input.button,
body.woocommerce-account .woocommerce #respond input#submit {
    background: var(--canarymx-account-accent);
    border: 0;
    border-radius: 4px;
    color: var(--canarymx-account-text);
    font-weight: 700;
    line-height: 1.2;
    padding: 12px 18px;
    text-decoration: none;
}

body.woocommerce-account .woocommerce a.button:hover,
body.woocommerce-account .woocommerce button.button:hover,
body.woocommerce-account .woocommerce input.button:hover,
body.woocommerce-account .woocommerce #respond input#submit:hover,
body.woocommerce-account .woocommerce a.button:focus,
body.woocommerce-account .woocommerce button.button:focus,
body.woocommerce-account .woocommerce input.button:focus {
    background: #dc2626;
    color: var(--canarymx-account-text);
    outline: 2px solid var(--canarymx-account-accent);
    outline-offset: 2px;
}


/* ---------------------------------------------------------
   FORMULARIOS
   --------------------------------------------------------- */

body.woocommerce-account #customer_login {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    align-items: start;
    width: 100%;
    max-width: 100%;
    margin: 0;
    float: none;
}

/* WooCommerce inserta un clearfix. En grid esos pseudos ocupan
   la primera celda: el acceso pasa a la derecha y el registro baja. */
body.woocommerce-account #customer_login::before,
body.woocommerce-account #customer_login::after {
    content: none;
    display: none;
}

body.woocommerce-account #customer_login > .u-column1,
body.woocommerce-account #customer_login > .col-1,
body.woocommerce-account #customer_login > .u-column2,
body.woocommerce-account #customer_login > .col-2 {
    float: none;
    clear: none;
    width: auto;
    max-width: none;
    min-width: 0;
    margin: 0;
}

body.woocommerce-account #customer_login > .u-column1 {
    grid-column: 1;
    grid-row: 1;
}

body.woocommerce-account #customer_login > .u-column2 {
    grid-column: 2;
    grid-row: 1;
}

body.woocommerce-account #customer_login form.login,
body.woocommerce-account #customer_login form.register {
    float: none;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

body.woocommerce-account #customer_login .woocommerce-form__label-for-checkbox,
body.woocommerce-account #customer_login .woocommerce-privacy-policy-text,
body.woocommerce-account #customer_login .woocommerce-password-hint {
    color: var(--canarymx-account-muted);
}

body.woocommerce-account #customer_login .woocommerce-privacy-policy-text a,
body.woocommerce-account #customer_login .lost_password a {
    color: var(--canarymx-account-accent);
}

body.woocommerce-account .woocommerce form .form-row {
    margin-bottom: 16px;
    padding: 0;
}

body.woocommerce-account .woocommerce form .form-row label {
    display: block;
    margin-bottom: 6px;
    color: var(--canarymx-account-muted);
    font-size: 13px;
    font-weight: 700;
}

body.woocommerce-account .woocommerce form .form-row label .required {
    color: var(--canarymx-account-accent);
}

body.woocommerce-account .woocommerce form .form-row input.input-text,
body.woocommerce-account .woocommerce form .form-row textarea,
body.woocommerce-account .woocommerce form .form-row select,
body.woocommerce-account .woocommerce form .form-row .select2-container .select2-selection--single {
    width: 100%;
    min-height: 48px;
    padding: 11px 14px;
    box-sizing: border-box;
    background: var(--canarymx-account-field);
    border: 1px solid var(--canarymx-account-border);
    border-radius: 4px;
    color: var(--canarymx-account-text);
    box-shadow: none;
}

body.woocommerce-account .woocommerce form .form-row textarea {
    min-height: 110px;
    resize: vertical;
}

body.woocommerce-account .woocommerce form .form-row input.input-text::placeholder,
body.woocommerce-account .woocommerce form .form-row textarea::placeholder {
    color: #9a9a9a;
    opacity: 1;
}

body.woocommerce-account .woocommerce form .form-row input.input-text:focus,
body.woocommerce-account .woocommerce form .form-row textarea:focus,
body.woocommerce-account .woocommerce form .form-row select:focus,
body.woocommerce-account .woocommerce form .form-row .select2-container--open .select2-selection--single,
body.woocommerce-account .woocommerce form .form-row .select2-container--focus .select2-selection--single {
    border-color: var(--canarymx-account-accent);
    outline: 2px solid var(--canarymx-account-accent);
    outline-offset: 1px;
}

body.woocommerce-account .woocommerce form .form-row.woocommerce-invalid input.input-text,
body.woocommerce-account .woocommerce form .form-row.woocommerce-invalid select {
    border-color: var(--canarymx-account-accent);
}

body.woocommerce-account .woocommerce form .password-input {
    display: block;
    position: relative;
}

body.woocommerce-account .woocommerce form .password-input input.input-text {
    padding-right: 48px;
}

body.woocommerce-account .woocommerce form .show-password-input {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    margin: 0;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
    color: var(--canarymx-account-text);
    line-height: 1;
}

body.woocommerce-account .woocommerce form .show-password-input::before {
    filter: brightness(0) invert(1);
    opacity: 0.9;
}

body.woocommerce-account .woocommerce form .show-password-input:hover::before,
body.woocommerce-account .woocommerce form .show-password-input:focus::before {
    opacity: 1;
}

body.woocommerce-account .woocommerce form .show-password-input:focus {
    outline: 2px solid var(--canarymx-account-accent);
    outline-offset: 2px;
}

body.woocommerce-account .select2-dropdown {
    background: var(--canarymx-account-field);
    border-color: var(--canarymx-account-border);
    color: var(--canarymx-account-text);
}

body.woocommerce-account .select2-results__option {
    color: var(--canarymx-account-text);
}

body.woocommerce-account .select2-container--default .select2-results__option--highlighted,
body.woocommerce-account .select2-container--default .select2-results__option--highlighted[aria-selected] {
    background: var(--canarymx-account-accent);
    color: var(--canarymx-account-text);
}

body.woocommerce-account .select2-container--default .select2-selection--single .select2-selection__rendered {
    color: var(--canarymx-account-text);
    line-height: 26px;
    padding-left: 0;
}

body.woocommerce-account .select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-top-color: var(--canarymx-account-muted);
}

body.woocommerce-account input[type="checkbox"],
body.woocommerce-account input[type="radio"] {
    accent-color: var(--canarymx-account-accent);
}

body.woocommerce-account .woocommerce form .form-row input.input-text:-webkit-autofill,
body.woocommerce-account .woocommerce form .form-row textarea:-webkit-autofill {
    -webkit-text-fill-color: var(--canarymx-account-text);
    caret-color: var(--canarymx-account-text);
    box-shadow: 0 0 0 1000px var(--canarymx-account-field) inset;
    transition: background-color 9999s ease-out;
}


/* ---------------------------------------------------------
   AVISOS
   --------------------------------------------------------- */

body.woocommerce-account .woocommerce-error,
body.woocommerce-account .woocommerce-info,
body.woocommerce-account .woocommerce-message,
body.woocommerce-account .woocommerce-notice {
    background: var(--canarymx-account-panel);
    border: 1px solid var(--canarymx-account-border);
    border-top: 3px solid var(--canarymx-account-accent);
    color: var(--canarymx-account-text);
}

body.woocommerce-account .woocommerce-message {
    border-top-color: #4ade80;
}

body.woocommerce-account .woocommerce-error li,
body.woocommerce-account .woocommerce-error li strong,
body.woocommerce-account .woocommerce-message,
body.woocommerce-account .woocommerce-info {
    color: var(--canarymx-account-text);
}

body.woocommerce-account .woocommerce-error::before,
body.woocommerce-account .woocommerce-info::before {
    color: var(--canarymx-account-accent);
}

body.woocommerce-account .woocommerce-message::before {
    color: #4ade80;
}

body.woocommerce-account .woocommerce-error a,
body.woocommerce-account .woocommerce-info a,
body.woocommerce-account .woocommerce-message a {
    color: var(--canarymx-account-accent);
}


/* ---------------------------------------------------------
   MÓVIL
   --------------------------------------------------------- */

@media (max-width: 768px) {
    body.woocommerce-account .woocommerce-MyAccount-navigation,
    body.woocommerce-account .woocommerce-MyAccount-content {
        float: none;
        width: 100%;
        margin: 0 0 20px;
    }

    body.woocommerce-account .woocommerce-MyAccount-navigation ul li a {
        min-height: 44px;
        padding: 14px 16px;
    }

    body.woocommerce-account #customer_login {
        grid-template-columns: minmax(0, 1fr);
    }

    body.woocommerce-account #customer_login > .u-column1,
    body.woocommerce-account #customer_login > .u-column2 {
        grid-column: 1;
        width: 100%;
    }

    body.woocommerce-account #customer_login > .u-column1 {
        grid-row: 1;
    }

    body.woocommerce-account #customer_login > .u-column2 {
        grid-row: 2;
    }

    body.woocommerce-account .woocommerce-MyAccount-content,
    body.woocommerce-account #customer_login .u-column1,
    body.woocommerce-account #customer_login .u-column2,
    body.woocommerce-account form.woocommerce-ResetPassword,
    body.woocommerce-account form.lost_reset_password {
        padding: 16px;
    }

    body.woocommerce-account table.shop_table_responsive {
        border: 0;
    }

    body.woocommerce-account table.shop_table_responsive thead {
        display: none;
    }

    body.woocommerce-account table.shop_table_responsive tr {
        display: block;
        margin: 0 0 16px;
        border: 1px solid var(--canarymx-account-border);
        border-radius: 8px;
        overflow: hidden;
    }

    body.woocommerce-account table.shop_table_responsive tr td {
        display: block;
        width: 100%;
        padding: 12px 14px;
        box-sizing: border-box;
        text-align: right;
        background: var(--canarymx-account-panel);
    }

    body.woocommerce-account table.shop_table_responsive tr td::before {
        float: left;
        color: var(--canarymx-account-muted);
        font-weight: 700;
        content: attr(data-title) ": ";
    }

    body.woocommerce-account table.shop_table_responsive tr td.woocommerce-orders-table__cell-order-actions {
        text-align: left;
    }

    body.woocommerce-account table.shop_table_responsive tr td.woocommerce-orders-table__cell-order-actions::before {
        display: none;
    }

    body.woocommerce-account table.shop_table_responsive tr td .button {
        display: inline-block;
        margin: 4px 8px 4px 0;
    }

    body.woocommerce-account .woocommerce form .form-row-first,
    body.woocommerce-account .woocommerce form .form-row-last {
        float: none;
        width: 100%;
    }
}
