/* ═══════════════════════════════════════════════════
   COMPONENTS — buttons, badges, product cards,
                fabric gallery, lightbox
═══════════════════════════════════════════════════ */

/* ── Buttons ─────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 500;
  transition: background-color var(--transition), color var(--transition), border-color var(--transition);
  white-space: nowrap;
  cursor: pointer;
  border: 2px solid transparent;
}

.btn-primary {
  background-color: var(--color-terracotta);
  color: var(--color-white);
}

.btn-primary:hover {
  background-color: var(--color-terracotta-dark);
}

.btn-secondary {
  background-color: transparent;
  color: var(--color-terracotta);
  border-color: var(--color-terracotta);
}

.btn-secondary:hover {
  background-color: var(--color-terracotta);
  color: var(--color-white);
}

.btn-lg {
  padding: var(--space-4) var(--space-10);
  font-size: var(--text-base);
}

/* ── Badges ──────────────────────────────────────────── */

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 500;
}

.badge::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: currentColor;
}

.badge-disponible {
  color: var(--color-badge-ok);
  background-color: var(--color-badge-ok-bg);
}

.badge-limité {
  color: var(--color-badge-limited);
  background-color: var(--color-badge-limited-bg);
}

.badge-épuisé {
  color: var(--color-badge-out);
  background-color: var(--color-badge-out-bg);
}

.badge-metal {
  color: var(--color-text-muted);
  background-color: var(--color-surface);
}
.badge-metal::before { display: none; }

/* ── Product grid ────────────────────────────────────── */

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--space-6);
}

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

.product-card--clickable {
  cursor: pointer;
}

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

.product-img-wrap {
  aspect-ratio: 1;
  background-color: var(--color-surface);
  overflow: hidden;
  position: relative;
}

.product-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.product-card:hover .product-img-wrap img {
  transform: scale(1.04);
}

/* Zoom overlay shown on hover for clickable cards */
.product-img-overlay {
  position: absolute;
  inset: 0;
  background-color: rgba(42, 26, 14, 0);
  transition: background-color var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-img-overlay::after {
  content: '';
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: rgba(250, 248, 245, 0.9);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%232A1A0E' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3Cline x1='11' y1='8' x2='11' y2='14'/%3E%3Cline x1='8' y1='11' x2='14' y2='11'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity var(--transition), transform var(--transition);
}

.product-card--clickable:hover .product-img-overlay {
  background-color: rgba(42, 26, 14, 0.18);
}

.product-card--clickable:hover .product-img-overlay::after {
  opacity: 1;
  transform: scale(1);
}

.product-info {
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* Flex layout keeps price/badge pinned to the card bottom */
.product-info-body {
  flex: 1;
  margin-bottom: var(--space-3);
}

.product-info-body h3 {
  font-size: var(--text-lg);
  margin-bottom: var(--space-2);
}

.product-info-body p {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  line-height: 1.5;
}

.product-info-footer {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.price {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-terracotta);
}

.price-note {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-weight: 400;
}

/* ── Fabric gallery (couture page) ───────────────────── */

.tissus-section {
  background-color: var(--color-surface);
  border-radius: var(--radius-xl);
  padding: var(--space-10);
  margin-top: var(--space-12);
}

.tissus-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: var(--space-4);
}

.tissu-tile {
  cursor: pointer;
  border-radius: var(--radius-md);
  overflow: hidden;
  background-color: var(--color-white);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
}

.tissu-tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.tissu-tile.tissu-épuisé {
  opacity: 0.5;
  cursor: default;
}

.tissu-tile.tissu-épuisé:hover {
  transform: none;
  box-shadow: var(--shadow-sm);
}

.tissu-img-wrap {
  position: relative;
  aspect-ratio: 1;
  background-color: var(--color-surface);
  overflow: hidden;
}

.tissu-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tissu-num {
  position: absolute;
  bottom: var(--space-2);
  left: var(--space-2);
  background-color: rgba(42, 26, 14, 0.7);
  color: white;
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 2px var(--space-2);
  border-radius: var(--radius-full);
  line-height: 1.6;
}

.tissu-footer {
  padding: var(--space-2) var(--space-3);
}

/* ── Lightbox ─────────────────────────────────────────── */

.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
}

.lightbox.open {
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background-color: rgba(42, 26, 14, 0.85);
  cursor: pointer;
}

.lightbox-content {
  position: relative;
  z-index: 1;
  max-width: min(90vw, 600px);
  max-height: 90vh;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.lightbox-img {
  display: block;
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
  background-color: var(--color-surface);
}

.lightbox-close {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: rgba(42, 26, 14, 0.6);
  color: white;
  font-size: var(--text-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: background-color var(--transition);
  cursor: pointer;
  border: none;
}

.lightbox-close:hover {
  background-color: rgba(42, 26, 14, 0.9);
}

body.lightbox-active {
  overflow: hidden;
}
