/* ==========================================================================
   R.O.S.E.S. — boutique.css  (refonte avec sidebar)
   ========================================================================== */

/* ── Barre catégories horizontale haut ───────────────────────────────────── */
.shop-top-bar {
  background: #fff;
  border-bottom: 1px solid var(--c-border);
  padding: 0;
}
.shop-top-inner {
  display: flex; align-items: center;
  justify-content: space-between;
  gap: 20px; flex-wrap: wrap;
  padding: 11px 0;
}
.shop-top-cats { display: flex; flex-wrap: wrap; gap: 0; }
.shop-top-cats a {
  padding: 6px 14px; font-size: .83rem;
  color: var(--c-text-soft); font-weight: 500;
  border-right: 1px solid var(--c-border-soft);
  transition: color var(--tr);
}
.shop-top-cats a:first-child { padding-left: 0; }
.shop-top-cats a:hover  { color: var(--c-text); }
.shop-top-cats a.active { color: var(--c-text); font-weight: 700; }

.shop-top-contact {
  display: flex; gap: 18px; align-items: center; flex-shrink: 0;
}
.shop-top-contact span {
  display: flex; align-items: center; gap: 5px;
  font-size: .78rem; color: var(--c-text-muted);
}
.shop-top-contact svg { flex-shrink: 0; }

/* ── Layout général boutique ─────────────────────────────────────────────── */
.shop-layout { padding: clamp(20px,3vw,36px) 0 60px; }
.shop-inner  { display: grid; grid-template-columns: 220px 1fr; gap: 28px; align-items: start; }
@media (max-width:820px) {
  .shop-inner { grid-template-columns: 1fr; }
  .shop-sidebar { display: none; }
  .shop-sidebar.open { display: flex; flex-direction: column; }
}

/* ── Sidebar ─────────────────────────────────────────────────────────────── */
.shop-sidebar {
  position: sticky; top: 70px;
  display: flex; flex-direction: column; gap: 0;
  /* Sur desktop, la sidebar est toujours visible et au-dessus du contenu */
  z-index: 1;
}

.shop-search-wrap {
  display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--c-border); background: #fff;
  padding: 8px 10px; margin-bottom: 1px;
}
.shop-search-wrap svg { flex-shrink: 0; color: var(--c-text-muted); }
.shop-search-wrap input {
  border: none; outline: none; background: transparent;
  font-size: .85rem; width: 100%; color: var(--c-text);
}

.shop-filter-block {
  border: 1px solid var(--c-border); border-top: none;
  background: #fff; padding: 14px 14px 10px;
}
.shop-filter-block:first-of-type { border-top: 1px solid var(--c-border); }

.shop-filter-title {
  font-size: .72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .1em;
  color: var(--c-text); margin-bottom: 12px;
}

/* Slider prix */
.price-slider-wrap { margin-bottom: 8px; }
.price-slider-wrap input[type=range] {
  width: 100%; accent-color: var(--c-text); height: 2px;
  cursor: pointer;
}
.price-range-labels {
  display: flex; justify-content: space-between;
  font-size: .77rem; color: var(--c-text-soft); margin-top: 6px;
}
#priceVal { font-weight: 600; color: var(--c-text); }
.shop-filter-apply {
  display: inline-block; margin-top: 8px;
  font-size: .77rem; font-weight: 600; color: var(--c-brand-light);
  text-decoration: underline; text-underline-offset: 3px;
}

/* Catégories filtre */
.shop-filter-cat {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 0; font-size: .84rem; color: var(--c-text-soft);
  border-bottom: 1px solid var(--c-border-soft);
  transition: color var(--tr);
}
.shop-filter-cat:last-of-type { border-bottom: none; }
.shop-filter-cat:hover { color: var(--c-text); }
.shop-filter-cat.active { color: var(--c-text); font-weight: 600; }
.shop-filter-check {
  width: 14px; height: 14px; border: 1.5px solid var(--c-border);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; color: var(--c-text);
}
.shop-filter-cat.active .shop-filter-check { border-color: var(--c-text); background: var(--c-text); color: #fff; }
.shop-filter-nb {
  margin-left: auto; font-size: .72rem; color: var(--c-text-muted);
  background: var(--c-bg-soft); border: 1px solid var(--c-border-soft);
  min-width: 20px; height: 18px; display: flex; align-items: center;
  justify-content: center; padding: 0 5px;
}
.shop-filter-reset {
  display: block; margin-top: 8px; font-size: .76rem;
  color: var(--c-danger,#8c1a1a); text-decoration: underline;
  text-underline-offset: 2px;
}

/* Bestsellers sidebar */
.shop-bestseller {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0; border-bottom: 1px solid var(--c-border-soft);
  text-decoration: none; color: inherit;
  transition: opacity var(--tr);
}
.shop-bestseller:last-child { border-bottom: none; }
.shop-bestseller:hover { opacity: .75; }
.shop-bestseller-img {
  width: 44px; height: 44px; flex-shrink: 0;
  background: var(--c-bg-soft); border: 1px solid var(--c-border-soft);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.shop-bestseller-img img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.shop-bestseller-img svg { width: 20px; height: 20px; color: var(--c-border); }
.shop-bestseller-info { display: flex; flex-direction: column; gap: 2px; }
.shop-bestseller-info strong { font-size: .8rem; font-weight: 600; color: var(--c-text); line-height: 1.3; }
.shop-bestseller-info span  { font-size: .77rem; color: var(--c-text-soft); }

/* ── Toolbar ─────────────────────────────────────────────────────────────── */
.shop-toolbar {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; margin-bottom: 16px; flex-wrap: wrap;
}
.shop-count { font-size: .83rem; color: var(--c-text-soft); }

/* ── Grille produits ─────────────────────────────────────────────────────── */
.product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 4px;
}
@media (max-width:960px) { .product-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width:480px) { .product-grid { grid-template-columns: 1fr; } }

.product-card {
  background: #fff;
  display: flex; flex-direction: column;
  text-decoration: none; color: inherit;
  border: 1px solid var(--c-border);
  transition: background var(--tr), box-shadow var(--tr);
}
.product-card:hover { background: var(--c-bg-soft); box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.product-card:hover .product-add-btn { background: var(--c-text); color: #fff; }

.product-thumb {
  height: 200px;
  background: var(--c-bg-soft);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; position: relative;
  border-bottom: 1px solid var(--c-border-soft);
}
.product-thumb img {
  width: 100%; height: 100%;
  object-fit: contain; padding: 20px; display: block;
}
.product-thumb-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
}
.product-thumb-placeholder svg { width: 36px; height: 36px; color: var(--c-border); opacity: .4; }

.product-tag {
  position: absolute; top: 0; left: 0;
  background: #dc2626; color: #fff;
  font-size: .62rem; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; padding: 3px 8px;
}

.product-card-body { padding: 12px 14px 14px; flex: 1; display: flex; flex-direction: column; }
.product-categ {
  font-size: .62rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .09em; color: var(--c-text-muted); margin-bottom: 4px; display: block;
}
.product-card-body h3 {
  font-size: .88rem; font-weight: 600; line-height: 1.3;
  color: var(--c-text); flex: 1; margin-bottom: 8px;
}
.product-price-row {
  display: flex; align-items: baseline; gap: 7px; margin-bottom: 10px;
}
.product-price     { font-size: .95rem; font-weight: 700; color: var(--c-text); }
.product-price-old { font-size: .78rem; color: var(--c-text-muted); text-decoration: line-through; }

.product-add-btn {
  display: flex; align-items: center; justify-content: center;
  padding: 7px 10px; font-size: .78rem; font-weight: 600;
  border: 1px solid var(--c-border); color: var(--c-text);
  background: #fff; transition: background var(--tr), color var(--tr);
  margin-top: auto;
}
.product-add-btn.out { color: var(--c-text-muted); border-color: var(--c-border-soft); }

/* ── Empty state ─────────────────────────────────────────────────────────── */
.shop-empty {
  text-align: center; padding: 60px 20px;
  background: var(--c-bg-soft); border: 1px solid var(--c-border-soft);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.shop-empty svg { opacity: .2; margin-bottom: 4px; }
.shop-empty h3  { font-size: 1rem; }
.shop-empty p   { color: var(--c-text-muted); font-size: .86rem; }

/* ── Pagination ──────────────────────────────────────────────────────────── */
.shop-pagination {
  display: flex; gap: 2px; padding-top: 20px; flex-wrap: wrap;
}
.shop-pagination a {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 32px; height: 32px; padding: 0 8px;
  font-size: .8rem; border: 1px solid var(--c-border);
  color: var(--c-text-soft); transition: background var(--tr), color var(--tr);
}
.shop-pagination a:hover   { background: var(--c-bg-soft); color: var(--c-text); }
.shop-pagination a.current { background: var(--c-text); color: #fff; border-color: var(--c-text); }

/* ── Fiche produit ───────────────────────────────────────────────────────── */
.product-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; padding: clamp(28px,5vw,56px) 0; }
@media (max-width:780px) { .product-detail { grid-template-columns: 1fr; gap: 20px; } }
.product-detail .gallery { background: var(--c-bg-soft); border: 1px solid var(--c-border); height: 360px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.product-detail .gallery img { width: 100%; height: 100%; object-fit: contain; padding: 28px; display: block; }
.product-detail .gallery svg { width: 56px; height: 56px; color: var(--c-border); opacity: .3; }
.product-detail .info h1 { font-size: clamp(1.3rem,2.5vw,1.75rem); margin-bottom: 8px; }
.product-detail .price-row { display: flex; align-items: baseline; gap: 12px; margin: 18px 0; border-top: 1px solid var(--c-border-soft); border-bottom: 1px solid var(--c-border-soft); padding: 14px 0; }
.product-detail .price-row .price { font-size: 1.6rem; font-weight: 700; }
.product-detail .price-row .price-old { font-size: 1rem; color: var(--c-text-muted); text-decoration: line-through; }
.product-detail .desc { color: var(--c-text-soft); line-height: 1.72; margin-bottom: 22px; font-size: .9rem; }
.product-detail .stock { font-size: .85rem; font-weight: 600; margin-bottom: 18px; }
.product-detail .stock.ok  { color: #1a5c38; } .product-detail .stock.low { color: #7c4a0e; } .product-detail .stock.out { color: #8c1a1a; }
.product-detail .buy-row { display: flex; gap: 10px; align-items: center; }
.qty-input { width: 70px; padding: 10px; border: 1.5px solid var(--c-border); text-align: center; font-weight: 600; font-size: .9rem; border-radius: var(--r); }

/* ── Panier ──────────────────────────────────────────────────────────────── */
.cart-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; align-items: start; }
@media (max-width:780px) { .cart-grid { grid-template-columns: 1fr; } }
.cart-list { display: flex; flex-direction: column; border: 1px solid var(--c-border-soft); }
.cart-item { background: #fff; padding: 16px; display: grid; grid-template-columns: 64px 1fr auto auto; gap: 14px; align-items: center; border-bottom: 1px solid var(--c-border-soft); transition: background var(--tr); }
.cart-item:last-child { border-bottom: none; }
.cart-item:hover { background: var(--c-bg-soft); }
.cart-item .pic { width: 64px; height: 64px; background: var(--c-bg-soft); border: 1px solid var(--c-border-soft); display: flex; align-items: center; justify-content: center; overflow: hidden; flex-shrink: 0; }
.cart-item .pic img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.cart-item .pic svg { width: 24px; height: 24px; color: var(--c-border); }
.cart-item h3 { font-size: .88rem; margin-bottom: 3px; }
.cart-item .meta { font-size: .78rem; color: var(--c-text-muted); }
.cart-item .qty { width: 54px; text-align: center; padding: 6px 4px; border: 1.5px solid var(--c-border); border-radius: var(--r); font-size: .86rem; }
.cart-item .line-price { font-weight: 700; font-size: .9rem; white-space: nowrap; }
.cart-item .remove { color: var(--c-danger,#8c1a1a); font-size: .8rem; cursor: pointer; background: none; border: 0; }
.cart-summary { background: var(--c-bg-soft); border: 1px solid var(--c-border); padding: 20px; position: sticky; top: 70px; }
.cart-summary h3 { font-size: .9rem; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--c-border); }
.cart-summary .line { display: flex; justify-content: space-between; padding: 6px 0; font-size: .85rem; color: var(--c-text-soft); }
.cart-summary .line.total { font-weight: 700; font-size: .95rem; color: var(--c-text); border-top: 1px solid var(--c-border); padding-top: 12px; margin-top: 4px; }
.cart-empty { text-align: center; padding: 56px 20px; background: var(--c-bg-soft); border: 1px solid var(--c-border-soft); }

/* ── Compte ──────────────────────────────────────────────────────────────── */
.account-grid { display: grid; grid-template-columns: 200px 1fr; gap: 24px; padding: 40px 0; }
@media (max-width:760px) { .account-grid { grid-template-columns: 1fr; } }
.account-nav { display: flex; flex-direction: column; border: 1px solid var(--c-border); background: #fff; align-self: start; }
.account-nav a { padding: 10px 14px; font-size: .85rem; color: var(--c-text-soft); font-weight: 500; border-bottom: 1px solid var(--c-border-soft); transition: background var(--tr), color var(--tr); }
.account-nav a:last-child { border-bottom: none; }
.account-nav a:hover, .account-nav a.active { background: var(--c-bg-soft); color: var(--c-text); }
.account-panel { background: #fff; border: 1px solid var(--c-border); padding: 24px; }
.account-panel h2 { font-size: 1.15rem; margin-bottom: 18px; padding-bottom: 12px; border-bottom: 1px solid var(--c-border-soft); }
.order-row { display: grid; grid-template-columns: 1fr auto auto auto; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--c-border-soft); align-items: center; font-size: .86rem; }
.order-row:last-child { border-bottom: 0; }

/* ── Bouton filtres mobile ────────────────────────────────────────────────── */
.shop-mobile-filter-btn {
  display: none;
  align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
@media (max-width: 820px) {
  .shop-mobile-filter-btn { display: flex; }
  /* Sidebar mobile : position normale dans le flux, pas sticky */
  .shop-sidebar {
    position: static !important;
    order: -1; /* au-dessus de la grille */
    border: 1px solid var(--c-border);
    background: #fff;
    padding: 12px;
    margin-bottom: 16px;
  }
  .shop-sidebar .shop-search-wrap { border: 1px solid var(--c-border); }
  .shop-filter-block { border-top: 1px solid var(--c-border) !important; }
  /* La sidebar est cachée par défaut sur mobile */
  .shop-sidebar:not(.open) { display: none !important; }
}
