/**
 * Naturabox — espace client (Mon compte, informations, commandes, bons, pages de modules du compte) :
 * menu latéral en carte (« Bonjour prénom »), contenu en carte, tuiles du tableau de bord, historique en lignes,
 * formulaires au style des pages de connexion (auth.css).
 */

/* ---------- Menu latéral ---------- */
.account-menu--sidebar {
  padding: 1.25rem;
  border: 1px solid var(--nb-line);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 14px 40px -28px rgba(25, 45, 23, .35);
}

@media (min-width: 992px) {
  .account-menu--sidebar {
    position: sticky;
    top: calc(var(--nb-hdr-h) + 1.25rem);
  }
}

@media (max-width: 991.98px) {
  .account-menu--sidebar {
    margin-bottom: 1.5rem;
  }
}

.account-menu__hello {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--nb-line);
}

.account-menu__avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-family: var(--nb-font-title);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--nb-green-dark);
  background: var(--nb-yellow);
}

.account-menu--sidebar .account-menu__title {
  margin: 0;
  font-family: var(--nb-font-title);
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1.2;
  color: var(--nb-title);
}

.account-menu__home {
  font-size: .8125rem;
  font-weight: 600;
  color: var(--nb-primary);
  text-decoration: none;
}

.account-menu__home:hover {
  text-decoration: underline;
}

.account-menu--sidebar .account-menu__nav {
  display: grid;
  gap: .15rem;
}

.account-menu--sidebar .account-menu__link {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .6rem .75rem;
  border-radius: 12px;
  font-size: .9rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--nb-text);
  text-decoration: none;
  transition: background-color .15s ease, color .15s ease;
}

.account-menu--sidebar .account-menu__link:hover {
  color: var(--nb-title);
  background: var(--nb-soft);
}

.account-menu--sidebar .account-menu__link--active {
  color: var(--nb-green-dark);
  background: #eef5f0;
}

.account-menu--sidebar .account-menu__icon {
  font-size: 20px;
  color: var(--nb-primary);
}

.account-menu--sidebar .account-menu__link--signout {
  margin-top: .5rem;
  border-top: 1px solid var(--nb-line);
  border-radius: 0 0 12px 12px;
  color: var(--nb-muted);
}

.account-menu--sidebar .account-menu__link--signout .account-menu__icon {
  color: var(--nb-muted);
}

.account-menu--sidebar .account-menu__link--signout:hover {
  color: #b42318;
  background: #fdecea;
}

.account-menu--sidebar .account-menu__link--signout:hover .account-menu__icon {
  color: #b42318;
}

/* ---------- Contenu en carte ---------- */
.page-content--customer {
  padding: 1.75rem 2rem 2rem;
  border: 1px solid var(--nb-line);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 14px 40px -28px rgba(25, 45, 23, .35);
}

@media (max-width: 575.98px) {
  .page-content--customer {
    padding: 1.25rem 1.1rem 1.5rem;
  }
}

/* le tableau de bord n'est pas en carte : ses tuiles le sont */
#my-account .page-content--customer {
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
}

.page-content--customer > p:first-child {
  margin-bottom: 1.25rem;
  color: var(--nb-muted);
}

.page-content--customer h2,
.page-content--customer .h2,
.page-content--customer h3 {
  font-family: var(--nb-font-title);
  font-weight: 800;
  color: var(--nb-title);
}

/* ---------- Tableau de bord ---------- */
.nb-account__top:not(:empty) {
  margin-bottom: 1.5rem;
}

/* message d'accueil (rdhookcontent, contenu du BO) */
.nb-account__top .alert {
  padding: 1.5rem 1.75rem;
  border: 0;
  border-radius: 20px;
  color: var(--nb-text);
  background: var(--nb-cream-2);
}

.nb-account__top .alert a:not(.btn) {
  font-weight: 600;
  color: var(--nb-primary);
}

.account-menu--main.nb-account {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.nb-account .account-menu__link {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .9rem;
  min-height: 132px;
  margin: 0;
  padding: 1.25rem 2.75rem 1.25rem 1.25rem;
  border: 1px solid var(--nb-line);
  border-radius: 18px;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--nb-title);
  text-decoration: none;
  background: #fff;
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.nb-account .account-menu__link::after {
  position: absolute;
  top: 1.25rem;
  right: 1.1rem;
  font-family: "Material Icons";
  font-size: 20px;
  content: "arrow_forward";
  color: var(--nb-muted);
  transition: transform .2s ease, color .2s ease;
}

.nb-account .account-menu__link:hover {
  border-color: #b9cfc1;
  box-shadow: 0 16px 34px -20px rgba(25, 45, 23, .35);
  transform: translateY(-2px);
}

.nb-account .account-menu__link:hover::after {
  color: var(--nb-primary);
  transform: translateX(3px);
}

.nb-account .account-menu__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  margin: 0;
  border-radius: 50%;
  font-size: 24px;
  color: var(--nb-primary);
  background: #eef5f0;
}

.nb-account .account-menu__link--signout {
  color: var(--nb-muted);
}

.nb-account .account-menu__link--signout .account-menu__icon {
  color: var(--nb-muted);
  background: var(--nb-soft);
}

/* ---------- Formulaires du compte (identité…) ---------- */
.page-content--customer .form-label {
  margin-bottom: .35rem;
  font-size: .875rem;
  font-weight: 600;
  color: var(--nb-ink);
}

.page-content--customer .form-control,
.page-content--customer .form-select {
  min-height: 48px;
  border-radius: 12px;
  font-size: 1rem;
}

.page-content--customer .password-field .form-control {
  border-right: 0;
}

.page-content--customer .password-field .btn {
  min-width: 52px;
  border: 1px solid #d9ddd5;
  border-left: 0;
  border-radius: 0 12px 12px 0 !important;
  color: var(--nb-muted);
  background: #fff;
}

.page-content--customer .password-field .btn:hover {
  color: var(--nb-primary);
  background: var(--nb-soft);
}

.page-content--customer .form-text {
  font-size: .75rem;
  color: var(--nb-muted);
}

.page-content--customer #customer-form .form-check,
.page-content--customer .form-fields .form-check {
  padding: .85rem 1rem .85rem 2.6rem;
  border-radius: 12px;
  font-size: .875rem;
  background: var(--nb-soft);
}

.page-content--customer .form-check-label em {
  display: block;
  margin-top: .2rem;
  font-size: .75rem;
  font-style: normal;
  color: var(--nb-muted);
}

.page-content--customer .mb-3:has(#field-firstname) .form-text,
.page-content--customer .mb-3:has(#field-lastname) .form-text {
  display: none;
}

.page-content--customer .mb-3:has(#field-firstname:focus) .form-text,
.page-content--customer .mb-3:has(#field-lastname:focus) .form-text,
.page-content--customer .mb-3:has(.is-invalid) .form-text {
  display: block;
}

@media (min-width: 576px) {
  .page-content--customer #customer-form > section,
  .page-content--customer .js-address-form .form-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 1rem;
  }

  .page-content--customer #customer-form > section > *,
  .page-content--customer .js-address-form .form-fields > * {
    grid-column: 1 / -1;
  }

  .page-content--customer #customer-form > section > .mb-3:has(#field-firstname),
  .page-content--customer #customer-form > section > .mb-3:has(#field-lastname),
  .page-content--customer #customer-form > section > .mb-3:has(#field-birthday),
  .page-content--customer #customer-form > section > .mb-3:has(#field-phone),
  .page-content--customer .form-fields > .mb-3:has(#field-postcode),
  .page-content--customer .form-fields > .mb-3:has(#field-city) {
    grid-column: auto;
  }
}

.page-content--customer #customer-form footer {
  margin-top: .75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--nb-line);
}

.page-content--customer #customer-form footer .btn {
  min-height: 50px;
  padding-inline: 1.75rem;
}

/* ---------- Historique des commandes ---------- */
.order-history__header {
  display: none !important;
}

.order-history__inner {
  display: grid;
  gap: .85rem;
}

.order-history__row {
  display: grid !important;
  grid-template-columns: minmax(0, 1.2fr) repeat(3, minmax(0, 1fr)) auto;
  grid-template-areas:
    "ref date total status invoice"
    "payment payment actions actions actions";
  align-items: center;
  gap: .75rem 1rem;
  padding: 1.1rem 1.25rem;
  border: 1px solid var(--nb-line);
  border-radius: 16px;
  background: #fff;
}

.order-history__row:hover {
  border-color: #b9cfc1;
}

.order-history__cell {
  padding: 0 !important;
  border: 0 !important;
  font-size: .875rem;
}

.order-history__cell::before {
  display: block;
  margin-bottom: .1rem;
  font-size: .6875rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  content: attr(data-ps-label);
  color: var(--nb-muted);
}

.order-history__cell--reference {
  grid-area: ref;
  font-weight: 800;
  color: var(--nb-title);
}

.order-history__cell--date {
  grid-area: date;
}

.order-history__cell--total {
  grid-area: total;
  font-weight: 800;
}

.order-history__cell--payment {
  grid-area: payment;
  color: var(--nb-muted);
}

.order-history__cell--status {
  grid-area: status;
}

.order-history__cell--invoice {
  grid-area: invoice;
  justify-self: end;
}

.order-history__cell--invoice a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: var(--nb-primary);
  background: #eef5f0;
}

.order-history__cell--actions {
  grid-area: actions;
  display: flex !important;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .5rem;
}

.order-history__cell--actions .btn {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  width: auto;
  white-space: nowrap;
  border-radius: 999px;
}

.order-history__cell--actions .btn .material-icons {
  font-size: 17px;
}

.order-history__status {
  padding: .35em .75em;
  border-radius: 999px;
  font-weight: 600;
}

@media (max-width: 767.98px) {
  .order-history__row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas:
      "ref invoice"
      "date total"
      "status payment"
      "actions actions";
  }

  .order-history__cell--actions {
    justify-content: stretch;
  }

  .order-history__cell--actions .btn {
    flex: 1 1 100%;
    justify-content: center;
  }
}

/* ---------- Détail de commande ---------- */
.page-content--customer .badge {
  padding: .35em .75em;
  border-radius: 999px;
  font-weight: 600;
}

.page-content--customer table {
  font-size: .875rem;
}

.page-content--customer .table > :not(caption) > * > * {
  padding: .65rem .75rem;
}

.page-content--customer .card,
.page-content--customer .address {
  border-radius: 16px;
}

.page-content--customer hr {
  border-color: var(--nb-line);
  opacity: 1;
}

@media (max-width: 767.98px) {
  .order-history__cell {
    display: block !important;
  }

  /* tableau de bord : tuiles sur deux colonnes */
  .account-menu--main.nb-account {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .75rem;
  }

  .nb-account .account-menu__link {
    gap: .6rem;
    min-height: 0;
    padding: 1rem 1rem 1.1rem;
    font-size: .875rem;
  }

  .nb-account .account-menu__link::after {
    top: 1rem;
    right: .85rem;
    font-size: 18px;
  }

  .nb-account .account-menu__icon {
    width: 40px;
    height: 40px;
    font-size: 21px;
  }
}

/* ---------- Mes coffrets (eticket, my_tickets.tpl) ---------- */
.nb-tickets__intro:not(:empty) {
  margin-bottom: 1.5rem;
}

.nb-tickets__intro .alert {
  padding: 1.25rem 1.5rem;
  border: 0;
  border-radius: 16px;
  font-size: .875rem;
  color: var(--nb-text);
  background: var(--nb-cream-2);
}

.nb-tickets__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--nb-line);
}

.nb-tickets__head .btn {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
}

.page-content--customer .nb-tickets__title {
  margin: 0 0 1rem;
  font-size: 1.35rem;
}

.nb-tickets__head .nb-tickets__title {
  margin: 0;
}

.nb-tickets__hint,
.nb-tickets__empty {
  margin: .5rem 0 1rem;
  font-size: .875rem;
  color: var(--nb-muted);
}

.nb-tickets__help {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  margin: 1.5rem 0 0;
  padding: .85rem 1rem;
  border-radius: 12px;
  font-size: .8125rem;
  color: var(--nb-text);
  background: var(--nb-soft);
}

.nb-tickets__help .material-icons {
  font-size: 19px;
  color: var(--nb-primary);
}

.nb-tickets__help a {
  font-weight: 600;
  color: var(--nb-primary);
}

/* tableaux DataTables du module */
.nb-tickets table.table {
  overflow: hidden;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--nb-line);
  border-radius: 14px;
  font-size: .8125rem;
}

.nb-tickets table.table thead th {
  padding: .7rem .75rem;
  border-bottom: 1px solid var(--nb-line);
  font-size: .6875rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--nb-muted) !important;
  background: var(--nb-soft) !important;
}

.nb-tickets table.table tbody tr {
  background: #fff !important;
}

.nb-tickets table.table tbody td {
  padding: .85rem .75rem;
  border-bottom: 1px solid var(--nb-line);
  vertical-align: middle;
  background: transparent !important;
}

.nb-tickets table.table tbody tr:last-child td {
  border-bottom: 0;
}

.nb-tickets .history_name img {
  margin-bottom: .35rem;
  border-radius: 10px;
  object-fit: cover;
}

.nb-tickets .history_name a {
  font-weight: 700;
  color: var(--nb-title);
  text-decoration: none;
}

.nb-tickets .history_ean {
  font-weight: 600;
  color: var(--nb-ink);
}

.nb-tickets .history_ean .btn,
.nb-tickets .eticket-actions .btn {
  margin-top: .4rem;
  border-radius: 999px;
  font-size: .75rem;
}

.nb-tickets .history_check a,
.nb-tickets .history_livret a {
  font-weight: 600;
  color: var(--nb-primary);
}


/* messages d'information du compte : sobres, aux couleurs de la marque */
.page-content--customer .alert-info {
  border: 0;
  border-left: 4px solid var(--nb-primary);
  border-radius: 12px;
  font-size: .875rem;
  color: var(--nb-green-dark);
  background: #eef5f0;
}
