/**
 * SWS Theme Modern - components.css
 * Product card, category card, section headers
 */

/* ─── PRODUCT CARD ────────────────────────────────────── */

.sws-product-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  position: relative;
}

.sws-product-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.sws-product-card__image-wrap {
  display: block;
  position: relative;
  height: 0;
  padding-bottom: calc(75% + 20px); /* ratio 4:3 (75%) + 20px de hauteur */
  overflow: hidden;
  background: var(--color-surface);
}

.sws-product-card__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.sws-product-card:hover .sws-product-card__image {
  transform: scale(1.04);
}

.sws-product-card__badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--color-primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  z-index: 1;
}

.sws-product-card__rank {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--color-primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  z-index: 1;
}

.sws-product-card__wishlist {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  background: rgba(255,255,255,0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--color-text-muted);
  cursor: pointer;
  z-index: 1;
  transition: color 0.15s, background 0.15s;
}

.sws-product-card__wishlist:hover {
  color: var(--color-primary);
  background: #fff;
}

.sws-product-card__actions {
  position: absolute;
  bottom: 10px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 6px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.2s, transform 0.2s;
}

.sws-product-card:hover .sws-product-card__actions {
  opacity: 1;
  transform: translateY(0);
}

.sws-product-card__action {
  width: 32px;
  height: 32px;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  text-decoration: none;
}

.sws-product-card__action:hover {
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.sws-product-card__body {
  padding: 14px;
}

.sws-product-card__brand {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: 4px;
}

.sws-product-card__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.35;
  margin-bottom: 6px;
  text-decoration: none;
}

.sws-product-card__title:hover {
  color: var(--color-primary);
}

.sws-product-card__rating {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 8px;
}

.sws-product-card__price-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.sws-product-card__price {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text);
}

.sws-product-card__price-old {
  font-size: 13px;
  color: var(--color-text-muted);
  text-decoration: line-through;
}

.sws-product-card__cta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

/* Selecteur compose (.__cta .__add) pour battre legacy-compat `.sws-theme--webshop a
   { color: inherit }` (0,1,1) qui sinon rend le texte du bouton sombre/illisible. */
.sws-product-card__cta .sws-product-card__add {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: var(--btn-radius);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s;
}

.sws-product-card__cta .sws-product-card__add:hover {
  background: var(--color-primary-dark);
  color: #fff;
}

/* Libelle : complet par defaut, court "+ au panier" sur mobile (le libelle long
   passe sur 2 lignes et alourdit la carte sur petit ecran). */
.sws-product-card__add-short { display: none; }

@media (max-width: 640px) {
  .sws-product-card__cta .sws-product-card__add { padding: 8px 10px; letter-spacing: 0.02em; }
  .sws-product-card__add-full  { display: none; }
  .sws-product-card__add-short { display: inline; }
}

.sws-product-card__detail {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  transition: border-color 0.15s, color 0.15s;
  text-decoration: none;
}

.sws-product-card__detail:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

/* ─── SECTION HEADING ─────────────────────────────────── */

.mnx-section {
  padding: var(--section-spacing, 64px) 0;
}

.mnx-section--gray {
  background: var(--color-surface);
}

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

.mnx-section__title {
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 800;
  color: var(--color-text);
  margin: 0;
  letter-spacing: -0.02em;
}

.mnx-section__subtitle {
  font-size: 13px;
  color: var(--color-text-muted);
  margin-top: 4px;
}

.mnx-section__link {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-primary);
  text-decoration: none;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: opacity 0.15s;
}

.mnx-section__link:hover {
  opacity: 0.75;
  color: var(--color-primary);
}

/* ─── FILTER TABS ─────────────────────────────────────── */

.mnx-filter-tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.mnx-filter-tab {
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  cursor: pointer;
  background: #fff;
  color: var(--color-text-muted);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  text-decoration: none;
}

.mnx-filter-tab:hover {
  border-color: var(--color-text);
  color: var(--color-text);
}

.mnx-filter-tab--active {
  background: var(--color-text);
  color: #fff;
  border-color: var(--color-text);
}

/* ─── DEPARTMENT CIRCLE CARD ──────────────────────────── */

.mnx-dept-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--color-text);
  transition: transform 0.2s;
}

.mnx-dept-card:hover {
  transform: translateY(-3px);
  color: var(--color-text);
}

.mnx-dept-card__circle {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mnx-dept-card__circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mnx-dept-card__circle-placeholder {
  width: 60%;
  height: 60%;
  border-radius: 50%;
  background: var(--color-border);
  opacity: 0.5;
}

.mnx-dept-card__label {
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}

/* ============================================================
 * Luxury pastry polish (Chez KM) — overrides additifs
 * ============================================================ */
h1, h2, h3, h4 { letter-spacing: .2px; }
h1 { font-weight: 700; }

/* Prix : accent or + serif élégant */
.price, .product__price, .sws-price {
  font-family: var(--font-family-heading);
  color: var(--color-accent-dark, #A9863A);
  font-weight: 600;
  letter-spacing: .3px;
}
.oldprice, .linethrough { color: var(--color-text-light); }

/* Boutons : transition douce + ombre chaude au survol */
.sws-btn, .btn, button.add-to-cart, .add-to-cart {
  transition: background .25s ease, box-shadow .25s ease, transform .15s ease;
  letter-spacing: .3px;
}
.sws-btn:hover, .btn-primary:hover, .add-to-cart:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

/* Cartes produit : ombre douce + coins arrondis + hover raffiné */
.sws-card, .product-card, .card.product {
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  transition: box-shadow .3s ease, transform .2s ease;
  overflow: hidden;
}
.sws-card:hover, .product-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
}

/* Liseré or sous les titres de section */
.section-title, .sws-section__title { position: relative; }

/* Badges / pastilles : ton or doux */
.badge-accent, .tag-accent { background: var(--color-accent); color: #fff; }

/* ============================================================
 * Effet "le bloc titre épouse l'image" (variante 1, subtil)
 * L'image se fond vers le blanc du body, qui remonte par-dessus.
 * ============================================================ */
.sws-product-card__image-wrap::after{
  content:"";position:absolute;left:0;right:0;bottom:0;height:58px;
  background:linear-gradient(to bottom, rgba(255,255,255,0) 0%, #fff 92%);
  pointer-events:none;z-index:1;
}
.sws-product-card__body{
  position:relative;z-index:2;margin-top:-38px;padding-top:8px;
  background:linear-gradient(to bottom, rgba(255,255,255,0) 0%, #fff 40px);
}
/* le hover ne doit pas casser le fondu */
.sws-product-card:hover .sws-product-card__image-wrap::after{opacity:1}

/* ============================================================
 * Icônes carte : comparer/expand empilés sous le coeur (top-droite),
 * toujours cliquables (au-dessus du bloc qui remonte / fondu).
 * ============================================================ */
.sws-product-card__wishlist{z-index:4}
.sws-product-card__actions{
  top:48px;right:10px;left:auto;bottom:auto;
  flex-direction:column;justify-content:flex-start;gap:8px;
  z-index:4;
}
/* Toujours visibles (comme le coeur) pour accès direct, pas seulement au hover */
.sws-product-card__actions{opacity:1;transform:none}
.sws-product-card:hover .sws-product-card__actions{opacity:1;transform:none}
.sws-product-card__action{width:30px;height:30px;background:rgba(255,255,255,.92);box-shadow:var(--shadow-xs)}
