/* Boutique vêtements — Sports Équilibre */
@import url('https://fonts.googleapis.com/css?family=Roboto:400,500,600,700,800&display=swap');

:root {
  --brand: #2563eb;
  --brand-hover: #1d4ed8;
  --accent: #8dc63f;
  --text: #0b1220;
  --text-muted: rgba(11, 18, 32, 0.58);
  --surface: #ffffff;
  --bg: #f0f2f8;
  --border: rgba(0, 0, 0, 0.09);
  --shadow: 0 10px 40px rgba(15, 23, 42, 0.08);
  --radius: 14px;
  --font: 'Roboto', system-ui, -apple-system, sans-serif;
}

.boutique-page {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
}

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

.boutique-page .muted {
  color: var(--text-muted);
  font-size: 13px;
}

/* Bandeau DEV */
.dev-banner {
  background: linear-gradient(90deg, #92400e, #b45309);
  color: #fff;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  padding: 7px 12px;
  letter-spacing: 0.02em;
}

/* En-tête */
.boutique-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
}

.boutique-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.boutique-brand {
  font-weight: 800;
  font-size: 17px;
  text-decoration: none;
  color: var(--text);
  white-space: nowrap;
}

.boutique-brand span { color: var(--brand); }

.boutique-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.boutique-nav a {
  text-decoration: none;
  color: rgba(11, 18, 32, 0.78);
  font-size: 14px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 999px;
  transition: background 0.15s, color 0.15s;
}

.boutique-nav a:hover {
  background: rgba(141, 198, 63, 0.16);
  color: var(--text);
}

.boutique-nav a.boutique-nav__current {
  background: rgba(37, 99, 235, 0.1);
  color: var(--brand);
  font-weight: 700;
}

.boutique-nav a.boutique-nav__current:hover {
  background: rgba(37, 99, 235, 0.14);
  color: var(--brand-hover);
}

.boutique-cart-btn {
  position: relative;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 999px;
  padding: 8px 16px;
  font-weight: 700;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  color: var(--text);
  margin-left: 6px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.boutique-cart-btn:hover {
  border-color: rgba(37, 99, 235, 0.35);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.12);
}

.boutique-cart-btn .badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: var(--brand);
  color: #fff;
  font-size: 11px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  border: 2px solid #fff;
}

/* Contenu */
.boutique-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 20px 72px;
}

.boutique-hero {
  text-align: center;
  margin-bottom: 28px;
  padding: 8px 0 4px;
}

.boutique-hero h1 {
  margin: 0 0 10px;
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.boutique-hero p {
  margin: 0 auto;
  color: var(--text-muted);
  max-width: 520px;
  font-size: 15px;
}

.boutique-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.boutique-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-chip {
  border: 1px solid var(--border);
  background: var(--bg);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  color: rgba(11, 18, 32, 0.8);
  transition: all 0.15s;
}

.filter-chip:hover {
  border-color: rgba(37, 99, 235, 0.3);
  color: var(--brand);
}

.filter-chip.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

#catalogStatus {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

/* Grille produits */
.boutique-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 22px;
}

.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s;
}

.product-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-3px);
  border-color: rgba(37, 99, 235, 0.15);
}

.product-card__media {
  position: relative;
  background: #e8ecf4;
  overflow: hidden;
}

.product-card__img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.product-card__img--placeholder {
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
}

.product-card__body {
  padding: 14px 16px 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.product-card__cat {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brand);
  font-weight: 800;
}

.product-card__name {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
}

.product-card__price {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text);
  margin-top: 2px;
}

.product-card__stock {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

.product-card__stock--out {
  color: #dc2626;
  font-weight: 600;
}

.product-card__actions {
  margin-top: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding-top: 12px;
}

/* Boutons */
.btn-boutique {
  border: none;
  border-radius: 10px;
  padding: 11px 14px;
  font-weight: 700;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
}

.btn-boutique:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.btn-boutique--primary {
  background: var(--brand);
  color: #fff;
}

.btn-boutique--primary:hover:not(:disabled) {
  background: var(--brand-hover);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.btn-boutique--ghost {
  background: rgba(37, 99, 235, 0.08);
  color: var(--brand);
  border: 1px solid rgba(37, 99, 235, 0.15);
}

.btn-boutique--ghost:hover:not(:disabled) {
  background: rgba(37, 99, 235, 0.14);
}

.btn-boutique:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Panier — fond + tiroir */
.cart-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 140;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s;
}

.cart-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

body.boutique-cart-open {
  overflow: hidden;
}

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(420px, 100vw);
  height: 100vh;
  height: 100dvh;
  background: var(--surface);
  z-index: 150;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -12px 0 48px rgba(15, 23, 42, 0.18);
  display: flex;
  flex-direction: column;
}

.cart-drawer.open {
  transform: translateX(0);
}

.cart-drawer__head {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.cart-drawer__head strong {
  font-size: 1.1rem;
  font-weight: 800;
}

.cart-drawer__close {
  border: none;
  background: var(--bg);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: var(--text);
  display: grid;
  place-items: center;
  transition: background 0.15s;
}

.cart-drawer__close:hover {
  background: rgba(0, 0, 0, 0.08);
}

.cart-drawer__body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 20px 16px;
  -webkit-overflow-scrolling: touch;
}

.cart-drawer__empty {
  text-align: center;
  padding: 40px 16px;
  color: var(--text-muted);
}

.cart-line {
  display: flex;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  align-items: flex-start;
}

.cart-line:last-child {
  border-bottom: none;
}

.cart-line__thumb {
  width: 72px;
  height: 72px;
  border-radius: 10px;
  object-fit: cover;
  background: #e8ecf4;
  flex-shrink: 0;
}

.cart-line__thumb--empty {
  display: block;
  background: #e8ecf4;
}

.cart-line__info {
  flex: 1;
  min-width: 0;
}

.cart-line__info strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
}

.cart-line__meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.cart-line__controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.cart-line__qty {
  width: 64px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
}

.cart-line__remove {
  border: none;
  background: none;
  color: #dc2626;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  padding: 4px 0;
  font-family: inherit;
}

.cart-line__remove:hover {
  text-decoration: underline;
}

.cart-line__price {
  font-weight: 800;
  font-size: 15px;
  white-space: nowrap;
  padding-top: 2px;
}

.cart-drawer__foot {
  padding: 18px 20px 22px;
  border-top: 1px solid var(--border);
  background: #fafbfd;
  flex-shrink: 0;
}

.cart-total {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 14px;
}

.cart-note-label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
}

.cart-note {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: inherit;
  font-size: 14px;
  resize: vertical;
  min-height: 64px;
  margin-bottom: 14px;
}

.cart-drawer__foot .btn-boutique--primary {
  width: 100%;
  padding: 14px;
  font-size: 15px;
}

.cart-footnote {
  margin: 12px 0 0;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.45;
}

/* Modal produit */
.boutique-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.boutique-modal.open {
  display: flex;
}

.boutique-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
}

.boutique-modal__panel {
  position: relative;
  background: var(--surface);
  border-radius: 18px;
  max-width: 440px;
  width: 100%;
  max-height: 90vh;
  overflow: auto;
  padding: 24px;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.25);
}

.boutique-modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  border: none;
  background: var(--bg);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  z-index: 1;
}

.boutique-modal__close:hover {
  background: rgba(0, 0, 0, 0.08);
}

#modalImg {
  width: 100%;
  border-radius: 12px;
  margin-bottom: 14px;
  max-height: 240px;
  object-fit: cover;
  display: block;
}

#modalTitle {
  margin: 0 0 8px;
  font-size: 1.35rem;
  font-weight: 800;
  padding-right: 36px;
}

#modalDesc {
  margin: 0 0 12px;
}

#modalPrice {
  font-size: 1.35rem;
  font-weight: 800;
  margin: 0 0 16px;
}

.modal-field-label {
  margin: 0 0 8px;
  font-weight: 700;
  font-size: 13px;
}

#modalSizes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

#modalSizes label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

#modalSizes label:has(input:checked) {
  border-color: var(--brand);
  background: rgba(37, 99, 235, 0.1);
  color: var(--brand);
}

#modalSizes input {
  accent-color: var(--brand);
}

#modalQty {
  width: 88px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  margin-bottom: 16px;
  display: block;
}

#modalAddBtn {
  width: 100%;
  padding: 14px;
}

/* Admin */
.boutique-admin {
  margin-top: 56px;
  padding-top: 36px;
  border-top: 1px solid var(--border);
}

.boutique-admin h2 {
  margin: 0 0 8px;
  font-size: 1.35rem;
  font-weight: 800;
}

.boutique-admin h3 {
  margin: 24px 0 12px;
  font-size: 1.05rem;
  font-weight: 700;
}

.admin-form-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 24px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.03);
}

.admin-form-row {
  display: grid;
  gap: 14px;
}

.admin-form-row--1 { grid-template-columns: 1fr; }
.admin-form-row--2 { grid-template-columns: repeat(2, 1fr); }
.admin-form-row--3 { grid-template-columns: repeat(3, 1fr); }
.admin-form-row--4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 900px) {
  .admin-form-row--3,
  .admin-form-row--4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
  .admin-form-row--2,
  .admin-form-row--3,
  .admin-form-row--4 { grid-template-columns: 1fr; }
}

.admin-form-row--actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.boutique-form-field label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text-muted);
}

.boutique-form-field input,
.boutique-form-field select,
.boutique-form-field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
}

.boutique-form-field input:focus,
.boutique-form-field select:focus,
.boutique-form-field textarea:focus {
  outline: none;
  border-color: rgba(37, 99, 235, 0.5);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.boutique-form-field textarea {
  min-height: 88px;
  resize: vertical;
}

.boutique-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.boutique-checkbox input {
  width: 18px;
  height: 18px;
  accent-color: var(--brand);
}

.admin-form-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.admin-form-buttons .btn-boutique {
  flex: none;
  min-width: 140px;
}

.admin-table-wrap {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.admin-products-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 640px;
}

.admin-products-table th,
.admin-products-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.admin-products-table th {
  background: #f8fafc;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 700;
}

.admin-products-table tbody tr:hover {
  background: rgba(37, 99, 235, 0.03);
}

.admin-thumb {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 8px;
  background: #e8ecf4;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.admin-actions .btn-boutique {
  flex: none;
  width: auto;
  padding: 8px 12px;
  font-size: 12px;
}

.site-image-preview {
  display: block;
  margin-top: 12px;
  max-width: 220px;
  max-height: 140px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.site-image-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
  max-height: 200px;
  overflow-y: auto;
  padding: 4px;
}

.site-image-gallery__item {
  border: 2px solid transparent;
  border-radius: 10px;
  padding: 0;
  background: #fff;
  cursor: pointer;
  overflow: hidden;
  width: 80px;
  height: 80px;
  flex-shrink: 0;
}

.site-image-gallery__item.is-selected {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.site-image-gallery__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.boutique-empty {
  text-align: center;
  padding: 56px 24px;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  margin-bottom: 24px;
}

.boutique-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--text);
  color: #fff;
  padding: 14px 22px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.3s, opacity 0.3s;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.boutique-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.boutique-footer {
  text-align: center;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.boutique-footer a {
  color: var(--brand);
  font-weight: 600;
  text-decoration: none;
}

.boutique-footer a:hover {
  text-decoration: underline;
}

@media (max-width: 640px) {
  .boutique-header-inner {
    flex-direction: column;
    align-items: stretch;
  }

  .boutique-nav {
    justify-content: center;
  }

  .product-card__actions {
    grid-template-columns: 1fr;
  }

  .admin-products-table th:nth-child(4),
  .admin-products-table td:nth-child(4) {
    display: none;
  }
}
