/* CTC Mi compte: estètica del club (acord amb la web: acord lima, titulars Roboto 800 cursiva, botons en píndola). */
:root {
    --ctc-ink: #181818;
    --ctc-body: #444444;
    --ctc-lime: #d1ff6d;
    --ctc-paper: #ffffff;
    --ctc-line: #e4e4e4;
    --ctc-muted: #6b6b6b;
    --ctc-radius-card: 16px;
    --ctc-radius-pill: 40px;
    --ctc-font-display: "Roboto", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
}

/* ---------- Capçalera: icona de compte (la insereix includes/class-header-icon.php, abans del carretó) ----------
   Mateixa mida, color i opacitat de hover que el carretó del tema (a.wgl-cart: 26 px, color heretat, icona de 24 px). */
.mini-cart:has(> .ctc-account-icon) { display: flex; align-items: center; gap: 14px; }
.mini-cart > a.ctc-account-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    color: #ffffff;
    font-size: 16px;
    text-decoration: none;
    transition: opacity .2s ease;
}
.mini-cart > a.ctc-account-icon:hover,
.mini-cart > a.ctc-account-icon:focus-visible { opacity: .7; }
.mini-cart > a.ctc-account-icon:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
.mini-cart > a.ctc-account-icon .ctc-account-icon__glyph { display: flex; font-style: normal; }
.mini-cart > a.ctc-account-icon svg { display: block; width: 24px; height: 24px; }

/* ---------- Pàgina de compte ---------- */
/* Disseny a dues columnes: menú a l’esquerra (escriptori) i contingut a la dreta. */
body.woocommerce-account .woocommerce:has(> .woocommerce-MyAccount-navigation) {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    gap: 48px;
    align-items: start;
}
body.woocommerce-account .woocommerce:has(> .woocommerce-MyAccount-navigation) > :not(.woocommerce-MyAccount-navigation):not(.woocommerce-MyAccount-content) {
    grid-column: 1 / -1;
}
body.woocommerce-account .woocommerce-MyAccount-navigation {
    grid-column: 1;
    grid-row: 1;
    float: none !important;
    width: auto !important;
    margin: 0 !important;
    position: sticky;
    top: 120px;
}
body.woocommerce-account .woocommerce-MyAccount-content {
    grid-column: 2;
    grid-row: 1;
    float: none !important;
    width: auto !important;
    min-width: 0;
    padding: 0 !important;
}
body.woocommerce-account .woocommerce-MyAccount-navigation ul {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
}
body.woocommerce-account .woocommerce-MyAccount-navigation li {
    display: block;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
}
/* Cap canvi de mida al passar el rató: el padding, el marge i el bord són fixos (el tema els modificava). */
body.woocommerce-account .woocommerce-MyAccount-navigation li a {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 !important;
    padding: 12px 16px !important;
    border: 0 !important;
    border-radius: 12px;
    background: transparent;
    color: var(--ctc-ink);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
    text-decoration: none;
    text-transform: none;
    transition: background-color .15s ease, color .15s ease;
}
body.woocommerce-account .woocommerce-MyAccount-navigation li a::before,
body.woocommerce-account .woocommerce-MyAccount-navigation li a::after {
    content: none !important;
    display: none !important;
}
body.woocommerce-account .woocommerce-MyAccount-navigation li a:hover,
body.woocommerce-account .woocommerce-MyAccount-navigation li a:focus-visible { background: #f2f2f2; }
body.woocommerce-account .woocommerce-MyAccount-navigation li a:focus-visible { outline: 2px solid var(--ctc-ink); outline-offset: 2px; }
/* Pàgina activa: fons lima i text en negreta. */
body.woocommerce-account .woocommerce-MyAccount-navigation li.is-active a {
    background: var(--ctc-lime);
    font-weight: 700;
    box-shadow: none;
}
/* Tancar sessió: separada al final, en to discret. */
body.woocommerce-account .woocommerce-MyAccount-navigation li.woocommerce-MyAccount-navigation-link--customer-logout {
    margin-top: 16px !important;
    padding-top: 16px !important;
    border-top: 1px solid #e6e6e6 !important;
}
body.woocommerce-account .woocommerce-MyAccount-navigation li.woocommerce-MyAccount-navigation-link--customer-logout a {
    color: var(--ctc-muted);
    font-weight: 600;
}
body.woocommerce-account .woocommerce-MyAccount-navigation li.woocommerce-MyAccount-navigation-link--customer-logout a:hover,
body.woocommerce-account .woocommerce-MyAccount-navigation li.woocommerce-MyAccount-navigation-link--customer-logout a:focus-visible {
    background: #fbeceb;
    color: #9b1c15;
}

/* Mentre es carrega una pestanya nova (navegació sense recàrrega, account-nav.js). */
body.woocommerce-account .woocommerce-MyAccount-content { transition: opacity .15s ease; }
body.woocommerce-account .woocommerce-MyAccount-content.is-loading { opacity: .4; pointer-events: none; }

/* Titulars */
.ctc-account__head { margin: 0 0 28px; }
.ctc-account__eyebrow {
    margin: 0 0 6px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--ctc-muted);
}
.ctc-account__title,
body.woocommerce-account .woocommerce-MyAccount-content h2 {
    margin: 0 0 12px;
    font-family: var(--ctc-font-display);
    font-size: clamp(24px, 3vw, 30px);
    font-weight: 700;
    font-style: normal;
    line-height: 1.2;
    letter-spacing: -.01em;
    text-transform: none;
    color: var(--ctc-ink);
}
.ctc-account__lead { margin: 0; max-width: 60ch; font-size: 16px; line-height: 1.55; }

/* Targetes */
.ctc-account__grid,
.ctc-account__list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.ctc-account__card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 26px;
    border: 1px solid var(--ctc-line);
    border-radius: var(--ctc-radius-card);
    background: var(--ctc-paper);
}
.ctc-account__card--tile { min-height: 200px; }
.ctc-account__list .ctc-account__card {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}
.ctc-account__card-main,
.ctc-account__card-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.ctc-account__card-actions { align-items: flex-end; gap: 10px; }
.ctc-account__kicker {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--ctc-muted);
}
.ctc-account__value {
    font-family: var(--ctc-font-display);
    font-size: 22px;
    font-weight: 700;
    font-style: normal;
    line-height: 1.25;
    text-transform: none;
    color: var(--ctc-ink);
}
.ctc-account__meta { font-size: 14px; color: var(--ctc-muted); }
.ctc-account__card--tile .ctc-account__btn { margin-top: auto; align-self: flex-start; }

/* Botons i enllaços */
.ctc-account__btn,
body.woocommerce-account .woocommerce-Button,
body.woocommerce-account .woocommerce a.button {
    display: inline-block;
    padding: 12px 22px;
    border: 0;
    border-radius: var(--ctc-radius-pill);
    background: var(--ctc-lime);
    color: var(--ctc-ink);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
    text-transform: none;
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
    transition: filter .2s ease, transform .2s ease;
}
.ctc-account__btn:hover,
body.woocommerce-account .woocommerce-Button:hover,
body.woocommerce-account .woocommerce a.button:hover { filter: brightness(.95); transform: translateY(-1px); }
.ctc-account__btn:focus-visible { outline: 2px solid var(--ctc-ink); outline-offset: 3px; }
.ctc-account__link {
    font-size: 14px;
    font-weight: 700;
    color: var(--ctc-ink);
    text-decoration: underline;
    text-underline-offset: 3px;
}
.ctc-account__badge {
    display: inline-block;
    padding: 8px 14px;
    border: 1px solid var(--ctc-line);
    border-radius: var(--ctc-radius-pill);
    font-size: 13px;
    font-weight: 700;
    color: var(--ctc-ink);
}
.ctc-account__empty {
    padding: 32px;
    border: 1px dashed var(--ctc-line);
    border-radius: var(--ctc-radius-card);
    text-align: center;
}

/* Taules de comandes i subscripcions (WooCommerce) */
body.woocommerce-account .woocommerce-orders-table,
body.woocommerce-account .shop_table {
    border: 1px solid var(--ctc-line);
    border-radius: var(--ctc-radius-card);
    overflow: hidden;
    border-collapse: separate;
    border-spacing: 0;
}
body.woocommerce-account .woocommerce-orders-table th,
body.woocommerce-account .shop_table th {
    background: var(--ctc-ink);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
}
body.woocommerce-account .woocommerce-orders-table td,
body.woocommerce-account .shop_table td { border-color: #e6e6e6; }
body.woocommerce-account .woocommerce-orders-table .woocommerce-button,
body.woocommerce-account .shop_table .button { font-size: 12px; padding: 10px 18px; }

/* Avís de subscripció a la fitxa de producte */
.ctc-account-notice {
    margin: 16px 0;
    padding: 20px 24px;
    border: 1px solid var(--ctc-line);
    border-radius: var(--ctc-radius-card);
    background: #fbfff0;
}
.ctc-account-notice__text { margin: 0 0 12px; color: var(--ctc-ink); }
.ctc-account-notice__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin: 0; }

/* Mòbil (16 px de marge, sense desplaçament horizontal) */
@media (max-width: 600px) {
    /* Navegació horitzontal amb subratllat (no píndoles). */
    body.woocommerce-account .woocommerce:has(> .woocommerce-MyAccount-navigation) { display: block; }
    body.woocommerce-account .woocommerce-MyAccount-navigation,
    body.woocommerce-account .woocommerce-MyAccount-content { grid-column: auto; grid-row: auto; }
    body.woocommerce-account .woocommerce-MyAccount-navigation {
        position: static;
        margin: 0 0 28px !important;
        border-bottom: 1px solid #e6e6e6;
    }
    body.woocommerce-account .woocommerce-MyAccount-navigation ul {
        flex-direction: row;
        gap: 0;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    body.woocommerce-account .woocommerce-MyAccount-navigation li { flex: 0 0 auto; }
    body.woocommerce-account .woocommerce-MyAccount-navigation li a {
        padding: 12px 14px !important;
        border-radius: 0;
        white-space: nowrap;
        box-shadow: inset 0 -3px 0 transparent;
    }
    body.woocommerce-account .woocommerce-MyAccount-navigation li a:hover { background: transparent; box-shadow: inset 0 -3px 0 #d9d9d9; }
    body.woocommerce-account .woocommerce-MyAccount-navigation li.is-active a { background: transparent; box-shadow: inset 0 -3px 0 var(--ctc-lime); }
    body.woocommerce-account .woocommerce-MyAccount-navigation li.woocommerce-MyAccount-navigation-link--customer-logout { margin-top: 0 !important; padding-top: 0 !important; border-top: 0 !important; }
    body.woocommerce-account .woocommerce-MyAccount-navigation li.woocommerce-MyAccount-navigation-link--customer-logout a:hover { box-shadow: inset 0 -3px 0 #9b1c15; }
    .ctc-account__card { padding: 20px; }
    .ctc-account__list .ctc-account__card { flex-direction: column; align-items: stretch; }
    .ctc-account__card-actions { align-items: stretch; }
    .ctc-account__btn { text-align: center; }
}

/* ---------- Taules de la compta (comandes, subscripcions, baixades) i avisos ---------- */
body.woocommerce-account table.shop_table {
    width: 100%;
    border: 1px solid var(--ctc-line);
    border-radius: var(--ctc-radius-card);
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    background: var(--ctc-paper);
}
body.woocommerce-account table.shop_table thead th {
    padding: 14px 20px !important;
    border: 0 !important;
    border-bottom: 1px solid var(--ctc-line) !important;
    background: #f4f4f2 !important;
    color: var(--ctc-muted) !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    letter-spacing: .08em;
    text-align: left;
    text-transform: uppercase;
}
body.woocommerce-account table.shop_table tbody td,
body.woocommerce-account table.shop_table tbody th {
    padding: 18px 20px !important;
    border: 0 !important;
    border-bottom: 1px solid #e6e6e6 !important;
    background: transparent !important;
    color: var(--ctc-ink) !important;
    font-size: 15px !important;
    font-weight: 400;
    text-align: left;
    vertical-align: middle;
}
body.woocommerce-account table.shop_table tbody tr:last-child > * { border-bottom: 0 !important; }
body.woocommerce-account table.shop_table .woocommerce-orders-table__cell-order-number a {
    font-weight: 700;
    color: var(--ctc-ink);
    text-decoration: none;
}
body.woocommerce-account table.shop_table .woocommerce-orders-table__cell-order-total { font-weight: 700; white-space: nowrap; }
body.woocommerce-account table.shop_table .woocommerce-orders-table__cell-order-total small { font-weight: 400; color: var(--ctc-muted); }
body.woocommerce-account table.shop_table .woocommerce-orders-table__cell-order-status { white-space: nowrap; }
/* Estat amb punt de color (sense canviar el text de WooCommerce). */
body.woocommerce-account table.shop_table .woocommerce-orders-table__cell-order-status::before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-right: 8px;
    border-radius: 50%;
    background: #9a9a9a;
    vertical-align: middle;
}
body.woocommerce-account table.shop_table tr.woocommerce-orders-table__row--status-completed .woocommerce-orders-table__cell-order-status::before { background: #7bc400; }
body.woocommerce-account table.shop_table tr.woocommerce-orders-table__row--status-processing .woocommerce-orders-table__cell-order-status::before,
body.woocommerce-account table.shop_table tr.woocommerce-orders-table__row--status-on-hold .woocommerce-orders-table__cell-order-status::before,
body.woocommerce-account table.shop_table tr.woocommerce-orders-table__row--status-pending .woocommerce-orders-table__cell-order-status::before { background: #e8a317; }
body.woocommerce-account table.shop_table tr.woocommerce-orders-table__row--status-cancelled .woocommerce-orders-table__cell-order-status::before,
body.woocommerce-account table.shop_table tr.woocommerce-orders-table__row--status-failed .woocommerce-orders-table__cell-order-status::before { background: #c0392b; }
/* Accions: botó petit alineat a la dreta. */
body.woocommerce-account table.shop_table .woocommerce-orders-table__cell-order-actions,
body.woocommerce-account table.shop_table .woocommerce-orders-table__header-order-actions { text-align: right; }
body.woocommerce-account table.shop_table .woocommerce-orders-table__cell-order-actions .button,
body.woocommerce-account table.shop_table td .button {
    display: inline-block;
    padding: 9px 18px !important;
    margin: 0 0 0 6px;
    border-radius: var(--ctc-radius-pill);
    background: var(--ctc-lime) !important;
    color: var(--ctc-ink) !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    text-transform: none;
    line-height: 1.2;
    white-space: nowrap;
}
body.woocommerce-account table.shop_table .woocommerce-orders-table__cell-order-actions .button:hover { filter: brightness(.95); }

/* Avisos de WooCommerce (confirmació de correu, etc.) */
body.woocommerce-account .woocommerce-info,
body.woocommerce-account .woocommerce-message {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 16px;
    margin: 0 0 28px !important;
    padding: 18px 22px !important;
    border: 1px solid var(--ctc-line) !important;
    border-radius: 16px !important;
    background: #fbfff0 !important;
    color: var(--ctc-ink) !important;
    font-size: 15px;
    line-height: 1.5;
}
body.woocommerce-account .woocommerce-info .button,
body.woocommerce-account .woocommerce-message .button {
    margin: 0 !important;
    padding: 10px 18px !important;
    border-radius: var(--ctc-radius-pill) !important;
    background: var(--ctc-ink) !important;
    color: #ffffff !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    letter-spacing: .02em;
    text-decoration: none;
}

/* Mòbil: cada fila de la taula es converteix en targeta, amb l’etiqueta a l’esquerra. */
@media (max-width: 700px) {
    body.woocommerce-account table.shop_table_responsive thead { display: none; }
    body.woocommerce-account table.shop_table_responsive,
    body.woocommerce-account table.shop_table_responsive tbody,
    body.woocommerce-account table.shop_table_responsive tr,
    body.woocommerce-account table.shop_table_responsive td,
    body.woocommerce-account table.shop_table_responsive th { display: block; width: 100%; }
    body.woocommerce-account table.shop_table_responsive tr { padding: 10px 0; border-bottom: 1px solid #e6e6e6; }
    body.woocommerce-account table.shop_table_responsive tbody tr:last-child { border-bottom: 0; }
    body.woocommerce-account table.shop_table_responsive td,
    body.woocommerce-account table.shop_table_responsive th {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 12px;
        padding: 8px 20px !important;
        border-bottom: 0 !important;
        text-align: right;
    }
    body.woocommerce-account table.shop_table_responsive td::before {
        content: attr(data-title);
        font-size: 12px;
        font-weight: 700;
        letter-spacing: .06em;
        text-transform: uppercase;
        color: var(--ctc-muted);
        text-align: left;
    }
    body.woocommerce-account table.shop_table_responsive .woocommerce-orders-table__cell-order-actions { justify-content: flex-end; }
    /* A mòbil l’estat porta l’etiqueta («Estat») i el punt de color passa al text. */
    body.woocommerce-account table.shop_table_responsive .woocommerce-orders-table__cell-order-status::before {
        content: attr(data-title);
        display: inline;
        width: auto;
        height: auto;
        margin: 0;
        background: none !important;
        font-size: 12px;
        font-weight: 700;
        letter-spacing: .06em;
        text-transform: uppercase;
        color: var(--ctc-muted);
    }
    body.woocommerce-account table.shop_table_responsive tr.woocommerce-orders-table__row--status-completed .woocommerce-orders-table__cell-order-status { color: #4f7a00; font-weight: 700; }
    body.woocommerce-account table.shop_table_responsive tr.woocommerce-orders-table__row--status-cancelled .woocommerce-orders-table__cell-order-status { color: #c0392b; font-weight: 700; }
    body.woocommerce-account table.shop_table_responsive .woocommerce-orders-table__cell-order-actions::before { display: none; }
}
/* El text del aviso va primer i el botó després (els nodes de text són ítems anònims amb ordre 0). */
body.woocommerce-account .woocommerce-info .wc-forward,
body.woocommerce-account .woocommerce-message .wc-forward { order: 1; }
body.woocommerce-account table.shop_table tbody th { text-transform: none; }

/* Detall de la comanda: taula de productes i de totals amb el mateix estil que les llistes. */
body.woocommerce-account table.woocommerce-table--order-details,
body.woocommerce-account table.order_details {
    width: 100%;
    margin: 0 0 32px;
    border: 1px solid var(--ctc-line);
    border-radius: var(--ctc-radius-card);
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    background: var(--ctc-paper);
}
body.woocommerce-account table.woocommerce-table--order-details thead th,
body.woocommerce-account table.order_details thead th {
    padding: 14px 20px !important;
    background: #f4f4f2 !important;
    color: var(--ctc-muted) !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    letter-spacing: .08em;
    text-transform: uppercase;
    text-align: left;
    border-bottom: 1px solid var(--ctc-line) !important;
}
body.woocommerce-account table.woocommerce-table--order-details td,
body.woocommerce-account table.woocommerce-table--order-details th,
body.woocommerce-account table.order_details td,
body.woocommerce-account table.order_details th {
    padding: 14px 20px !important;
    border: 0 !important;
    border-bottom: 1px solid #e6e6e6 !important;
    background: transparent !important;
    color: var(--ctc-ink) !important;
    font-size: 15px !important;
    text-align: left;
    vertical-align: middle;
}
body.woocommerce-account table.woocommerce-table--order-details tfoot th,
body.woocommerce-account table.order_details tfoot th {
    color: var(--ctc-muted) !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    text-transform: none;
}
body.woocommerce-account table.woocommerce-table--order-details tfoot td,
body.woocommerce-account table.order_details tfoot td { text-align: right; font-weight: 600; }
body.woocommerce-account table.woocommerce-table--order-details tfoot tr:last-child > *,
body.woocommerce-account table.order_details tfoot tr:last-child > * { border-bottom: 0 !important; }
body.woocommerce-account table.woocommerce-table--order-details tfoot tr:last-child td,
body.woocommerce-account table.order_details tfoot tr:last-child td { font-size: 17px !important; font-weight: 800 !important; }
body.woocommerce-account table.woocommerce-table--order-details .product-quantity,
body.woocommerce-account table.order_details .product-quantity { color: var(--ctc-muted); font-weight: 400; }
body.woocommerce-account table.woocommerce-table--order-details .product-total,
body.woocommerce-account table.order_details .product-total { text-align: right; font-weight: 700; }

/* Adreces: dues targetes, títol amb l’enllaç «Edita» a la dreta i text sense cursiva. */
body.woocommerce-account .woocommerce-Addresses {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
    margin: 0;
}
body.woocommerce-account .woocommerce-Address {
    margin: 0;
    padding: 22px 24px;
    border: 1px solid var(--ctc-line);
    border-radius: var(--ctc-radius-card);
    background: var(--ctc-paper);
}
body.woocommerce-account .woocommerce-Address-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 14px;
}
body.woocommerce-account .woocommerce-Address-title h2,
body.woocommerce-account .woocommerce-Address-title h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.2;
}
body.woocommerce-account .woocommerce-Address-title .edit {
    flex: 0 0 auto;
    padding: 7px 14px;
    border: 1px solid var(--ctc-line);
    border-radius: var(--ctc-radius-pill);
    color: var(--ctc-ink);
    font-size: 13px;
    font-weight: 600;
    text-transform: none;
    text-decoration: none;
    transition: background-color .15s ease;
}
body.woocommerce-account .woocommerce-Address-title .edit:hover,
body.woocommerce-account .woocommerce-Address-title .edit:focus-visible { background: var(--ctc-lime); }
body.woocommerce-account .woocommerce-Address address {
    font-style: normal;
    font-size: 15px;
    line-height: 1.6;
    color: var(--ctc-body);
}
/* El tema fa flotar les columnes d’adreces i posiciona «Edita» de manera absoluta: ho anul·lem. */
body.woocommerce-account .woocommerce-Addresses.col2-set,
body.woocommerce-account .woocommerce-Addresses { display: grid !important; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; width: 100%; }
body.woocommerce-account .woocommerce-Addresses .col-1,
body.woocommerce-account .woocommerce-Addresses .col-2,
body.woocommerce-account .woocommerce-Addresses .woocommerce-Address { float: none !important; width: auto !important; min-width: 0; margin: 0 !important; }
body.woocommerce-account .woocommerce-Address-title .edit { position: static !important; float: none !important; }
body.woocommerce-account .woocommerce-Address-title { position: static !important; }
body.woocommerce-account .woocommerce-Addresses .col-1 { grid-column: 1; }
body.woocommerce-account .woocommerce-Addresses .col-2 { grid-column: 2; }
body.woocommerce-account .woocommerce-Address-title { flex-wrap: wrap; }
body.woocommerce-account .woocommerce-Address-title .edit {
    display: inline-flex !important;
    width: auto !important;
    margin-left: auto;
    white-space: nowrap;
}
body.woocommerce-account .woocommerce-Address-title { display: block !important; }
body.woocommerce-account .woocommerce-Address-title h2,
body.woocommerce-account .woocommerce-Address-title h3 {
    display: block;
    margin: 0 0 12px !important;
    text-align: left;
    width: auto;
    float: none;
}
body.woocommerce-account .woocommerce-Address-title .edit { margin: 0 !important; }

/* Icona d’informació dels avisos: el tema la posa flotant i relativa amb marges de 30 px; a dins del
   contenidor flex la centrem com un element més, sense desplaçar el text. */
body.woocommerce-account .woocommerce-info::before,
body.woocommerce-account .woocommerce-message::before {
    position: static !important;
    float: none !important;
    top: auto !important;
    left: auto !important;
    display: block !important;
    flex: 0 0 36px;
    width: 36px !important;
    height: 36px !important;
    margin: 0 !important;
    align-self: center;
}
/* El símbol d’informació: dibuix SVG centrat sobre el quadre fosc (la màscara del tema el desplaçava). */
body.woocommerce-account .woocommerce-info::before,
body.woocommerce-account .woocommerce-message::before {
    -webkit-mask: none !important;
    mask: none !important;
    background-color: var(--ctc-ink) !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2377dfff' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 11v6'/%3E%3Cpath d='M12 7.6v.4'/%3E%3C/svg%3E") !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    background-size: 20px 20px !important;
    border-radius: 10px;
    color: transparent !important;
}
/* El tema dibuixa un segon quadrat (::after, absolut). L’anul·lem: el quadrat és ara el ::before amb el símbol. */
body.woocommerce-account .woocommerce-info::after,
body.woocommerce-account .woocommerce-message::after { content: none !important; display: none !important; }
body.woocommerce-account .woocommerce-info::before,
body.woocommerce-account .woocommerce-message::before {
    width: 40px !important;
    height: 40px !important;
    flex: 0 0 40px;
    background-size: 22px 22px !important;
}

/* Mòbil: la icona de la barra superior, en blanc i de la mateixa mida que la del carretó. */
.ctc-account-icon.ctc-account-icon-mobile {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    margin: 0 14px 0 0;
    color: #ffffff;
    flex: 0 0 auto;
}
.ctc-account-icon.ctc-account-icon-mobile svg { display: block; width: 24px; height: 24px; }

.ctc-mobile-actions { display: flex; align-items: center; gap: 14px; }

/* ---------- Accés i registre (El meu compte sense sessió) ---------- */
body.woocommerce-account:not(.logged-in) .woocommerce { max-width: 980px; margin: 0 auto; }
.ctc-auth__lead { margin: 0 0 24px; font-size: 16px; line-height: 1.5; color: var(--ctc-body); max-width: 60ch; }
body.woocommerce-account:not(.logged-in) .u-columns.col2-set {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}
body.woocommerce-account:not(.logged-in) .u-columns.col2-set > [class*="col-"] { float: none; width: auto; }
body.woocommerce-account:not(.logged-in) .woocommerce-form-login,
body.woocommerce-account:not(.logged-in) .woocommerce-form-register {
    margin: 0;
    padding: 28px;
    border: 1px solid var(--ctc-line);
    border-radius: var(--ctc-radius-card);
    background: var(--ctc-paper);
}
body.woocommerce-account:not(.logged-in) .woocommerce-form h2 {
    margin: 0 0 18px;
    font-size: 22px;
    font-weight: 700;
    font-style: normal;
    line-height: 1.2;
    text-transform: none;
    color: var(--ctc-ink);
}
body.woocommerce-account .woocommerce form .form-row { margin: 0 0 16px; padding: 0; }
body.woocommerce-account .woocommerce form .form-row label {
    display: block;
    margin: 0 0 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--ctc-ink);
}
body.woocommerce-account .woocommerce form .form-row .required { color: var(--ctc-ink); text-decoration: none; }
body.woocommerce-account .woocommerce form .form-row input[type="text"],
body.woocommerce-account .woocommerce form .form-row input[type="email"],
body.woocommerce-account .woocommerce form .form-row input[type="password"] {
    box-sizing: border-box;
    width: 100%;
    min-height: 46px;
    margin: 0;
    padding: 11px 14px;
    border: 1px solid #cfcfcf;
    border-radius: 12px;
    background: var(--ctc-paper);
    color: var(--ctc-ink);
    font: inherit;
    font-size: 16px;   /* 16 px evita el zoom automàtic als mòbils */
}
body.woocommerce-account .woocommerce form .form-row input:focus-visible {
    outline: 2px solid var(--ctc-ink);
    outline-offset: 2px;
    border-color: var(--ctc-ink);
}
.ctc-reg-names { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 14px; }
body.woocommerce-account .ctc-consent label {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.45;
    color: var(--ctc-body);
}
body.woocommerce-account .ctc-consent input[type="checkbox"] {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin: 2px 0 0;
    accent-color: var(--ctc-ink);
}
body.woocommerce-account .ctc-consent a { color: var(--ctc-ink); text-underline-offset: 3px; }
/* Camp trampa: fora de la vista i de la navegació amb teclat. */
.ctc-hp { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }
body.woocommerce-account:not(.logged-in) .woocommerce-LostPassword { margin: 8px 0 0; font-size: 14px; }
body.woocommerce-account:not(.logged-in) .woocommerce-LostPassword a { color: var(--ctc-ink); text-underline-offset: 3px; }
body.woocommerce-account:not(.logged-in) .woocommerce-form .woocommerce-form__label-for-checkbox { font-size: 14px; }
@media (max-width: 760px) {
    body.woocommerce-account:not(.logged-in) .u-columns.col2-set { grid-template-columns: minmax(0, 1fr); gap: 18px; }
    body.woocommerce-account:not(.logged-in) .woocommerce-form-login,
    body.woocommerce-account:not(.logged-in) .woocommerce-form-register { padding: 22px 18px; }
    .ctc-reg-names { grid-template-columns: minmax(0, 1fr); }
}

/* Woo posa pseudoelements de neteja a .col2-set; als grids ocupen una cel·la i desplacen les columnes. */
body.woocommerce-account:not(.logged-in) .u-columns.col2-set::before,
body.woocommerce-account:not(.logged-in) .u-columns.col2-set::after { content: none; display: none; }
/* Botó d’entrar amb el mateix estil que el de registre. */
body.woocommerce-account:not(.logged-in) .woocommerce-form-login__submit,
body.woocommerce-account:not(.logged-in) .woocommerce-form-register__submit {
    display: inline-block;
    padding: 12px 22px;
    border: 0;
    border-radius: var(--ctc-radius-pill);
    background: var(--ctc-lime);
    color: var(--ctc-ink);
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}
body.woocommerce-account:not(.logged-in) .woocommerce-form-login__submit:hover,
body.woocommerce-account:not(.logged-in) .woocommerce-form-register__submit:hover { filter: brightness(.95); }
body.woocommerce-account .woocommerce-privacy-policy-text { margin: 0 0 16px; font-size: 13px; line-height: 1.5; color: var(--ctc-muted); }
body.woocommerce-account .woocommerce-privacy-policy-text p { margin: 0; }

/* ---------- Factures: llista ordenada per columnes (comanda · import · documents · enllaç) ---------- */
.ctc-invoices__head,
.ctc-invoices__row {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(170px, .9fr) minmax(0, 2fr) auto;
    gap: 16px;
    align-items: center;
}
.ctc-invoices__head {
    padding: 0 22px 10px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--ctc-muted);
}
.ctc-invoices {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.ctc-invoices__row {
    padding: 18px 22px;
    border: 1px solid var(--ctc-line);
    border-radius: var(--ctc-radius-card);
    background: var(--ctc-paper);
}
.ctc-invoices__info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ctc-invoices__order { font-size: 16px; font-weight: 700; color: var(--ctc-ink); }
.ctc-invoices__meta { font-size: 14px; color: var(--ctc-muted); }
.ctc-invoices__total {
    font-family: var(--ctc-font-display);
    font-size: 18px;
    font-weight: 700;
    color: var(--ctc-ink);
    line-height: 1.35;
}
.ctc-invoices__total del { color: var(--ctc-muted); font-weight: 400; }
.ctc-invoices__total ins { text-decoration: none; display: block; }
.ctc-invoices__docs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; min-width: 0; }
.ctc-invoices__btn { padding: 10px 18px; font-size: 14px; }
.ctc-invoices__none { font-size: 14px; color: var(--ctc-muted); }
.ctc-invoices__link { justify-self: end; white-space: nowrap; font-size: 14px; }
@media (max-width: 760px) {
    .ctc-invoices__head { display: none; }
    .ctc-invoices__row {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 12px 16px;
        padding: 16px 18px;
    }
    .ctc-invoices__info { grid-column: 1; grid-row: 1; }
    .ctc-invoices__total { grid-column: 2; grid-row: 1; align-self: start; }
    .ctc-invoices__docs { grid-column: 1 / -1; grid-row: 2; }
    .ctc-invoices__link { grid-column: 1 / -1; grid-row: 3; justify-self: start; }
}

/* ---------- Detall de la comanda: resum, totals i adreces ordenats ---------- */
body.woocommerce-account .woocommerce-order > p {
    margin: 0 0 28px;
    font-size: 16px;
    line-height: 1.6;
    color: var(--ctc-body);
}
body.woocommerce-account .woocommerce-order > p strong { color: var(--ctc-ink); }
body.woocommerce-account .woocommerce-order h2,
body.woocommerce-account .woocommerce-column__title,
body.woocommerce-account .woocommerce-order-details__title {
    margin: 0 0 14px;
    font-family: var(--ctc-font-display);
    font-size: 22px;
    font-weight: 700;
    font-style: normal;
    line-height: 1.2;
    text-transform: none;
    color: var(--ctc-ink);
}
body.woocommerce-account table.order_details {
    width: 100%;
    margin: 0;
    border: 1px solid var(--ctc-line);
    border-radius: var(--ctc-radius-card);
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    background: var(--ctc-paper);
}
body.woocommerce-account table.order_details thead th {
    padding: 12px 20px;
    background: #f5f5f5;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--ctc-muted);
    border: 0;
}
body.woocommerce-account table.order_details thead th:last-child { text-align: right; }
body.woocommerce-account table.order_details tbody td,
body.woocommerce-account table.order_details tfoot th,
body.woocommerce-account table.order_details tfoot td {
    padding: 14px 20px;
    border-top: 1px solid #ededed;
    font-size: 15px;
    line-height: 1.45;
    color: var(--ctc-ink);
    vertical-align: top;
}
body.woocommerce-account table.order_details tbody td:first-child { font-weight: 600; }
body.woocommerce-account table.order_details .product-quantity { color: var(--ctc-muted); font-weight: 400; }
body.woocommerce-account table.order_details tfoot th {
    font-weight: 500;
    color: var(--ctc-body);
    text-align: left;
    width: 60%;
}
body.woocommerce-account table.order_details tfoot td {
    text-align: right;
    font-weight: 600;
    white-space: nowrap;
}
body.woocommerce-account table.order_details tfoot td small { font-weight: 400; color: var(--ctc-muted); white-space: normal; }
body.woocommerce-account table.order_details tfoot tr:last-child th,
body.woocommerce-account table.order_details tfoot tr:last-child td {
    background: #f5f5f5;
    font-size: 17px;
    font-weight: 700;
    color: var(--ctc-ink);
}
body.woocommerce-account table.order_details tfoot tr:last-child th { font-weight: 700; }
body.woocommerce-account .woocommerce-columns--addresses {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 16px;
    margin: 36px 0 0;
    padding: 0;
    list-style: none;
}
body.woocommerce-account .woocommerce-columns--addresses .woocommerce-column,
body.woocommerce-account .woocommerce-customer-details .woocommerce-column {
    float: none;
    width: auto;
    margin: 0;
    padding: 20px 22px;
    border: 0;
    border-radius: 12px;
    background: #f5f5f5;
}
body.woocommerce-account .woocommerce-columns--addresses .woocommerce-column .woocommerce-column__title { font-size: 18px; margin-bottom: 10px; }
body.woocommerce-account .woocommerce-columns--addresses address {
    margin: 0;
    padding: 0;
    border: 0;
    font-style: normal;
    font-size: 15px;
    line-height: 1.6;
    color: var(--ctc-body);
}
body.woocommerce-account .woocommerce-columns--addresses address a { color: var(--ctc-ink); text-decoration: none; }
@media (max-width: 760px) {
    body.woocommerce-account .woocommerce-columns--addresses { grid-template-columns: minmax(0, 1fr); }
    body.woocommerce-account table.order_details thead th,
    body.woocommerce-account table.order_details tbody td,
    body.woocommerce-account table.order_details tfoot th,
    body.woocommerce-account table.order_details tfoot td { padding: 12px 14px; }
    body.woocommerce-account table.order_details tfoot th { width: auto; }
    body.woocommerce-account table.order_details tfoot td { white-space: normal; }
}
/* Les seccions d’adreces són col2-set: Woo les neteja amb pseudoelements que ocupen una cel·la del grid. */
body.woocommerce-account .woocommerce-columns--addresses::before,
body.woocommerce-account .woocommerce-columns--addresses::after { content: none; display: none; }

/* Camp trampa de WP Armour a la fitxa del producte («Secondary Website Url»): només l’hi veuen els robots.
   Es amaga amb CSS sense treure’l del HTML, així els robots segueixen omplint-lo. */
.form_field_sec,
.wpa_hidden_field,
form.cart .form_field_sec,
form.cart .wpa_hidden_field { display: none !important; }

/* El tema posa «capitalize» a les etiquetes del checkout de blocs: el camp NIF s’ha de veure tal com està escrit. */
.wc-block-components-address-form__ctc-nif label,
.wc-block-components-text-input.wc-block-components-address-form__ctc-nif label,
.wc-block-components-address-form__ctc-nif .wc-block-components-text-input__label { text-transform: none !important; }

/* Adreces del detall de comanda: el tema desplaça la columna d’enviament i les tarjetes queden desalineades.
   Les dues columnes comencen a la mateixa alçada i tenen la mateixa altura. */
body.woocommerce-account .woocommerce-columns--addresses { align-items: stretch !important; }
body.woocommerce-account .woocommerce-columns--addresses > .woocommerce-column,
body.woocommerce-account .woocommerce-columns--addresses > [class*="woocommerce-column--"] {
    margin: 0 !important;
    top: auto !important;
    align-self: stretch;
}
