/* ============================================================
 * DÉLICES SUPRÊMES — 10. Espace client (mon compte)
 * ============================================================
 * Pages couvertes :
 *   - my-account (dashboard avec sidebar tabs)
 *   - history (commandes)
 *   - order-detail (suivi commande avec timeline)
 *   - addresses (gestion adresses)
 *   - identity (profil)
 *
 * Layout cible (design source EAccount) :
 *   ┌────────────────────────────────────────────┐
 *   │ Breadcrumb : Accueil / Mon compte           │
 *   │ ─ Bonjour, Aïssatou                         │
 *   │ Votre maison (italic 56px)   [Se déco]      │
 *   ├──────────┬─────────────────────────────────┤
 *   │ ┌──────┐ │ — N COMMANDES                   │
 *   │ │ Card │ │ Vos commandes (italic 36px)     │
 *   │ │ stats│ │ ┌──┐ Order... Status   [Suivre] │
 *   │ └──────┘ │ │  │                           │ │
 *   │ Tabs     │ └──┘                           │ │
 *   │ Mes cmds │                                │ │
 *   │ Adresses │                                │ │
 *   │ Favoris  │                                │ │
 *   │ Profil   │                                │ │
 *   └──────────┴─────────────────────────────────┘
 * ========================================================= */

#my-account,
#identity,
#address,
#addresses,
#history,
#order-detail,
#order-follow,
#order-slip,
#discount,
#module-psgdpr-gdpr {
    background: #ffffff;
    padding: var(--ds-space-8) 0 var(--ds-space-24);
}

#my-account .container,
#identity .container,
#address .container,
#addresses .container,
#history .container,
#order-detail .container {
    max-width: var(--ds-container-max);
    padding-left: var(--ds-space-12);
    padding-right: var(--ds-space-12);
}

/* ─── Breadcrumb (commun à toutes les pages compte) ────── */
.account-page .breadcrumb,
.account-page .ds-breadcrumb,
#my-account .breadcrumb,
#history .breadcrumb,
#identity .breadcrumb,
#addresses .breadcrumb,
#address .breadcrumb,
#order-detail .breadcrumb {
    background: transparent;
    padding: 0;
    margin: 0 0 var(--ds-space-8);
    font-size: 11px;
    letter-spacing: 0.12em;
    color: var(--ds-gray-600);
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.account-page .breadcrumb li {
    display: inline-flex;
    align-items: center;
}

.account-page .breadcrumb li + li::before {
    content: "/";
    margin-right: 8px;
    opacity: 0.5;
}

.account-page .breadcrumb a {
    color: var(--ds-gray-600);
    text-decoration: none;
}

.account-page .breadcrumb a:hover {
    color: var(--ds-coral);
}

.account-page .breadcrumb .active {
    color: var(--ds-ink);
}

/* ─── Hero compte (Bonjour, NOM + titre éditorial) ────── */
.ds-account-hero {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: var(--ds-space-12);
    padding-bottom: var(--ds-space-6);
    border-bottom: 1px solid var(--ds-ink);
    gap: var(--ds-space-6);
    flex-wrap: wrap;
}

.ds-account-hero__eyebrow {
    font-size: 11px;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--ds-coral);
    margin-bottom: var(--ds-space-3);
    font-weight: 500;
}

.ds-account-hero__eyebrow::before {
    content: "— ";
}

.ds-account-hero h1,
.ds-account-hero .h1 {
    font-family: var(--ds-font-display);
    font-size: clamp(40px, 6vw, 56px);
    font-weight: 400;
    font-style: italic;
    line-height: 1.05;
    color: var(--ds-ink);
    margin: 0;
}

.ds-account-hero__signout,
.ds-account-hero a.logout {
    background: transparent;
    color: var(--ds-ink);
    border: 1px solid var(--ds-ink);
    padding: 10px 16px;
    font-size: 11px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--ds-transition);
    border-radius: 0;
}

.ds-account-hero__signout:hover {
    background: var(--ds-ink);
    color: #ffffff;
}

/* ─── Layout 2 colonnes (sidebar + contenu) ────────────── */
.ds-account-layout,
#my-account #content > .row,
#history #content > .row,
#identity #content > .row,
#addresses #content > .row,
#address #content > .row,
#order-detail #content > .row {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: var(--ds-space-14);
    margin: 0;
    align-items: flex-start;
}

.account-page #left-column,
.account-page .ds-account-sidebar {
    width: 100%;
    flex: none;
    max-width: none;
    padding: 0;
}

.account-page #content-wrapper,
.account-page .ds-account-content {
    width: 100%;
    flex: none;
    max-width: none;
    padding: 0;
}

/* ─── Card stats membre (sidebar haut) ──────────────────── */
.ds-account-stats {
    background: var(--ds-cream);
    padding: var(--ds-space-5);
    margin-bottom: var(--ds-space-6);
}

.ds-account-stats__label {
    font-size: 11px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--ds-gray-600);
    font-weight: 500;
}

.ds-account-stats__year {
    font-family: var(--ds-font-display);
    font-size: 22px;
    font-style: italic;
    font-weight: 400;
    color: var(--ds-ink);
    margin: 4px 0 0;
}

.ds-account-stats__rule {
    height: 1px;
    background: var(--ds-gray-200);
    margin: var(--ds-space-4) 0;
}

.ds-account-stats__row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: 13px;
    color: var(--ds-ink);
}

.ds-account-stats__row strong {
    font-weight: 600;
    color: var(--ds-ink);
}

/* ─── Sidebar menu (tabs my-account) ───────────────────── */
.ds-account-nav,
#my-account #links,
.account-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    background: transparent;
}

.ds-account-nav li,
#my-account #links a,
.account-links li {
    margin: 0;
    list-style: none;
}

.ds-account-nav a,
.ds-account-nav button,
#my-account .links .link-item,
#my-account #links a,
.account-links a,
.account-links li > a {
    background: none;
    border: none;
    cursor: pointer;
    padding: 12px 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--ds-gray-200);
    color: var(--ds-ink);
    font-family: var(--ds-font-body);
    font-size: 14px;
    font-weight: 400;
    text-decoration: none;
    transition: all var(--ds-transition);
}

.ds-account-nav a:hover,
#my-account #links a:hover,
.account-links a:hover {
    color: var(--ds-coral);
    text-decoration: none;
}

.ds-account-nav a.active,
.ds-account-nav .is-current,
#my-account #links a.current,
.account-links li.current a {
    color: var(--ds-ink);
    font-family: var(--ds-font-display);
    font-style: italic;
    font-size: 16px;
    font-weight: 600;
}

.ds-account-nav a.active::after,
.ds-account-nav .is-current::after,
.account-links li.current a::after {
    content: "→";
    color: var(--ds-coral);
}

/* Override la version "card" native du dashboard PrestaShop
   (tiles dans my-account page) pour l'aligner avec le style sidebar */
#my-account .links {
    display: grid;
    grid-template-columns: 1fr;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 0;
}

#my-account .links a {
    background: transparent;
    border: none;
    padding: 12px 0;
    text-align: left;
    box-shadow: none;
}

#my-account .links a:hover {
    background: transparent;
    transform: none;
    box-shadow: none;
}

#my-account .links a span.link-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--ds-gray-200);
    padding: 12px 0;
    margin: 0;
}

#my-account .links a i,
#my-account .links a .icon,
#my-account .links a img {
    display: none;
}

/* ─── Eyebrow contenu (— X commandes) ──────────────────── */
.ds-account-content-eyebrow,
.ds-section-eyebrow {
    font-size: 11px;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--ds-coral);
    margin-bottom: var(--ds-space-5);
    font-weight: 500;
}

.ds-account-content-eyebrow::before {
    content: "— ";
}

/* Titre section contenu */
.ds-account-content h2,
#history h2,
#identity h2,
#addresses h2,
#address h2,
#order-detail h2,
.account-page .page-title {
    font-family: var(--ds-font-display);
    font-size: 36px;
    font-style: italic;
    font-weight: 400;
    color: var(--ds-ink);
    margin: 0 0 var(--ds-space-8);
}

/* ─── Liste commandes (history) ─────────────────────────── */
#history-table,
.history table,
table.history-table {
    width: 100%;
    border-collapse: collapse;
    background: transparent;
    border: none;
}

#history-table thead,
.history thead {
    display: none; /* On cache le thead, design custom via tbody */
}

#history-table tbody tr,
.history tbody tr,
.history-row {
    display: grid;
    grid-template-columns: 90px 1fr auto auto;
    gap: var(--ds-space-6);
    padding: var(--ds-space-6) 0;
    border-bottom: 1px solid var(--ds-gray-200);
    align-items: center;
    background: transparent;
}

#history-table tbody tr:first-child {
    border-top: 1px solid var(--ds-gray-200);
}

#history-table td,
.history td {
    padding: 0;
    border: none;
    background: transparent;
    color: var(--ds-ink);
}

/* Numéro commande (eyebrow) */
.order-id,
.history-row__id {
    font-size: 11px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ds-gray-600);
    font-family: var(--ds-font-body);
    font-weight: 500;
}

.history-row__items {
    font-family: var(--ds-font-display);
    font-size: 22px;
    font-style: italic;
    font-weight: 400;
    color: var(--ds-ink);
    line-height: 1.2;
    margin-top: 4px;
}

.history-row__date {
    font-size: 12px;
    color: var(--ds-gray-600);
    margin-top: 4px;
}

/* Badge statut commande */
.order-status,
.history-row__status,
.label {
    font-size: 11px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--ds-coral);
    background: transparent;
    padding: 0;
    border: none;
    border-radius: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.order-status::before,
.history-row__status::before {
    content: "●";
    font-size: 14px;
    line-height: 1;
}

.order-status.delivered,
.history-row__status--delivered {
    color: var(--ds-ink);
}

.order-status.pending,
.history-row__status--pending {
    color: var(--ds-gray-600);
}

.order-status.cancelled,
.history-row__status--cancelled {
    color: var(--ds-gray-600);
    text-decoration: line-through;
}

/* Total commande */
.history-row__total,
#history-table .total {
    font-family: var(--ds-font-display);
    font-size: 22px;
    font-weight: 400;
    text-align: right;
    color: var(--ds-ink);
}

/* Bouton "Suivre / Détails" */
.history-row__action,
#history-table .order-actions a,
.order-actions a,
.history a.btn,
.history-row .btn {
    background: transparent;
    color: var(--ds-ink);
    border: 1px solid var(--ds-ink);
    padding: 10px 16px;
    font-size: 11px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--ds-transition);
    border-radius: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.history-row__action:hover,
.history a.btn:hover {
    background: var(--ds-ink);
    color: #ffffff;
    text-decoration: none;
}

.history-row__action::after {
    content: "→";
}

/* ─── Détails commande / suivi (order-detail) ──────────── */
#order-detail #order-infos {
    margin: 0 0 var(--ds-space-12);
}

#order-detail .order-line,
#order-detail .order-products,
.order-products {
    background: transparent;
    border: none;
}

#order-detail #order-products,
#order-detail #order-products table {
    width: 100%;
    border-collapse: collapse;
}

#order-detail #order-products th {
    font-size: 11px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ds-gray-600);
    font-weight: 500;
    padding: 12px 0;
    border-bottom: 1px solid var(--ds-gray-200);
    text-align: left;
    background: transparent;
}

#order-detail #order-products td {
    padding: 14px 0;
    border-bottom: 1px solid var(--ds-gray-200);
    font-size: 14px;
    color: var(--ds-ink);
    background: transparent;
}

/* Timeline de suivi (à injecter dans order-detail si besoin) */
.ds-tracking-timeline {
    margin: var(--ds-space-8) 0;
    position: relative;
}

.ds-tracking-step {
    display: grid;
    grid-template-columns: 40px 1fr;
    gap: 16px;
    padding-bottom: var(--ds-space-6);
    position: relative;
}

.ds-tracking-step:not(:last-child)::before {
    content: "";
    position: absolute;
    left: 19px;
    top: 32px;
    bottom: 0;
    width: 2px;
    background: var(--ds-gray-200);
}

.ds-tracking-step--done:not(:last-child)::before {
    background: var(--ds-ink);
}

.ds-tracking-step__dot {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid var(--ds-gray-200);
    display: grid;
    place-items: center;
    color: #ffffff;
    font-size: 14px;
    flex-shrink: 0;
}

.ds-tracking-step--done .ds-tracking-step__dot {
    background: var(--ds-ink);
    border-color: var(--ds-ink);
}

.ds-tracking-step--done .ds-tracking-step__dot::after {
    content: "✓";
}

.ds-tracking-step--current .ds-tracking-step__dot {
    background: var(--ds-coral);
    border-color: var(--ds-coral);
    animation: ds-pulse 2s ease-in-out infinite;
}

@keyframes ds-pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(244, 64, 81, 0.4);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(244, 64, 81, 0);
    }
}

.ds-tracking-step__body {
    padding-top: 8px;
}

.ds-tracking-step__title {
    font-family: var(--ds-font-display);
    font-size: 20px;
    font-style: italic;
    color: var(--ds-ink);
    margin: 0;
}

.ds-tracking-step:not(.ds-tracking-step--done) .ds-tracking-step__title {
    color: var(--ds-gray-400);
}

.ds-tracking-step__date {
    font-size: 12px;
    color: var(--ds-gray-600);
    margin-top: 2px;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
}

/* ─── Adresses (page addresses) ─────────────────────────── */
#addresses .addresses-footer,
#addresses .addresses-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--ds-space-4);
    list-style: none;
    padding: 0;
    margin: 0;
}

#addresses .address,
.address-item {
    border: 1px solid var(--ds-gray-200);
    padding: var(--ds-space-6);
    background: #ffffff;
    border-radius: 0;
    position: relative;
    list-style: none;
}

#addresses .address.primary::before,
.address-item.primary::before {
    content: "★ Principale";
    position: absolute;
    top: 16px;
    right: 16px;
    font-size: 10px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ds-coral);
    font-weight: 600;
}

#addresses .address h4,
.address-item h4,
.address-alias {
    font-family: var(--ds-font-display);
    font-size: 20px;
    font-style: italic;
    font-weight: 400;
    color: var(--ds-ink);
    margin: 0 0 var(--ds-space-3);
}

#addresses .address address,
.address-detail {
    font-size: 13px;
    color: var(--ds-gray-600);
    line-height: 1.5;
    font-style: normal;
    margin: 0;
}

#addresses .address .address-footer,
.address-actions {
    display: flex;
    gap: var(--ds-space-3);
    margin-top: var(--ds-space-5);
}

#addresses .address-footer a,
.address-actions a {
    background: transparent;
    border: none;
    color: var(--ds-ink);
    text-decoration: underline;
    font-size: 12px;
    padding: 0;
    cursor: pointer;
}

#addresses .address-footer a:hover {
    color: var(--ds-coral);
}

#addresses .address-footer a.delete,
.address-actions a.delete {
    color: var(--ds-gray-600);
}

/* Bouton "Ajouter une adresse" */
#addresses .addresses-footer a.btn,
.add-address {
    padding: var(--ds-space-6);
    border: 1.5px dashed var(--ds-gray-200);
    background: transparent;
    cursor: pointer;
    font-family: var(--ds-font-display);
    font-size: 18px;
    font-style: italic;
    color: var(--ds-gray-600);
    text-decoration: none;
    text-align: center;
    transition: all var(--ds-transition);
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

#addresses .addresses-footer a.btn:hover,
.add-address:hover {
    border-color: var(--ds-ink);
    color: var(--ds-ink);
    background: var(--ds-cream);
}

#addresses .addresses-footer a.btn::before {
    content: "+ ";
}

/* ─── Profil (identity) ─────────────────────────────────── */
#identity #content,
#identity .form,
#identity form {
    max-width: 720px;
}

#identity .form-control-label,
#identity label {
    font-size: 11px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--ds-gray-600);
    margin-bottom: 6px;
    font-weight: 500;
    display: block;
}

#identity input.form-control,
#identity select.form-control,
#identity input[type="text"],
#identity input[type="email"],
#identity input[type="password"] {
    background: #ffffff;
    border: 1px solid var(--ds-gray-200);
    padding: 12px 14px;
    border-radius: 0;
    font-size: 14px;
    color: var(--ds-ink);
    width: 100%;
    box-shadow: none;
}

#identity input:focus,
#identity select:focus {
    border-color: var(--ds-coral);
    outline: none;
}

#identity .form-fields > div,
#identity .row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--ds-space-4);
    margin: 0;
}

#identity .form-fields .col-md-12 {
    grid-column: 1 / -1;
}

#identity .form-footer button,
#identity button[type="submit"] {
    background: var(--ds-ink);
    color: #ffffff;
    border: none;
    padding: 14px var(--ds-space-6);
    font-size: 12px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    font-weight: 600;
    cursor: pointer;
    border-radius: 0;
    margin-top: var(--ds-space-6);
    transition: background var(--ds-transition);
}

#identity .form-footer button:hover {
    background: var(--ds-coral);
}

/* ─── Pages auth (connexion / inscription) ─────────────── */
#authentication,
#registration,
#password,
#forgot-password {
    background: var(--ds-cream-soft, #FBF7F3);
    padding: var(--ds-space-16) 0;
    min-height: 60vh;
}

#authentication .container,
#registration .container,
#password .container {
    max-width: 480px;
}

#authentication .login-form,
#registration .register-form,
#password form,
#authentication .form,
#registration .form {
    background: #ffffff;
    padding: var(--ds-space-10);
    border-radius: 0;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.06);
}

#authentication h1,
#registration h1,
#password h1,
#authentication .page-header h1 {
    font-family: var(--ds-font-display);
    font-size: 36px;
    font-style: italic;
    font-weight: 400;
    color: var(--ds-ink);
    margin: 0 0 var(--ds-space-2);
    text-align: center;
}

#authentication .login-form-eyebrow {
    font-size: 11px;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--ds-coral);
    text-align: center;
    margin-bottom: var(--ds-space-6);
}

#authentication .form-group,
#registration .form-group {
    margin-bottom: var(--ds-space-4);
}

#authentication input,
#registration input {
    background: #ffffff;
    border: 1px solid var(--ds-gray-200);
    padding: 12px 14px;
    border-radius: 0;
    font-size: 14px;
    width: 100%;
}

#authentication button[type="submit"],
#registration button[type="submit"],
#password button[type="submit"] {
    background: var(--ds-ink);
    color: #ffffff;
    border: none;
    padding: 14px var(--ds-space-6);
    font-size: 12px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    font-weight: 600;
    cursor: pointer;
    border-radius: 0;
    width: 100%;
    margin-top: var(--ds-space-3);
    transition: background var(--ds-transition);
}

#authentication button[type="submit"]:hover,
#registration button[type="submit"]:hover {
    background: var(--ds-coral);
}

#authentication .forgot-password,
.forgot-password {
    text-align: center;
    margin-top: var(--ds-space-3);
}

#authentication .forgot-password a {
    color: var(--ds-gray-600);
    font-size: 12px;
    text-decoration: underline;
}

#authentication .forgot-password a:hover {
    color: var(--ds-coral);
}

/* Lien "Pas encore inscrit ?" */
#authentication .no-account,
.register-link {
    text-align: center;
    margin-top: var(--ds-space-6);
    padding-top: var(--ds-space-6);
    border-top: 1px solid var(--ds-gray-200);
    font-size: 13px;
    color: var(--ds-gray-600);
}

#authentication .no-account a,
.register-link a {
    color: var(--ds-coral);
    font-weight: 600;
    text-decoration: underline;
}
