/* ══════════════════════════════════════════════════════════════════
   Espace client — habillage commun aux 5 pages (11/09/2026)
   mon-compte · mes-commandes · mes-sav · mes-devis · mes-favoris
   Chargé APRÈS main.css / pages.css : n'y touche pas, surcharge.
   ══════════════════════════════════════════════════════════════════ */

/* Fond : un dégradé doux aux couleurs de la marque plutôt qu'un gris plat */
.account-page {
  background: linear-gradient(180deg, #fdf2f8 0%, #f3f6fb 360px, #f5f7fa 100%);
}

/* ── Colonne de navigation ───────────────────────────────────────── */
.account-sidenav {
  width: 240px; padding: 0 0 12px; overflow: hidden;
  /* Sous l'en-tête + la barre de navigation (tous deux sticky) : le menu se
     cale juste dessous au défilement au lieu de passer derrière eux. */
  top: calc(var(--header-h, 80px) + var(--navbar-h, 52px) + 20px);
  max-height: calc(100vh - var(--header-h, 80px) - var(--navbar-h, 52px) - 40px);
  overflow-y: auto;
}
.account-sidenav__title { display: none; }           /* remplacé par le profil */

.ec-profile {
  display: flex; align-items: center; gap: 12px;
  padding: 18px 16px 14px; margin-bottom: 8px;
  background: linear-gradient(135deg, #fff1f7 0%, #eef2ff 100%);
  border-bottom: 1px solid var(--border, #e5e7eb);
}
.ec-profile__avatar {
  width: 46px; height: 46px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--gradient-brand, linear-gradient(135deg, #1681c4, #ec4899 55%, #f59e0b));
  color: #fff; font-weight: 800; font-size: 15px; letter-spacing: .3px;
  box-shadow: 0 4px 12px rgba(180, 60, 130, .28);
}
.ec-profile__text { min-width: 0; }
.ec-profile__hello { font-size: 11px; color: #9ca3af; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }
.ec-profile__name {
  font-weight: 700; font-size: 14px; color: var(--dark, #111827); line-height: 1.25;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ec-profile__sub {
  font-size: 11.5px; color: var(--text-muted, #6b7280);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.account-sidenav__item {
  gap: 12px; padding: 8px 12px; margin: 2px 8px;
  border-left: 0; border-radius: 10px; font-weight: 600; color: #374151;
}
.account-sidenav__item i {
  width: 30px; height: 30px; border-radius: 9px; opacity: 1;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; background: #f3f4f6; color: #6b7280;
  transition: transform .15s ease;
}
.account-sidenav__item:nth-of-type(1) i { background: #e0f2fe; color: #0369a1; }
.account-sidenav__item:nth-of-type(2) i { background: #ede9fe; color: #6d28d9; }
.account-sidenav__item:nth-of-type(3) i { background: #fef3c7; color: #b45309; }
.account-sidenav__item:nth-of-type(4) i { background: #ccfbf1; color: #0f766e; }
.account-sidenav__item:nth-of-type(5) i { background: #fce7f3; color: #be185d; }
.account-sidenav__item:hover { background: #f9fafb; color: var(--dark, #111827); }
.account-sidenav__item:hover i { transform: scale(1.06); }
.account-sidenav__item.is-active {
  background: linear-gradient(90deg, #fdf2f8, #fff);
  color: var(--dark, #111827);
  box-shadow: inset 3px 0 0 var(--pink, #ec4899);
}

.ec-help {
  margin: 12px 12px 0; padding: 14px;
  border-radius: 12px; border: 1px solid #fde2e7;
  background: linear-gradient(135deg, #fff7ed, #fdf2f8);
  font-size: 12.5px; line-height: 1.45; color: #4b5563;
}
.ec-help strong { display: block; font-size: 13px; color: var(--dark, #111827); margin-bottom: 3px; }
.ec-help a {
  display: flex; align-items: center; gap: 7px; margin-top: 8px;
  color: #be185d; font-weight: 600; text-decoration: none;
}
.ec-help a i { width: 22px; height: 22px; border-radius: 6px; background: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; }
.ec-help a:hover { color: #9d174d; }
.ec-help__phone { color: var(--dark, #111827) !important; font-weight: 700 !important; }

/* ── En-tête de page : titre à gauche avec pastille ──────────────── */
.account-card--wide { border-radius: 18px; }
.account-card--wide .account-card__title {
  text-align: left; display: flex; align-items: center; gap: 12px; font-size: 24px;
}
.account-card--wide .account-card__sub { text-align: left; margin-bottom: 24px; }
.ec-title-icon {
  width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 17px; color: #be185d;
  background: linear-gradient(135deg, #fce7f3, #e0e7ff);
}

/* ── Mon compte : bienvenue + raccourcis ─────────────────────────── */
.mc-welcome {
  background: linear-gradient(135deg, #fff1f7 0%, #eef2ff 100%);
  border-color: #fbe2ee;
}
.mc-welcome__avatar {
  background: var(--gradient-brand, linear-gradient(135deg, #1681c4, #ec4899 55%, #f59e0b));
  font-weight: 800; box-shadow: 0 6px 14px rgba(180, 60, 130, .28);
}
.mc-shortcut { border-radius: 14px; }
.mc-shortcut i {
  width: 36px; height: 36px; border-radius: 10px; font-size: 15px; margin-bottom: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  background: #fce7f3; color: #be185d;
}
.mc-shortcut:nth-of-type(1) i { background: #ede9fe; color: #6d28d9; }
.mc-shortcut:nth-of-type(2) i { background: #fef3c7; color: #b45309; }
.mc-shortcut:nth-of-type(3) i { background: #ccfbf1; color: #0f766e; }
.mc-shortcut:nth-of-type(4) i { background: #fce7f3; color: #be185d; }
.mc-shortcut:nth-of-type(5) i { background: #e0f2fe; color: #0369a1; }
.mc-section { border-radius: 16px; }
.mc-section__head i:first-child {
  width: 32px; height: 32px; border-radius: 9px; display: inline-flex;
  align-items: center; justify-content: center; font-size: 13px;
  background: #eef2ff; color: #4338ca; margin-right: 2px;
}
.mc-section--danger .mc-section__head i:first-child { background: #fee2e2; color: #b91c1c; }

/* ── États vides : icône dans une pastille douce, bouton intact ──── */
.placeholder-empty { padding: 40px 16px; }
.placeholder-empty > i {
  width: 92px; height: 92px; border-radius: 50%; font-size: 36px; opacity: 1;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #fce7f3, #e0e7ff); color: #be185d;
  margin-bottom: 18px;
}
.placeholder-empty a i,
.placeholder-empty button i {
  font-size: inherit; width: auto; height: auto; border-radius: 0;
  background: none; color: inherit; opacity: 1; margin: 0; display: inline;
}
.placeholder-empty h3 { font-size: 20px; font-weight: 800; }
.placeholder-empty p { color: #6b7280; line-height: 1.55; }
.placeholder-empty .btn-primary { border-radius: 999px; padding: 10px 20px; }

/* ── Mes commandes : pastille par famille, cartes qui respirent ──── */
.mc-sec__toggle > i:first-child {
  width: 34px; height: 34px; border-radius: 10px; font-size: 14px;
  display: inline-flex; align-items: center; justify-content: center; background: #f3f4f6;
}
.mc-sec[data-family="textile"] .mc-sec__toggle > i:first-child { background: #ede9fe; }
.mc-sec[data-family="gf"]      .mc-sec__toggle > i:first-child { background: #e0e7ff; }
.mc-sec[data-family="dtf"]     .mc-sec__toggle > i:first-child { background: #fce7f3; }
.mc-filters { border-radius: 14px; background: #fff; }
.order-card { border-radius: 14px; }
#textileOrdersList > div, #gfOrdersList > div { border-radius: 14px !important; transition: border-color .15s, box-shadow .15s; }
#textileOrdersList > div:hover, #gfOrdersList > div:hover { border-color: #f9a8d4 !important; box-shadow: 0 6px 20px rgba(0, 0, 0, .05); }

/* ── Mobile ──────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .account-sidenav { padding: 0 8px 8px; max-height: none; overflow: visible; top: auto; }
  .ec-profile { flex-basis: 100%; margin: 0 -8px 6px; padding: 14px 16px; }
  .ec-help { display: none; }
  .account-sidenav__item { margin: 2px; padding: 6px 10px; }
  .account-sidenav__item i { width: 26px; height: 26px; font-size: 12px; }
  .account-sidenav__item.is-active { box-shadow: none; background: #fdf2f8; border-bottom-color: transparent; }
  .account-card--wide .account-card__title { font-size: 21px; }
  .ec-title-icon { width: 36px; height: 36px; font-size: 15px; }
}

/* ── Grands écrans : on respire (le gabarit 1140 px flottait au milieu d'un 27") ── */
@media (min-width: 1400px) {
  .account-page .container { max-width: 1480px; }
  .account-layout { max-width: 1440px; gap: 28px; }
  .account-sidenav { width: 270px; }
  .account-card--wide { padding: 36px 40px; }
}
@media (min-width: 1800px) {
  .account-page .container { max-width: 1720px; }
  .account-layout { max-width: 1680px; }
  .account-sidenav { width: 290px; }
}

/* Mes devis : la carte reprend .account-card (480 px centrés) → pleine largeur ici */
#devisHost .account-card { max-width: none; margin: 0 0 12px; border-radius: 14px; box-shadow: none; }
#devisHost .account-card:hover { border-color: #f9a8d4; box-shadow: 0 6px 20px rgba(0, 0, 0, .05); }

/* ── Visiteur non connecté (18/09) : l'espace client ne se dévoile pas ──
   Le cœur du header mène à /mes-favoris même sans compte : on n'y montre que
   l'invitation à se connecter, pas le menu « Mon espace ». Tant que l'état de
   connexion n'est pas connu (auth.js pose .is-guest ou .is-authenticated sur
   body), le menu garde sa place mais reste invisible : rien n'est montré au
   visiteur, et rien ne saute à l'écran pour le client connecté. */
body:not(.is-authenticated):not(.is-guest) .account-sidenav { visibility: hidden; }
body.is-guest .account-sidenav { display: none; }
body.is-guest .account-layout { justify-content: center; }
body.is-guest .account-layout .account-card--wide { flex: 0 1 560px; margin: 0 auto; }
/* Le titre et le sous-titre de la page (« Retrouvez ici… ») n'ont de sens que
   connecté : le visiteur ne voit que le bloc « Connexion requise ». */
body.is-guest .account-card--wide .account-card__title,
body.is-guest .account-card--wide .account-card__sub { display: none; }
