/* =============================================
   SHOP PAGE
   ============================================= */
.shop-page {
  background: #fff;
  padding-bottom: 24px;
}

/* ===== TABS CATÉGORIES ===== */
.cat-tabs-wrap {
  padding: 16px 14px 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.cat-tabs-wrap::-webkit-scrollbar { display: none; }

.cat-tabs {
  display: flex;
  gap: 10px;
  width: max-content;
  padding-bottom: 12px;
}

.cat-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  min-width: 64px;
}

.cat-tab-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: #f5f5f5;
  border: 2px solid #ebebeb;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: border-color 0.2s, background 0.2s;
  font-size: 24px;
}
.cat-tab-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cat-tab.active .cat-tab-icon {
  border-color: #F05A1A;
  background: #FFF0E8;
}

.cat-tab-label {
  font-size: 11px;
  font-weight: 500;
  color: #666;
  text-align: center;
}
.cat-tab.active .cat-tab-label {
  color: #F05A1A;
  font-weight: 700;
}

/* ===== SHOP HEADER ===== */
.shop-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 14px 10px;
}

.shop-title {
  font-size: 20px;
  font-weight: 700;
  color: #1a1a1a;
}

.shop-actions {
  display: flex;
  gap: 8px;
}

.shop-action-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: #f5f5f5;
  border: 1px solid #e8e8e8;
  border-radius: 10px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 500;
  color: #1a1a1a;
  cursor: pointer;
}
.shop-action-btn svg {
  width: 14px;
  height: 14px;
  stroke: #1a1a1a;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
}

/* ===== SOUS-ONGLETS ===== */
.shop-subtabs {
  display: flex;
  gap: 0;
  padding: 0 14px;
  border-bottom: 2px solid #f0f0f0;
  overflow-x: auto;
  scrollbar-width: none;
}
.shop-subtabs::-webkit-scrollbar { display: none; }

.subtab {
  background: none;
  border: none;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 500;
  color: #999;
  cursor: pointer;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.15s;
}
.subtab.active {
  color: #F05A1A;
  font-weight: 700;
  border-bottom-color: #F05A1A;
}

/* ===== GRILLE PRODUITS ===== */
.shop-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 16px 14px 0;
}

/* ===== CARTE PRODUIT ===== */
.sp-card {
  background: #fff;
  border: 1px solid #f0f0f0;
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.sp-card-link {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  flex: 1;
}

.sp-img {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  background: #f8f8f8;
  overflow: hidden;
}
.sp-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sp-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: #F05A1A;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  z-index: 1;
}

.sp-wish {
  position: absolute;
  top: 8px;
  right: 8px;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  z-index: 1;
}
.sp-wish svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: #bbb;
  stroke-width: 2;
}

.sp-info {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
}

.sp-name {
  font-size: 12px;
  font-weight: 600;
  color: #1a1a1a;
  line-height: 1.4;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Étoiles */
.sp-stars {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-wrap: wrap;
}
.sp-star {
  width: 11px;
  height: 11px;
  fill: #e8e8e8;
  stroke: none;
}
.sp-star.filled { fill: #F59E0B; }
.sp-rating-val {
  font-size: 11px;
  font-weight: 600;
  color: #1a1a1a;
  margin-left: 2px;
}
.sp-rating-count { font-size: 10px; color: #aaa; }
.sp-sold {
  font-size: 10px;
  color: #F05A1A;
  font-weight: 500;
  margin-left: auto;
}

/* Prix */
.sp-prices { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.sp-price-new {
  font-size: 14px;
  font-weight: 800;
  color: #F05A1A;
}
.sp-price-old {
  font-size: 11px;
  color: #aaa;
  text-decoration: line-through;
}

/* Économie */
.sp-savings {
  display: inline-block;
  background: #ECFDF5;
  color: #059669;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
}

/* Méta livraison */
.sp-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 2px;
}
.sp-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  color: #888;
}
.sp-meta svg {
  width: 11px;
  height: 11px;
  stroke: #888;
  fill: none;
  stroke-width: 2;
  flex-shrink: 0;
}

/* Bouton panier */
.sp-add-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 0 10px 10px;
  padding: 10px;
  background: #F05A1A;
  color: #fff;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s;
}
.sp-add-btn:hover { background: #d94f00; color: #fff; }

/* Loading */
.shop-loading {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  padding: 40px 0;
}
.shop-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #f0f0f0;
  border-top-color: #F05A1A;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.shop-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: #999;
  padding: 40px 0;
  font-size: 14px;
}

/* Load more */
.load-more-wrap {
  display: flex;
  justify-content: center;
  padding: 20px 14px 0;
}
.load-more-btn {
  background: #fff;
  border: 2px solid #F05A1A;
  color: #F05A1A;
  font-size: 14px;
  font-weight: 600;
  padding: 12px 32px;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.load-more-btn:hover {
  background: #F05A1A;
  color: #fff;
}

/* ===== SORT PANEL ===== */
.panel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 400;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}
.panel-overlay.open { opacity: 1; pointer-events: all; }

.sort-panel {
  position: fixed;
  bottom: -100%;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: #fff;
  border-radius: 20px 20px 0 0;
  z-index: 401;
  padding: 20px;
  transition: bottom 0.3s ease;
}
.sort-panel.open { bottom: 0; }

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 16px;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 16px;
}
.panel-close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #f5f5f5;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #666;
  cursor: pointer;
}

.sort-options {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sort-opt {
  background: none;
  border: none;
  text-align: left;
  padding: 13px 14px;
  font-size: 14px;
  font-weight: 500;
  color: #1a1a1a;
  cursor: pointer;
  border-radius: 10px;
  transition: background 0.15s;
}
.sort-opt:hover { background: #f5f5f5; }
.sort-opt.active {
  background: #FFF0E8;
  color: #F05A1A;
  font-weight: 700;
}

/* ===== DESKTOP ===== */
@media (min-width: 768px) {
  .shop-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .cat-tab-icon { width: 64px; height: 64px; }
  .sp-name { font-size: 13px; }
  .sp-price-new { font-size: 15px; }
}