/**
 * E-Pulse App Layout
 * Charte E-Pulse : rouge #ef4242, noir #000000.
 */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400&display=swap');

:root {
  /* Charte historique E-Pulse */
  --ep-red: #ef4242;
  --ep-red-hover: #d63636;
  --ep-blue: #ef4242;
  --ep-navy: #000000;
  --ep-black: #000000;

  /* UI neutrals */
  --ep-bg: #f0f1f4;
  --ep-surface: #ffffff;
  --ep-border: #e4e6eb;
  --ep-text: #000000;
  --ep-text-muted: #6b7280;
  --ep-text-soft: #9ca3af;

  --ep-sidebar-w: 240px;
  --ep-header-h: 72px;
  --ep-radius: 16px;
  --ep-radius-sm: 10px;
  --ep-radius-pill: 999px;
  --ep-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);

  --ep-font: 'Plus Jakarta Sans', system-ui, sans-serif;
  /* Averta (charte) — à brancher quand les fichiers sont disponibles */
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Pas de contour / halo bleu au focus (clavier, clic, tap). */
body.ep-app,
body.ep-app * {
  -webkit-tap-highlight-color: transparent;
}

body.ep-app *:focus,
body.ep-app *:focus-visible,
body.ep-app *:focus-within {
  outline: none !important;
  outline-offset: 0 !important;
}

body.ep-app a:focus,
body.ep-app button:focus,
body.ep-app input:focus,
body.ep-app select:focus,
body.ep-app textarea:focus,
body.ep-app summary:focus,
body.ep-app [tabindex]:focus,
body.ep-app a:focus-visible,
body.ep-app button:focus-visible,
body.ep-app input:focus-visible,
body.ep-app select:focus-visible,
body.ep-app textarea:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}

.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

html,
body.ep-app {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--ep-bg);
  color: var(--ep-text);
  font-family: var(--ep-font);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

body.ep-app #wpadminbar {
  display: none !important;
}

body.ep-app.admin-bar {
  margin-top: 0 !important;
}

.ep-app-shell {
  display: flex;
  min-height: 100vh;
  background: var(--ep-bg);
}

/* ——— Sidebar ——— */
.ep-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  width: var(--ep-sidebar-w);
  height: 100vh;
  padding: 24px 16px 20px;
  background: var(--ep-bg);
  border-right: 1px solid transparent;
}

.ep-sidebar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 12px 28px;
  text-decoration: none;
  color: var(--ep-navy);
}

.ep-sidebar__brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--ep-blue);
  color: #fff;
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.02em;
}

.ep-sidebar__brand-name {
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.02em;
}

.ep-sidebar__nav {
  flex: 1;
  overflow-y: auto;
}

.ep-sidebar__group {
  margin-bottom: 28px;
}

.ep-sidebar__label {
  margin: 0 0 8px 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ep-text-soft);
}

.ep-sidebar__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ep-sidebar__link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--ep-radius-sm);
  color: var(--ep-text);
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  transition: background 0.15s ease, color 0.15s ease;
}

.ep-sidebar__link svg {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.75;
}

.ep-sidebar__link:hover {
  background: rgba(0, 24, 228, 0.06);
  color: var(--ep-blue);
}

.ep-sidebar__link.is-active {
  background: #fff;
  color: var(--ep-blue);
  font-weight: 600;
  box-shadow: var(--ep-shadow);
}

.ep-sidebar__link.is-active svg {
  opacity: 1;
  stroke: var(--ep-blue);
}

.ep-sidebar__footer {
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ep-sidebar__admin {
  margin-bottom: 4px;
  color: var(--ep-blue);
  font-weight: 600;
}

.ep-sidebar__admin svg {
  opacity: 1;
  stroke: var(--ep-blue);
}

.ep-sidebar__assist {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 16px;
  border: none;
  border-radius: var(--ep-radius-pill);
  background: var(--ep-navy);
  color: #fff;
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, transform 0.15s ease;
}

.ep-sidebar__assist:hover {
  background: var(--ep-blue);
}

.ep-sidebar__assist-icon {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  font-size: 13px;
  font-weight: 700;
}

/* ——— Main ——— */
.ep-main {
  flex: 1;
  margin-left: var(--ep-sidebar-w);
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
  padding: 16px 16px 16px 8px;
}

.ep-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 32px);
  background: var(--ep-surface);
  border-radius: 24px;
  box-shadow: var(--ep-shadow);
  overflow: hidden;
}

/* ——— Header ——— */
.ep-header {
  display: flex;
  align-items: center;
  gap: 20px;
  height: var(--ep-header-h);
  padding: 0 28px;
  border-bottom: 1px solid var(--ep-border);
  flex-shrink: 0;
}

.ep-header__menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--ep-border);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  color: var(--ep-navy);
}

.ep-header__search {
  flex: 1;
  max-width: 560px;
  margin: 0 auto;
  position: relative;
}

.ep-header__search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--ep-text-soft);
  pointer-events: none;
  z-index: 1;
}

.ep-header__search input {
  width: 100%;
  height: 44px;
  padding: 0 18px 0 46px;
  border: 1px solid var(--ep-border);
  border-radius: var(--ep-radius-pill);
  background: var(--ep-bg);
  font: inherit;
  font-size: 14px;
  color: var(--ep-text);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ep-header__search input::placeholder {
  color: var(--ep-text-muted);
}

.ep-header__search input:focus,
.ep-header__search.is-open input {
  border-color: var(--ep-border);
  background: #fff;
  box-shadow: none;
}

.ep-search-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 40;
  max-height: min(70vh, 480px);
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--ep-border);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 16px 40px rgba(0, 0, 48, 0.12);
}

.ep-search-panel__section + .ep-search-panel__section {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--ep-border);
}

.ep-search-panel__label {
  margin: 0 0 6px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ep-text-soft);
}

.ep-search-panel__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ep-search-panel__item {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
}

.ep-search-panel__item:hover,
.ep-search-panel__item.is-active {
  background: var(--ep-bg);
}

.ep-search-panel__thumb {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--ep-bg);
}

.ep-search-panel__thumb--icon {
  display: block;
  background:
    linear-gradient(135deg, rgba(0, 24, 228, 0.12), rgba(12, 192, 216, 0.16));
}

.ep-search-panel__text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ep-search-panel__title {
  font-size: 14px;
  font-weight: 700;
  color: var(--ep-navy);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ep-search-panel__meta {
  font-size: 12px;
  color: var(--ep-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ep-search-panel__badge {
  flex-shrink: 0;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(0, 24, 228, 0.08);
  color: var(--ep-blue);
  font-size: 11px;
  font-weight: 700;
}

.ep-search-panel__empty {
  margin: 0;
  padding: 18px 12px;
  text-align: center;
  color: var(--ep-text-muted);
  font-size: 14px;
}

.ep-search-page__section {
  margin-top: 28px;
}

.ep-search-page__heading {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 800;
  color: var(--ep-navy);
}

.ep-search-page__list {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--ep-bg);
  border-radius: var(--ep-radius);
  overflow: hidden;
}

.ep-search-page__item {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  text-decoration: none;
  color: inherit;
  border-top: 1px solid var(--ep-border);
}

.ep-search-page__list li:first-child .ep-search-page__item {
  border-top: none;
}

.ep-search-page__item:hover {
  background: #fff;
}

.ep-search-page__thumb {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  object-fit: cover;
  background: #fff;
}

.ep-search-page__thumb--icon {
  display: block;
  background: linear-gradient(135deg, rgba(0, 24, 228, 0.12), rgba(12, 192, 216, 0.16));
}

.ep-search-page__text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ep-search-page__title {
  font-weight: 700;
  color: var(--ep-navy);
}

.ep-search-page__meta {
  font-size: 13px;
  color: var(--ep-text-muted);
}

.ep-search-page__badge {
  padding: 5px 10px;
  border-radius: 999px;
  background: #fff;
  color: var(--ep-blue);
  font-size: 12px;
  font-weight: 700;
}

.ep-header__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.ep-icon-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--ep-navy);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease;
}

.ep-icon-btn:hover {
  background: var(--ep-bg);
}

.ep-icon-btn svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ep-icon-btn__badge {
  position: absolute;
  top: -2px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--ep-red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  box-sizing: border-box;
  box-shadow: 0 0 0 2px #fff;
}

.ep-icon-btn__badge--lg {
  min-width: 26px;
  padding: 0 6px;
  font-size: 9px;
  letter-spacing: -0.02em;
}

.ep-avatar {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 50%;
  background: var(--ep-blue);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  text-decoration: none;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.ep-avatar:hover,
.ep-account-menu.is-open .ep-avatar {
  box-shadow: none;
  transform: scale(1.03);
}

.ep-account-menu {
  position: relative;
}

.ep-account-menu__dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 80;
  width: min(280px, calc(100vw - 32px));
  padding: 8px;
  background: #fff;
  border: 1px solid var(--ep-border, #e4e6eb);
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(0, 0, 48, 0.12);
}

.ep-account-menu__identity {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 12px 14px;
  border-bottom: 1px solid var(--ep-border, #e4e6eb);
  margin-bottom: 6px;
}

.ep-account-menu__name {
  font-size: 14px;
  font-weight: 800;
  color: var(--ep-navy, #000000);
  line-height: 1.3;
}

.ep-account-menu__email {
  font-size: 12px;
  font-weight: 600;
  color: var(--ep-text-muted, #6b7280);
  word-break: break-all;
}

.ep-account-menu__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ep-account-menu__footer {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--ep-border, #e4e6eb);
}

.ep-account-menu__link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 10px;
  color: var(--ep-navy, #000000);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.15s ease;
}

.ep-account-menu__link:hover {
  background: var(--ep-bg, #f0f1f4);
}

.ep-account-menu__link svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ep-account-menu__link--logout {
  color: var(--ep-red, #ef4242);
}

.ep-account-menu__link--logout:hover {
  background: rgba(252, 36, 0, 0.08);
}

/* ——— Content ——— */
.ep-content {
  flex: 1;
  overflow-y: auto;
  padding: 28px 32px 40px;
}

.ep-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 24px;
  font-size: 13px;
  color: var(--ep-text-muted);
}

.ep-breadcrumb a {
  color: var(--ep-text-muted);
  text-decoration: none;
}

.ep-breadcrumb a:hover {
  color: var(--ep-blue);
}

.ep-breadcrumb__sep {
  opacity: 0.5;
}

.ep-breadcrumb__current {
  color: var(--ep-navy);
  font-weight: 600;
}

.ep-section {
  margin-bottom: 36px;
}

.ep-section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.ep-section__title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ep-navy);
}

.ep-section__title span {
  font-weight: 500;
  color: var(--ep-text-muted);
}

.ep-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ep-select {
  height: 36px;
  padding: 0 32px 0 14px;
  border: 1px solid var(--ep-border);
  border-radius: var(--ep-radius-pill);
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 12px center;
  font: inherit;
  font-size: 13px;
  color: var(--ep-text);
  appearance: none;
  cursor: pointer;
}

.ep-view-toggle {
  display: flex;
  border: 1px solid var(--ep-border);
  border-radius: var(--ep-radius-sm);
  overflow: hidden;
}

.ep-view-toggle button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 34px;
  border: none;
  background: #fff;
  color: var(--ep-text-muted);
  cursor: pointer;
}

.ep-view-toggle button.is-active {
  background: var(--ep-bg);
  color: var(--ep-navy);
}

.ep-view-toggle button + button {
  border-left: 1px solid var(--ep-border);
}

.ep-view-toggle svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
}

/* ——— Category cards ——— */
.ep-cat-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.ep-cat-card {
  display: block;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease;
}

.ep-cat-card:hover {
  transform: translateY(-2px);
}

.ep-cat-card__media {
  position: relative;
  aspect-ratio: 1;
  width: 100%;
  border-radius: var(--ep-radius);
  background: var(--ep-bg);
  overflow: hidden;
  margin-bottom: 10px;
  box-sizing: border-box;
}

.ep-cat-card__media img,
.ep-article__content .ep-cat-card__media img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  padding: 16px;
  box-sizing: border-box;
  object-fit: contain;
  object-position: center;
  border-radius: 0;
  display: block;
}

.ep-cat-card__media--placeholder {
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #e8eaf5 0%, #f5f6fa 100%);
  color: var(--ep-blue);
  font-weight: 800;
  font-size: 22px;
  opacity: 0.45;
}

.ep-cat-card__label {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ep-navy);
}

.ep-cat-card__count {
  color: var(--ep-text-muted);
  font-weight: 500;
}

/* ——— Product grid ——— */
.ep-product-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.ep-product-card {
  display: block;
  text-decoration: none;
  color: inherit;
  border-radius: var(--ep-radius);
  transition: transform 0.2s ease;
}

.ep-product-card:hover {
  transform: translateY(-2px);
}

.ep-product-card__media {
  aspect-ratio: 1;
  border-radius: var(--ep-radius);
  background: var(--ep-bg);
  overflow: hidden;
  margin-bottom: 12px;
}

.ep-product-card__media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  padding: 16px;
  image-rendering: auto;
  -webkit-backface-visibility: hidden;
}

.ep-product-card__media--placeholder {
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, #f3f4f8, #e9ebf3);
  color: var(--ep-text-soft);
  font-size: 13px;
  font-weight: 600;
}

.ep-product-card__title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--ep-navy);
}

.ep-product-card__price {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--ep-text-muted);
}

.ep-empty {
  padding: 48px 24px;
  text-align: center;
  color: var(--ep-text-muted);
  background: var(--ep-bg);
  border-radius: var(--ep-radius);
}

.ep-proto-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  padding: 12px 16px;
  border-radius: var(--ep-radius-sm);
  background: rgba(12, 192, 216, 0.12);
  border: 1px solid rgba(12, 192, 216, 0.35);
  color: var(--ep-navy);
  font-size: 13px;
}

.ep-proto-banner strong {
  color: var(--ep-blue);
}

/* ——— Overlay / mobile ——— */
.ep-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(0, 0, 48, 0.35);
}

@media (max-width: 1200px) {
  .ep-cat-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .ep-product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 960px) {
  .ep-sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    background: #fff;
    box-shadow: 4px 0 24px rgba(0, 0, 48, 0.08);
  }

  body.ep-sidebar-open .ep-sidebar {
    transform: translateX(0);
  }

  body.ep-sidebar-open .ep-sidebar-overlay {
    display: block;
  }

  .ep-main {
    margin-left: 0;
    padding: 12px;
  }

  .ep-header__menu-toggle {
    display: grid;
    flex-shrink: 0;
  }

  .ep-header {
    padding: 10px 14px;
    gap: 10px 12px;
  }

  .ep-header__actions {
    flex-shrink: 0;
    gap: 4px;
  }

  .ep-content {
    padding: 16px 14px 28px;
  }

  .ep-cat-grid,
  .ep-product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .ep-header {
    height: auto;
    min-height: 0;
    flex-wrap: wrap;
    align-items: center;
    padding: 12px 14px;
    row-gap: 10px;
  }

  .ep-header__menu-toggle {
    order: 1;
    width: 40px;
    height: 40px;
  }

  .ep-header__actions {
    order: 2;
    margin-left: auto;
  }

  .ep-header__search {
    order: 3;
    flex: 1 1 100%;
    max-width: none;
    margin: 0;
  }

  .ep-header__search input {
    height: 42px;
    font-size: 13px;
  }

  .ep-icon-btn,
  .ep-avatar {
    width: 40px;
    height: 40px;
  }

  .ep-breadcrumb {
    margin-top: 4px;
    margin-bottom: 14px;
  }

  .ep-search-panel {
    position: fixed;
    left: 12px;
    right: 12px;
    top: auto;
    width: auto;
  }

  .ep-cat-grid,
  .ep-product-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .ep-section__head {
    flex-direction: column;
    align-items: flex-start;
  }
}

.ep-article__content {
  max-width: 920px;
  line-height: 1.6;
}

.woocommerce-orders .ep-article__content,
.woocommerce-view-order .ep-article__content,
.woocommerce-factures .ep-article__content,
.woocommerce-edit-address .ep-article__content,
.woocommerce-cart .ep-article__content,
.woocommerce-checkout .ep-article__content {
  max-width: 100%;
  width: 100%;
}

.ep-article__content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--ep-radius);
}

.ep-section__link {
  font-size: 13px;
  font-weight: 600;
  color: var(--ep-blue);
  text-decoration: none;
}

.ep-section__link:hover {
  text-decoration: underline;
}

.ep-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 22px;
  border-radius: var(--ep-radius-pill);
  background: var(--ep-red);
  color: #fff !important;
  font-weight: 700;
  text-decoration: none;
}

.ep-order-list {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--ep-bg);
  border-radius: var(--ep-radius);
  overflow: hidden;
}

.ep-order-list__item + .ep-order-list__item {
  border-top: 1px solid var(--ep-border);
}

.ep-order-list__link {
  display: grid;
  grid-template-columns: 100px 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 16px 20px;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s ease;
}

.ep-order-list__link:hover {
  background: #fff;
}

.ep-order-list__id {
  font-weight: 700;
  color: var(--ep-navy);
}

.ep-order-list__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  font-size: 13px;
  color: var(--ep-text-muted);
}

.ep-order-list__status {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(0, 24, 228, 0.1);
  color: var(--ep-blue);
  font-weight: 600;
  font-size: 12px;
}

.ep-order-list__status--expedied,
.ep-order-list__status--livred,
.ep-order-list__status--completed,
.ep-order-list__status--accepted,
.ep-order-list__status--en-preparation {
  background: rgba(84, 192, 168, 0.18);
  color: #0f766e;
}

.ep-order-list__status--cancelled,
.ep-order-list__status--failed {
  background: rgba(252, 36, 0, 0.1);
  color: var(--ep-red);
}

.ep-order-list__total {
  font-weight: 700;
  color: var(--ep-navy);
  white-space: nowrap;
}

@media (max-width: 640px) {
  .ep-order-list__link {
    grid-template-columns: 1fr auto;
  }

  .ep-order-list__id {
    grid-column: 1 / -1;
  }
}

/* Soften leftover Divi markup if any page still embeds it */
.et_pb_section,
.et_pb_row,
.et_pb_column {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* ——— Graphique commandes ——— */
.ep-orders-chart {
  background: #fff;
  border: 1px solid var(--ep-border, #e4e6eb);
  border-radius: 16px;
  padding: 20px 22px 18px;
  margin: 0 0 28px;
}

.ep-orders-chart__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.ep-orders-chart__title {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  color: var(--ep-navy, #000000);
  letter-spacing: -0.02em;
}

.ep-orders-chart__controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.ep-orders-chart__metric {
  min-height: 36px;
  padding: 0 34px 0 14px;
  border: 1px solid var(--ep-border, #e4e6eb);
  border-radius: 999px;
  background: #e8f4fc url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23000330' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center;
  color: var(--ep-navy, #000000);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  appearance: none;
  cursor: pointer;
}

.ep-orders-chart__years {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  background: var(--ep-bg, #f0f1f4);
  border-radius: 999px;
}

.ep-orders-chart__year {
  min-height: 32px;
  padding: 0 14px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--ep-text-muted, #6b7280);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.ep-orders-chart__year.is-active {
  background: #0f766e;
  color: #fff;
}

.ep-orders-chart__canvas-wrap {
  position: relative;
  height: 280px;
  margin-bottom: 16px;
}

.ep-orders-chart__kpis {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--ep-border, #e4e6eb);
  border-radius: 12px;
  overflow: hidden;
}

.ep-orders-chart__kpi {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--ep-border, #e4e6eb);
}

.ep-orders-chart__kpi:last-child {
  border-bottom: none;
}

.ep-orders-chart__kpi-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--ep-text-muted, #6b7280);
}

.ep-orders-chart__kpi-value {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  font-size: 16px;
  font-weight: 800;
  color: var(--ep-navy, #000000);
  white-space: nowrap;
}

.ep-orders-chart__kpi-value small {
  font-size: 12px;
  font-weight: 700;
  color: var(--ep-text-soft, #9ca3af);
}

/* ——— Détail du compte ——— */
.ep-account-details {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.ep-account-details__head {
  margin-bottom: 20px;
}

.ep-account-details__title {
  margin: 0;
  font-size: clamp(24px, 3vw, 30px);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ep-navy, #000000);
}

.ep-account-details__sub {
  margin: 6px 0 0;
  color: var(--ep-text-muted, #6b7280);
  font-size: 14px;
}

.ep-account-details__form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ep-account-details__card {
  background: #fff;
  border: 1px solid var(--ep-border, #e4e6eb);
  border-radius: 14px;
  padding: 20px 22px 8px;
}

.ep-account-details__card-title {
  margin: 0 0 16px;
  font-size: 16px;
  font-weight: 800;
  color: var(--ep-navy, #000000);
}

.ep-account-details__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
}

.ep-account-details__form .form-row {
  margin: 0 0 16px;
  padding: 0;
  width: 100% !important;
  float: none !important;
}

.ep-account-details__form .form-row label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ep-navy, #000000);
}

.ep-account-details__form .form-row .required {
  color: var(--ep-red, #ef4242);
  text-decoration: none;
}

.ep-account-details__form .form-row input.input-text {
  width: 100%;
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid var(--ep-border, #e4e6eb);
  border-radius: 12px;
  background: #fff;
  font: inherit;
  box-shadow: none;
}

.ep-account-details__form .form-row input.input-text:focus {
  border-color: var(--ep-border);
  outline: none;
  box-shadow: none;
}

.ep-account-details__hint {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ep-text-soft, #9ca3af);
  font-style: normal;
}

.ep-account-details__hint--block {
  margin: -6px 0 14px;
}

.ep-account-details__actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 4px;
}

.ep-account-details__actions .button {
  min-height: 48px;
  padding: 0 22px;
}

@media (max-width: 720px) {
  .ep-orders-chart__head {
    align-items: flex-start;
    flex-direction: column;
  }

  .ep-orders-chart__canvas-wrap {
    height: 220px;
  }

  .ep-orders-chart__kpi {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .ep-account-details__grid {
    grid-template-columns: 1fr;
  }

  .ep-account-details__actions {
    justify-content: stretch;
  }

  .ep-account-details__actions .button {
    width: 100%;
  }
}


/* ——— Mes adresses ——— */
.ep-addresses,
.ep-address-edit,
.ep-address-book {
  margin-bottom: 24px;
}

.ep-addresses__head,
.ep-address-edit__head {
  margin-bottom: 20px;
}

.ep-addresses__title,
.ep-address-edit__title {
  margin: 0;
  font-size: clamp(24px, 3vw, 30px);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ep-navy, #000000);
}

.ep-addresses__sub,
.ep-address-edit__sub {
  margin: 6px 0 0;
  color: var(--ep-text-muted, #6b7280);
  font-size: 14px;
}

.ep-addresses__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.ep-addresses__grid--two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ep-addresses__card,
.ep-address-book__card,
.ep-address-edit__card {
  background: #fff;
  border: 1px solid var(--ep-border, #e4e6eb);
  border-radius: 14px;
  padding: 18px 20px;
  min-width: 0;
}

.ep-addresses__card-head,
.ep-address-book__card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.ep-addresses__card-title,
.ep-address-book__card-head h3 {
  margin: 6px 0 0;
  font-size: 16px;
  font-weight: 800;
  color: var(--ep-navy, #000000);
}

.ep-addresses__badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(0, 24, 228, 0.1);
  color: var(--ep-blue, #ef4242);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ep-addresses__badge--shipping {
  background: rgba(15, 118, 110, 0.12);
  color: #0f766e;
}

.ep-addresses__badge--default {
  background: rgba(15, 118, 110, 0.12);
  color: #0f766e;
  text-transform: none;
  letter-spacing: 0;
  font-size: 12px;
}

.ep-addresses__edit {
  font-size: 13px;
  font-weight: 700;
  color: var(--ep-blue, #ef4242);
  text-decoration: none;
  white-space: nowrap;
}

.ep-addresses__edit:hover {
  text-decoration: underline;
}

.ep-addresses__body,
.ep-address-book__body {
  display: block;
  margin: 0;
  font-style: normal;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ep-navy, #000000);
}

.ep-addresses__empty {
  color: var(--ep-text-muted, #6b7280);
}

.ep-addresses__card-foot {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--ep-border, #e4e6eb);
}

.ep-addresses__cta {
  width: 100%;
}

.ep-addresses__cta--ghost,
.woocommerce a.button.ep-addresses__cta--ghost,
.woocommerce a.ep-addresses__cta--ghost {
  background: var(--ep-bg, #f0f1f4) !important;
  color: var(--ep-navy, #000000) !important;
}

.ep-addresses__cta--ghost:hover,
.woocommerce a.button.ep-addresses__cta--ghost:hover {
  background: #e4e6eb !important;
}

.ep-address-edit__back {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  margin-bottom: 12px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--ep-bg, #f0f1f4);
  color: var(--ep-navy, #000000);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.ep-address-edit__back:hover {
  background: #e4e6eb;
}

.ep-address-edit__form .form-row {
  margin: 0 0 14px;
  padding: 0;
}

.ep-address-edit__form .form-row label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ep-navy, #000000);
}

.ep-address-edit__form .form-row .required {
  color: var(--ep-red, #ef4242);
  text-decoration: none;
}

.ep-address-edit__form .form-row input.input-text,
.ep-address-edit__form .form-row textarea,
.ep-address-edit__form .form-row select,
.ep-address-edit__form .select2-container .select2-selection--single {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--ep-border, #e4e6eb) !important;
  border-radius: 12px !important;
  background: #fff !important;
  box-shadow: none !important;
}

.ep-address-edit__form .form-row-first,
.ep-address-edit__form .form-row-last {
  width: 48%;
}

.ep-address-edit__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--ep-border, #e4e6eb);
}

.ep-address-edit__cancel {
  font-size: 14px;
  font-weight: 700;
  color: var(--ep-text-muted, #6b7280);
  text-decoration: none;
}

.ep-address-edit__cancel:hover {
  color: var(--ep-navy, #000000);
}

.ep-address-book {
  margin-top: 28px;
}

.ep-address-book__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.ep-address-book__title {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  color: var(--ep-navy, #000000);
}

.ep-address-book__desc {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--ep-text-muted, #6b7280);
  max-width: 52ch;
}

.ep-addresses__add-btn,
.woocommerce a.button.ep-addresses__add-btn,
.woocommerce a.ep-addresses__add-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px !important;
  border-radius: 999px !important;
  background: var(--ep-navy, #000000) !important;
  color: #fff !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  text-decoration: none !important;
  white-space: nowrap;
}

.ep-addresses__add-btn:hover,
.woocommerce a.button.ep-addresses__add-btn:hover {
  background: var(--ep-blue, #ef4242) !important;
}

.ep-addresses__add-btn.disabled {
  opacity: 0.55;
  cursor: not-allowed;
  background: var(--ep-bg, #f0f1f4) !important;
  color: var(--ep-text-muted, #6b7280) !important;
}

.ep-address-book__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.ep-address-book__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--ep-border, #e4e6eb);
}

.ep-address-book__btn,
.woocommerce .ep-address-book__btn.button,
.woocommerce button.ep-address-book__btn {
  min-height: 36px !important;
  padding: 0 14px !important;
  border-radius: 999px !important;
  background: var(--ep-bg, #f0f1f4) !important;
  color: var(--ep-navy, #000000) !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  border: none !important;
}

.ep-address-book__btn:hover,
.woocommerce .ep-address-book__btn.button:hover {
  background: #e4e6eb !important;
}

.woocommerce a.button.ep-address-book__btn.wc-address-book-edit {
  background: var(--ep-navy, #000000) !important;
  color: #fff !important;
}

.woocommerce button.ep-address-book__btn--danger,
.woocommerce .ep-address-book__btn--danger.button {
  color: var(--ep-red, #ef4242) !important;
  background: rgba(252, 36, 0, 0.08) !important;
}

.ep-address-book__tools {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.ep-address-book__tool {
  background: #fff;
  border: 1px solid var(--ep-border, #e4e6eb);
  border-radius: 14px;
  padding: 16px 18px;
}

.ep-address-book__tool h3 {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 800;
}

/* Override WC float columns on addresses */
.woocommerce-account .woocommerce-Addresses,
.woocommerce-account .u-columns.woocommerce-Addresses {
  float: none !important;
  width: 100% !important;
}

.woocommerce-account .woocommerce-Address,
.woocommerce-account .u-column1,
.woocommerce-account .u-column2 {
  float: none !important;
  width: 100% !important;
}

@media (max-width: 800px) {
  .ep-addresses__grid--two,
  .ep-address-book__grid,
  .ep-address-book__tools {
    grid-template-columns: 1fr;
  }

  .ep-address-edit__form .form-row-first,
  .ep-address-edit__form .form-row-last {
    width: 100%;
  }

  .ep-address-edit__actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .ep-address-edit__actions .button {
    width: 100%;
  }
}
