/* Espace client (/compte) : même allure que le site (Inter, noir, crème), photos à angles droits */

.compte-body { background: #fff; }
.compte-header .icon-btn:first-child { margin-left: -10px; }
.compte-header .cart-btn { margin-right: -10px; }

.compte { padding: 36px 0 72px; min-height: calc(100svh - var(--header-h) - 64px); }
.compte__inner { max-width: 760px; }
.compte .title { margin-bottom: 0; }

/* Chargement */
.compte__loading { display: flex; align-items: center; gap: 12px; padding: 40px 0; font-size: 15px; color: var(--muted); }
.compte__spinner {
  width: 18px; height: 18px; border: 2px solid var(--line); border-top-color: var(--ink); border-radius: 50%;
  animation: compte-spin .8s linear infinite;
}
@keyframes compte-spin { to { transform: rotate(360deg); } }

/* Messages */
.compte__alert { margin-top: 16px; padding: 12px 16px; border-radius: 12px; background: #fdecea; color: #8a1f17; font-size: 15px; line-height: 1.45; }
.compte__alert a { color: inherit; }

/* Avant la connexion */
.compte__login { display: flex; flex-direction: column; align-items: flex-start; }
.compte__intro { margin-top: 14px; max-width: 30em; font-size: 18px; line-height: 1.5; color: var(--ink-2); }
.compte__login-btn { margin-top: 28px; min-width: 220px; }
.compte__note { margin-top: 14px; max-width: 34em; font-size: 14px; line-height: 1.5; color: var(--muted); }
.compte__perks { margin-top: 40px; padding-top: 28px; border-top: 1px solid var(--line); display: grid; gap: 16px; width: 100%; }
.compte__perks li { display: flex; align-items: center; gap: 14px; font-size: 16px; }
.compte__ico { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 50%; background: var(--cream); color: var(--accent); }
.compte__ico svg { width: 22px; height: 22px; }

/* Connectée : salutation et onglets */
.compte__hello [data-hello-name]:not(:empty)::before { content: " "; }
.compte__tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.compte__tab {
  min-height: 44px; padding: 0 20px; border: 0; border-radius: 999px;
  background: var(--soft); color: var(--ink); font: inherit; font-size: 15px; font-weight: 500; cursor: pointer;
  transition: background-color .2s ease, color .2s ease;
}
.compte__tab[aria-selected="true"] { background: var(--ink); color: #fff; }
@media (hover: hover) { .compte__tab[aria-selected="false"]:hover { background: #ececf0; } }
.compte__panel { margin-top: 28px; }

/* Commande mise en avant : bloc crème, bord à bord sur téléphone */
.order-hero { padding: 24px var(--gutter); margin-inline: calc(-1 * var(--gutter)); background: var(--cream); display: flex; flex-direction: column; gap: 18px; }
@media (min-width: 761px) { .order-hero { margin-inline: 0; padding: 32px; } }
.order-hero__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.order-hero__head h2 { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.order-hero__num { flex: none; font-size: 14px; color: var(--muted); }
.order-hero__date { margin-top: -10px; font-size: 14px; color: var(--muted); }

.order-steps, .order-items { margin: 0; padding: 0; list-style: none; }
.order-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.order-steps li { display: flex; flex-direction: column; gap: 8px; font-size: 13px; color: var(--muted); }
.order-steps li::before { content: ""; height: 4px; background: #e0dad2; }
.order-steps li.is-done { color: var(--ink); font-weight: 600; }
.order-steps li.is-done::before { background: var(--ink); }

.order-items { display: flex; flex-direction: column; gap: 12px; }
.order-item { display: flex; align-items: center; gap: 14px; }
.order-item img, .order-item__ph { flex: none; width: 64px; height: 64px; object-fit: cover; background: #fff; }
.order-item__txt { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.order-item__name { font-size: 16px; font-weight: 600; }
.order-item__qty { font-size: 14px; color: var(--muted); }
.order-item__price { font-size: 16px; font-variant-numeric: tabular-nums; }

.order-total { display: flex; justify-content: space-between; padding-top: 14px; border-top: 1px solid #e8e2da; font-size: 16px; }
.order-total span:first-child { color: var(--muted); }
.order-total strong { font-variant-numeric: tabular-nums; }
.order-track { font-size: 14px; color: var(--muted); }
.order-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.order-actions .btn { flex: 1 1 160px; }

/* Commandes précédentes */
.orders-past { margin-top: 36px; }
.orders-past h2, .compte__block h2 { font-size: 20px; font-weight: 700; letter-spacing: -.02em; }
.orders-past h2 { margin-bottom: 8px; }
.order-row { border-bottom: 1px solid var(--line); }
.order-row summary {
  min-height: 72px; display: flex; align-items: center; gap: 14px; cursor: pointer; list-style: none;
}
.order-row summary::-webkit-details-marker { display: none; }
.order-row summary img, .order-row summary .order-item__ph { flex: none; width: 48px; height: 48px; object-fit: cover; background: var(--soft); }
.order-row__txt { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.order-row__title { font-size: 16px; font-weight: 600; }
.order-row__meta { font-size: 14px; color: var(--muted); }
.order-row__total { font-size: 16px; font-variant-numeric: tabular-nums; }
.order-row summary > svg { flex: none; width: 16px; height: 16px; color: var(--muted); transition: transform .25s var(--ease); }
.order-row[open] summary > svg { transform: rotate(90deg); }
.order-row__body { padding: 4px 0 20px; display: flex; flex-direction: column; gap: 14px; }

/* Aucune commande */
.orders-empty { padding: 28px var(--gutter); margin-inline: calc(-1 * var(--gutter)); background: var(--cream); display: flex; flex-direction: column; align-items: flex-start; gap: 16px; }
@media (min-width: 761px) { .orders-empty { margin-inline: 0; padding: 32px; } }
.orders-empty p { font-size: 17px; line-height: 1.5; }

/* Profil et adresses */
.compte__block { margin-bottom: 36px; }
.compte__block-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.compte__link {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0;
  border: 0; background: none; color: var(--accent); font: inherit; font-size: 15px; font-weight: 500; text-decoration: none; cursor: pointer;
}
.compte__link svg { width: 16px; height: 16px; }
.compte__rows > div { display: flex; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 16px; }
.compte__rows dt { color: var(--muted); }
.compte__rows dd { margin: 0; text-align: right; overflow-wrap: anywhere; }

.compte__addresses { display: grid; gap: 12px; margin-top: 6px; }
@media (min-width: 761px) { .compte__addresses { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.address { padding: 18px; border: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.address.is-default { border-color: transparent; background: var(--cream); }
.address .tag { background: #fff; }
.address__name { font-size: 16px; font-weight: 600; }
.address__lines { font-size: 15px; line-height: 1.5; color: var(--ink-2); white-space: pre-line; }
.address .compte__link { align-self: flex-start; color: var(--ink); }
.compte__empty { padding: 18px; border: 1px dashed var(--line); font-size: 15px; color: var(--muted); }

.compte__switch { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 16px; line-height: 1.4; cursor: pointer; }
.compte__switch input {
  appearance: none; flex: none; position: relative; width: 51px; height: 31px; margin: 0;
  border-radius: 999px; background: #e9e9eb; cursor: pointer; transition: background-color .2s ease;
}
.compte__switch input::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .18); transition: transform .25s var(--ease-out);
}
.compte__switch input:checked { background: var(--ink); }
.compte__switch input:checked::after { transform: translateX(20px); }
.compte__switch input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.compte__logout { margin-top: 4px; }

/* Aide */
.compte__help { margin-top: 48px; padding: 22px; border: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.compte__help h2 { font-size: 18px; font-weight: 700; }
.compte__help p { font-size: 15px; line-height: 1.5; color: var(--muted); }

/* Formulaires */
.compte__form { display: flex; flex-direction: column; gap: 14px; margin-top: 10px; }
.compte__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 500; }
.field small { font-weight: 400; color: var(--muted); }
.field input, .field select {
  height: 48px; padding: 0 14px; border: 1px solid #d2d2d7; border-radius: 12px;
  background: #fff; color: var(--ink); font: inherit; font-size: 16px; font-weight: 400;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.compte__hint { font-size: 14px; color: var(--muted); }
.compte__check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 15px; cursor: pointer; }
.compte__check input { width: 20px; height: 20px; accent-color: var(--ink); }
.compte__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }

/* Fenêtre d'adresse : en bas sur téléphone, au centre sur ordinateur */
.compte-dialog {
  width: min(560px, 100%); max-width: 100%; max-height: min(92svh, 860px); margin: auto auto 0; padding: 22px var(--gutter) calc(22px + env(safe-area-inset-bottom));
  border: 0; border-radius: 20px 20px 0 0; background: #fff; color: var(--ink); overflow-y: auto;
}
.compte-dialog::backdrop { background: rgba(0, 0, 0, .38); }
.compte-dialog[open] { animation: compte-sheet .4s var(--ease-out); }
@keyframes compte-sheet { from { transform: translateY(40px); opacity: 0; } }
@media (min-width: 761px) { .compte-dialog { margin: auto; padding: 28px 32px; border-radius: 20px; } }
.compte-dialog__head { display: flex; align-items: center; justify-content: space-between; margin-top: -10px; }
.compte-dialog__head h2 { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.compte-dialog__head .icon-btn { margin-right: -10px; }
.compte-dialog .compte__form { margin-top: 6px; }

/* Bas de page réduit */
.compte-foot { padding: 22px 0 calc(22px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.compte-foot .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 24px; }
.compte-foot a { color: var(--muted); text-decoration: none; }
.compte-foot nav { display: flex; gap: 18px; }

.compte-body .toast { bottom: calc(24px + env(safe-area-inset-bottom)); }

@media (min-width: 761px) {
  .compte { padding: 64px 0 96px; }
  .compte__tabs { margin-top: 28px; }
  .compte__panel { margin-top: 36px; }
}
@media (max-width: 380px) { .compte__grid { grid-template-columns: minmax(0, 1fr); } }
