/* =========================================================
   Amazon Product Widget v3
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&display=swap');

:root {
  --apw-font:         'DM Sans', sans-serif;
  --apw-amazon:       #FF9900;
  --apw-amazon-deep:  #c97e00;
  --apw-bg:           #ffffff;
  --apw-border:       #ebebeb;
  --apw-text:         #111111;
  --apw-radius:       16px;
  --apw-radius-btn:   10px;
  --apw-shadow:       0 1px 4px rgba(0,0,0,.06), 0 4px 20px rgba(0,0,0,.08);
  --apw-shadow-hover: 0 8px 32px rgba(0,0,0,.14);
  --apw-t:            .22s ease;
}

/* ══════════════════════════════════════
   GRILLE MULTI-COLONNES
   .apw-grid[data-cols="2"] → 2 colonnes
   .apw-grid[data-cols="3"] → 3 colonnes
   ══════════════════════════════════════ */

/* ══════════════════════════════════════
   GRILLE MULTI-COLONNES
   ══════════════════════════════════════ */

/* Wrapper commun */
.apw-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  box-sizing: border-box;
}

/* 1 colonne : on force la largeur sur la carte elle-même
   via un wrapper qui ne peut pas être étiré par Astra */
.apw-grid[data-cols="1"] {
  display: flex !important;
  flex-wrap: nowrap !important;
  justify-content: center !important;
  width: 100% !important;
  max-width: 100% !important;
}

.apw-grid[data-cols="1"] > .apw-product {
  flex: 0 0 200px !important;
  width: 200px !important;
  min-width: 0 !important;
  max-width: 200px !important;
}

/* 2 colonnes */
.apw-grid[data-cols="2"] {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
}
.apw-grid[data-cols="2"] > .apw-product {
  flex: 1 1 0;
  min-width: 0;
  max-width: none;
}

/* 3 colonnes */
.apw-grid[data-cols="3"] {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
}
.apw-grid[data-cols="3"] > .apw-product {
  flex: 1 1 0;
  min-width: 0;
  max-width: none;
}

/* Responsive : empilé sous 480px pour 2 et 3 colonnes */
@media (max-width: 480px) {
  .apw-grid[data-cols="2"],
  .apw-grid[data-cols="3"] {
    flex-wrap: wrap;
  }
  .apw-grid[data-cols="2"] > .apw-product,
  .apw-grid[data-cols="3"] > .apw-product {
    flex: 1 1 100%;
  }
}

/* ══════════════════════════════════════
   CARTE PRODUIT
   ══════════════════════════════════════ */

.apw-product {
  position: relative;
  background: var(--apw-bg);
  border: 1px solid var(--apw-border);
  border-radius: var(--apw-radius);
  box-shadow: var(--apw-shadow);
  overflow: hidden;
  font-family: var(--apw-font);
  transition: box-shadow var(--apw-t), transform var(--apw-t);
  margin-bottom: 1.25rem;
  width: 100%;
  max-width: 250px;
}

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

/* ── Bande orange en haut ── */
.apw-product::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--apw-amazon);
  z-index: 2;
}

/* ── Zone image : fond blanc, pas de bordure ── */
.apw-image-wrap {
  display: block;
  width: 100%;
  background: #fff;
  overflow: hidden;
  position: relative;
}

.apw-image {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  padding: 12px;
  transition: transform .35s cubic-bezier(.34,1.56,.64,1);
}

.apw-product:hover .apw-image {
  transform: scale(1.07);
}

a.apw-link { text-decoration: none; display: block; }

/* ── Badge ── */
.apw-badge {
  position: absolute;
  top: 14px;
  right: 10px;
  background: var(--apw-amazon);
  color: #fff;
  font-family: var(--apw-font);
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 50px;
  z-index: 3;
  box-shadow: 0 2px 8px rgba(255,153,0,.35);
}

/* ── Zone texte ── */
.apw-content {
  padding: 14px 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-top: 1px solid var(--apw-border);
}

/* ── Titre produit ── */
.apw-product-name {
  margin: 0;
  font-size: .9rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--apw-text);
  letter-spacing: -.01em;
}

.apw-product-name a.apw-link,
.apw-product-name span.apw-link {
  color: inherit;
  text-decoration: none;
  transition: color var(--apw-t);
}

.apw-product-name a.apw-link:hover { color: var(--apw-amazon-deep); }

/* ── Bouton ── */
.apw-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 10px 12px;
  background: var(--apw-amazon);
  color: #111 !important;
  text-decoration: none !important;
  font-family: var(--apw-font);
  font-size: .8rem;
  font-weight: 700;
  border-radius: var(--apw-radius-btn);
  border: none;
  cursor: pointer;
  transition: background var(--apw-t), transform var(--apw-t), box-shadow var(--apw-t);
  box-shadow: 0 2px 0 var(--apw-amazon-deep), 0 4px 12px rgba(255,153,0,.2);
  line-height: 1;
}

.apw-button:hover {
  background: #ffaa1a;
  box-shadow: 0 1px 0 var(--apw-amazon-deep), 0 6px 20px rgba(255,153,0,.3);
  transform: translateY(-1px);
}

.apw-button:active {
  box-shadow: 0 0 0 var(--apw-amazon-deep);
  transform: translateY(1px);
}

.apw-button svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  transition: transform var(--apw-t);
}

.apw-button:hover svg { transform: translateX(3px); }

/* ── Bouton Amazon Prime (bleu) ── */
.apw-button.apw-button-prime {
  background: #146eb4;
  color: #fff !important;
  box-shadow: 0 2px 0 #0e4f82, 0 4px 12px rgba(20,110,180,.22);
}

.apw-button.apw-button-prime:hover {
  background: #1a85d6;
  box-shadow: 0 1px 0 #0e4f82, 0 6px 20px rgba(20,110,180,.32);
}


