/* Mi Cuenta — login page + logged-in dashboard */

/* ── VER PEDIDO — overview bar ───────────────────────────── */

.shopcl-order-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 0;
    margin: 0 0 2rem;
    list-style: none;
}
.shopcl-order-bar li {
    flex: 1 1 140px;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.shopcl-order-bar li > span {
    font-size: 0.72rem;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #888;
}
.shopcl-order-bar li > strong {
    font-family: Inter, sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    color: #222;
}

/* ── VER PEDIDO — two-column layout ──────────────────────── */

.shopcl-order-layout {
    display: grid;
    grid-template-columns: 1fr 260px;
    gap: 1.5rem;
    align-items: start;
    margin-bottom: 2rem;
}

/* Address column */
.shopcl-order-layout .woocommerce-customer-details {
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    padding: 1.25rem 1.5rem;
}
.shopcl-order-layout .woocommerce-customer-details address {
    font-style: normal;
    font-size: 0.9rem;
    line-height: 1.65;
    color: #333;
}

@media (max-width: 640px) {
    .shopcl-order-layout {
        grid-template-columns: 1fr;
    }
}

/* Customer note card — below order table */
.shopcl-order-note {
    border-left: 3px solid #198FCE;
    background: rgba(25, 143, 206, 0.04);
    border-radius: 0 6px 6px 0;
    padding: 0.85rem 1.1rem;
    margin: 1rem 0 1.5rem;
}
.shopcl-order-note-label {
    display: block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #198FCE;
    margin-bottom: 0.35rem;
}
.shopcl-order-note-text {
    margin: 0;
    font-size: 0.9rem;
    color: #333;
    line-height: 1.5;
}

/* Hide email from shipping address block (ver-pedido) */
.woocommerce-customer-details--email {
    display: none !important;
}

/* Hide custom fields table (RUT — shown in billing address, not needed here) */
.woocommerce-table--custom-fields {
    display: none !important;
}

/* Hide Acciones row (tracking button from shipment plugin) — not useful in this layout */
.order_details tfoot tr:has(a.woocommerce-button) {
    display: none !important;
}

/* Totals table: label + value on the same line (mobile stacks them by default) */
@media (max-width: 768px) {
    .order_details tfoot tr {
        display: flex !important;
        justify-content: space-between;
        align-items: baseline;
        padding: 0.45rem 0;
        border-bottom: 1px solid #f0f0f0;
    }
    .order_details tfoot th,
    .order_details tfoot td {
        display: block !important;
        padding: 0 !important;
        border: none !important;
        width: auto !important;
    }
    .order_details tfoot th {
        color: #888;
        font-size: 0.85rem;
    }
    .order_details tfoot td {
        text-align: right;
        font-weight: 600;
    }
}

/* Order status colors */
.shopcl-order-status.status-processing   { color: #198FCE; }
.shopcl-order-status.status-completed    { color: #27ae60; }
.shopcl-order-status.status-on-hold      { color: #e67e22; }
.shopcl-order-status.status-pending      { color: #888; }
.shopcl-order-status.status-cancelled,
.shopcl-order-status.status-failed       { color: #c0392b; }
.shopcl-order-status.status-refunded     { color: #888; }

/* Product image row — shared with thank you page */
.shopcl-order-item-row {
    display: flex;
    align-items: center;
    gap: 12px;
}
.shopcl-order-item-row img {
    width: 52px;
    height: 52px;
    object-fit: contain;
    flex-shrink: 0;
    border: 1px solid #f0f0f0;
    background: #fff;
    border-radius: 4px;
}
.shopcl-order-item-name {
    flex: 1;
}
.shopcl-item-qty {
    display: block;
    font-size: 0.75rem;
    color: #888;
    margin-top: 2px;
}

/* ── ACCOUNT-WIDE CONSISTENCY ────────────────────────────── */

/* Normalize all WC headings in account content to JetBrains Mono small-caps */
.woocommerce-account .woocommerce-MyAccount-content h2,
.woocommerce-account .woocommerce-MyAccount-content h3 {
    font-family: 'JetBrains Mono', monospace !important;
    font-size: 0.82rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.08em !important;
    color: #888 !important;
    margin-bottom: 1.25rem !important;
}

/* Normalize WC submit/link buttons in account content → brand blue
   Excludes wishlist product-action buttons (Lo Encargo, Pre-Order keep their colors) */
.woocommerce-account .woocommerce-MyAccount-content .woocommerce-orders-table .button,
.woocommerce-account .woocommerce-MyAccount-content [name="save_address"] {
    background-color: #198FCE !important;
    border-color: #198FCE !important;
    color: #fff !important;
}
.woocommerce-account .woocommerce-MyAccount-content .woocommerce-orders-table .button:hover,
.woocommerce-account .woocommerce-MyAccount-content [name="save_address"]:hover {
    background-color: #1478b0 !important;
    border-color: #1478b0 !important;
}

/* ── LOGIN PAGE ──────────────────────────────────────────── */

.u-column2.col-2 {
    display: none;
}
.u-column2.col-2[style*="display: block"] {
    margin-bottom: 3rem;
}
@media (max-width: 768px) {
    .u-column2.col-2[style*="display: block"] {
        margin-top: -1rem;
    }
}

/* Hide newsletter bar on the login screen */
.below-content {
    display: none;
}

/* Mute the forgot password link — utility action, not a CTA */
.u-column1 .woocommerce-LostPassword {
    margin-top: 0.25rem;
    margin-bottom: 0.75rem;
}
.u-column1 .woocommerce-LostPassword a {
    font-size: 0.82rem;
    color: #888;
    text-decoration: none;
}
.u-column1 .woocommerce-LostPassword a:hover {
    color: #555;
    text-decoration: underline;
}

/* Acceder button — checkbox left, button right */
.u-column1 p:has(> .woocommerce-form-login__submit) {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0;
}

/* Registrarse button — right-aligned */
.u-column2 p:has(> .woocommerce-form-register__submit) {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 0;
}

/* Separator + register toggle */
.shopcl-register-toggle-wrap {
    margin-top: 1.5rem;
    margin-bottom: 3rem;
    padding-top: 1.25rem;
    border-top: 1px solid #e8e8e8;
}
.shopcl-register-toggle {
    display: inline-block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.15rem;
    font-weight: 700;
    color: #198FCE;
    cursor: pointer;
    text-decoration: none;
}
.shopcl-register-toggle:hover {
    text-decoration: underline;
}

/* ── LOGGED-IN DASHBOARD ─────────────────────────────────── */

/* Hide sidebar, make content full-width */
.woocommerce-account.logged-in .woocommerce-MyAccount-navigation {
    display: none !important;
}
.woocommerce-account.logged-in .woocommerce-MyAccount-content {
    float: none !important;
    width: 100% !important;
}

/* Tab bar — boxed grid, matches dashboard card style */
.shopcl-account-tabs {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.5rem;
    margin-bottom: 2rem;
}
.shopcl-account-tabs a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    padding: 0.85rem 0.5rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    font-weight: 600;
    color: #666;
    text-decoration: none;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    text-align: center;
    white-space: normal;
    line-height: 1.2;
    transition: color 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.shopcl-account-tabs a svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}
.shopcl-account-tabs a:hover {
    color: #198FCE;
    border-color: #198FCE;
    box-shadow: 0 2px 8px rgba(25, 143, 206, 0.1);
}
.shopcl-account-tabs a.is-active {
    color: #198FCE;
    border-color: #198FCE;
    background: rgba(25, 143, 206, 0.06);
}
.shopcl-account-tabs a.is-logout {
    color: #c0392b;
}
.shopcl-account-tabs a.is-logout:hover {
    border-color: #c0392b;
    box-shadow: none;
}

@media (max-width: 768px) {
    .shopcl-account-tabs {
        grid-template-columns: repeat(3, 1fr);
        margin-bottom: 1.5rem;
    }
}

/* Greeting */
.shopcl-dashboard-greeting {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    color: #333;
}
.shopcl-dashboard-greeting strong {
    color: #198FCE;
}

/* ── DIRECCIÓN PAGE ──────────────────────────────────────── */

.shopcl-address-card {
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    padding: 1.75rem;
    max-width: 420px;
    margin-bottom: 3rem;
}
.shopcl-address-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #888;
    margin-bottom: 1.25rem !important;
}
.shopcl-address-fields {
    margin: 0 0 1.25rem;
}
.shopcl-address-row {
    display: flex;
    gap: 1rem;
    padding: 0.45rem 0;
    border-bottom: 1px solid #f0f0f0;
}
.shopcl-address-row:last-child {
    border-bottom: none;
}
.shopcl-address-row dt {
    font-size: 0.8rem;
    color: #999;
    width: 90px;
    flex-shrink: 0;
    padding-top: 0.05rem;
}
.shopcl-address-row dd {
    font-size: 0.95rem;
    color: #333;
    margin: 0;
}
.shopcl-address-empty {
    color: #888;
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
}
.shopcl-address-edit {
    display: inline-block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.82rem;
    font-weight: 600;
    color: #198FCE;
    text-decoration: none;
    border: 1px solid #198FCE;
    border-radius: 4px;
    padding: 0.4rem 1rem;
    transition: background 0.15s, color 0.15s;
}
.shopcl-address-edit:hover {
    background: #198FCE;
    color: #fff;
}

/* Edit-address form heading — match card style, not WC default blue h3 */
.woocommerce-address-fields h3 {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #888;
    margin-bottom: 1.5rem !important;
}

/* Email field is an account-level setting — hide it from the address edit form */
.woocommerce-address-fields #billing_email_field {
    display: none !important;
}

/* ── MI CUENTA (edit-account) ────────────────────────────── */

/* Two-column layout: personal div left, password fieldset right */
.woocommerce-EditAccountForm {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 0;
    max-width: 780px;
    margin-bottom: 3rem;
    align-items: start;
}

/* Left column — personal fields */
.shopcl-edit-account-personal {
    padding-right: 2.5rem;
}

/* Section heading — same style as address title */
.shopcl-section-heading {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #888;
    margin-bottom: 1.25rem !important;
}

/* Right column — password section, left border divider */
.shopcl-edit-account-password {
    border-left: 1px solid #e8e8e8;
    padding: 0 0 0 2.5rem;
}

/* Submit button — brand blue */
.shopcl-edit-account-submit .woocommerce-Button {
    background-color: #198FCE !important;
    border-color: #198FCE !important;
    color: #fff !important;
    margin-top: 0.5rem;
}
.shopcl-edit-account-submit .woocommerce-Button:hover {
    background-color: #1478b0 !important;
    border-color: #1478b0 !important;
}

/* Mobile — stack */
@media (max-width: 600px) {
    .woocommerce-EditAccountForm {
        grid-template-columns: 1fr;
    }
    .shopcl-edit-account-personal {
        padding-right: 0;
    }
    .shopcl-edit-account-password {
        border-left: none;
        border-top: 1px solid #e8e8e8;
        padding: 1.5rem 0 0;
    }
}

/* Sub-pages (Pedidos, Dirección, Detalles) — constrain width */
.woocommerce-account.logged-in .woocommerce-MyAccount-content.is-sub-page {
    max-width: 960px;
}

/* Quick-action cards */
.shopcl-dashboard-greeting,
.shopcl-dashboard-cards {
    margin-bottom: 3rem;
}
.shopcl-dashboard-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}
@media (max-width: 768px) {
    .shopcl-dashboard-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}
.shopcl-dashboard-card {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1.5rem;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.shopcl-dashboard-card:hover {
    border-color: #198FCE;
    box-shadow: 0 2px 8px rgba(25, 143, 206, 0.1);
}
.shopcl-dashboard-card svg {
    width: 28px;
    height: 28px;
    stroke: #198FCE;
    fill: none;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}
.shopcl-dashboard-card-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    font-weight: 700;
    color: #222;
    transition: color 0.15s;
}
.shopcl-dashboard-card:hover .shopcl-dashboard-card-label {
    color: #198FCE;
}
.shopcl-dashboard-card-sub {
    font-size: 0.8rem;
    color: #888;
}

/* ── MIS PEDIDOS — desktop table polish ─────────────────────── */

/* Column headers */
.account-orders-table thead th {
    font-family: 'JetBrains Mono', monospace !important;
    font-size: 0.72rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.06em !important;
    color: #888 !important;
}

/* Order number link */
.account-orders-table .woocommerce-orders-table__cell-order-number a {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    color: #198FCE;
    text-decoration: none;
}

/* Row hover */
.account-orders-table tbody tr:hover {
    background: #fafbfc;
}

/* Status pill — all viewports */
.shopcl-status-pill {
    display: inline-block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.3rem 0.75rem;
    border-radius: 20px;
    line-height: 1;
}
.woocommerce-orders-table__row--status-processing .shopcl-status-pill {
    color: #198FCE;
    background: rgba(25, 143, 206, 0.08);
}
.woocommerce-orders-table__row--status-completed .shopcl-status-pill {
    color: #27ae60;
    background: rgba(39, 174, 96, 0.08);
}
.woocommerce-orders-table__row--status-on-hold .shopcl-status-pill {
    color: #e67e22;
    background: rgba(230, 126, 34, 0.08);
}
.woocommerce-orders-table__row--status-pending .shopcl-status-pill,
.woocommerce-orders-table__row--status-refunded .shopcl-status-pill {
    color: #888;
    background: #f5f5f5;
}
.woocommerce-orders-table__row--status-cancelled .shopcl-status-pill,
.woocommerce-orders-table__row--status-failed .shopcl-status-pill {
    color: #c0392b;
    background: rgba(192, 57, 43, 0.08);
}

/* ── MIS PEDIDOS — mobile card layout ───────────────────────── */

@media (max-width: 768px) {

    /* Hide table header */
    .account-orders-table thead {
        display: none !important;
    }

    /* Each row → card */
    .account-orders-table tbody tr {
        display: grid !important;
        grid-template-columns: 1fr auto !important;
        grid-template-areas:
            "number  status"
            "date    total"
            "actions actions" !important;
        gap: 0.25rem 0.75rem !important;
        border: 1px solid #e8e8e8 !important;
        border-radius: 8px !important;
        padding: 1rem 1.25rem !important;
        margin-bottom: 0.75rem !important;
        background: #fff !important;
    }

    /* Suppress data-title ::before labels */
    .account-orders-table.shop_table_responsive tbody th::before,
    .account-orders-table.shop_table_responsive tbody td::before {
        display: none !important;
    }

    /* Remove default padding/borders from all cells */
    .account-orders-table tbody th,
    .account-orders-table tbody td {
        padding: 0 !important;
        border: none !important;
        text-align: left !important;
    }

    /* Grid area assignments */
    .account-orders-table .woocommerce-orders-table__cell-order-number {
        grid-area: number !important;
        align-self: center;
    }
    .account-orders-table .woocommerce-orders-table__cell-order-status {
        grid-area: status !important;
        align-self: center;
        justify-self: end;
        padding: 0 !important;
    }
    .account-orders-table .woocommerce-orders-table__cell-order-date {
        grid-area: date !important;
        align-self: center;
        font-size: 0.85rem;
        color: #888;
    }
    .account-orders-table .woocommerce-orders-table__cell-order-total {
        grid-area: total !important;
        align-self: center;
        justify-self: end;
        text-align: right !important;
        font-weight: 600;
        font-size: 0.95rem;
    }
    .account-orders-table .woocommerce-orders-table__cell-order-actions {
        grid-area: actions !important;
        margin-top: 0.5rem;
        padding-top: 0.75rem !important;
        border-top: 1px solid #f0f0f0 !important;
    }

    /* Order number link */
    .account-orders-table .woocommerce-orders-table__cell-order-number a {
        font-family: 'JetBrains Mono', monospace;
        font-size: 1rem;
        font-weight: 700;
        color: #198FCE;
        text-decoration: none;
    }

    /* Actions cell — stacked buttons with breathing room */
    .account-orders-table .woocommerce-orders-table__cell-order-actions {
        display: flex !important;
        flex-direction: column;
        gap: 0.5rem;
    }

    /* Actions buttons — full width, generous touch target */
    .account-orders-table .woocommerce-orders-table__cell-order-actions .button {
        display: block !important;
        width: 100% !important;
        text-align: center !important;
        box-sizing: border-box !important;
        font-size: 0.9rem !important;
        padding: 0.75rem 1rem !important;
    }
}

/* ── ORDER UPDATES (ver-pedido — gateway notes like "Pago aprobado") ── */
.woocommerce-MyAccount-content > h2:has(+ ol.woocommerce-OrderUpdates) {
    display: none !important;
}
ol.woocommerce-OrderUpdates {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 0 1.5rem 0 !important;
}
.woocommerce-OrderUpdate {
    border-left: 3px solid #27ae60 !important;
    background: rgba(39, 174, 96, 0.04) !important;
    border-radius: 0 6px 6px 0 !important;
    padding: 0.85rem 1.1rem !important;
    margin: 0 !important;
}
.woocommerce-OrderUpdate-meta {
    font-family: 'JetBrains Mono', monospace !important;
    font-size: 0.72rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.06em !important;
    color: #27ae60 !important;
    margin-bottom: 0.25rem !important;
}
.woocommerce-OrderUpdate-description p {
    margin: 0 !important;
    font-size: 0.9rem !important;
    color: #333 !important;
    line-height: 1.5 !important;
}
