/* AFSON Veilleuses — habillage de la boutique. Mobile d'abord. */

:root {
  --afson-ink: #11161c;
  --afson-muted: #5b6672;
  --afson-line: #dfe4ea;
  --afson-soft: #f5f7f9;
  --afson-primary: #0f766e;
  --afson-primary-dark: #0b5a54;
  --afson-radius: 16px;
  --afson-shadow: 0 1px 2px rgba(17, 22, 28, .06), 0 8px 24px rgba(17, 22, 28, .05);
}

body { -webkit-font-smoothing: antialiased; }

/* ------------------------------------------------------------------ */
/* En-tête : mince, collant, sans bannière                             */
/* ------------------------------------------------------------------ */

.afson-header {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid var(--afson-line);
  backdrop-filter: saturate(140%) blur(8px);
  background: rgba(255, 255, 255, .92) !important;
}
.admin-bar .afson-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .afson-header { top: 46px; } }

.afson-header .wp-block-site-title a { color: var(--afson-ink); text-decoration: none; }
.afson-header-actions { gap: 10px !important; }

.afson-header-cta .wp-block-button__link {
  padding: .6rem 1.1rem;
  font-size: .95rem;
  border-radius: 999px;
}

/* Mini-panier : présent, jamais envahissant. */
.afson-header .wc-block-mini-cart__button {
  padding: .45rem .5rem;
  color: var(--afson-ink);
  background: transparent;
  border-radius: 10px;
}
.afson-header .wc-block-mini-cart__badge {
  background: var(--afson-primary);
  color: #fff;
  font-weight: 700;
}
/* Le panier vide n'a pas à s'annoncer. */
.afson-header .wc-block-mini-cart__badge:empty { display: none; }

/* ------------------------------------------------------------------ */
/* Accueil                                                             */
/* ------------------------------------------------------------------ */

.afson-intro h1 { letter-spacing: -.02em; }

.afson-badges { gap: 8px !important; }
.afson-badge {
  margin: 0 !important;
  background: var(--afson-soft);
  border: 1px solid var(--afson-line);
  border-radius: 999px;
  padding: 6px 13px;
  color: var(--afson-muted);
  white-space: nowrap;
}

/* ------------------------------------------------------------------ */
/* Barème                                                              */
/* ------------------------------------------------------------------ */

.afson-bareme-liste {
  list-style: none;
  margin: 0 0 1.25rem;
  padding: 0;
  display: grid;
  gap: 8px;
}
.afson-bareme-ligne {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: baseline;
  gap: 10px;
  background: #fff;
  border: 1px solid var(--afson-line);
  border-radius: 12px;
  padding: 11px 14px;
}
.afson-bareme-qte { color: var(--afson-muted); }
.afson-bareme-total { font-weight: 700; font-size: 1.05rem; }
.afson-bareme-eco {
  min-width: 68px;
  text-align: right;
  color: var(--afson-primary);
  font-weight: 700;
  font-size: .85rem;
}

/* ------------------------------------------------------------------ */
/* Catalogue                                                           */
/* ------------------------------------------------------------------ */

.woocommerce ul.products {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none;
}
.woocommerce ul.products::before,
.woocommerce ul.products::after { content: none !important; }

.woocommerce ul.products li.product {
  width: auto !important;
  margin: 0 !important;
  float: none !important;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--afson-line);
  border-radius: var(--afson-radius);
  padding: 10px 10px 14px;
  box-shadow: var(--afson-shadow);
}

.woocommerce ul.products li.product a img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 12px;
  margin: 0 0 10px;
}

.woocommerce ul.products li.product .woocommerce-loop-product__title {
  font-size: 1rem !important;
  font-weight: 600;
  line-height: 1.3;
  padding: 0 !important;
  margin: 0 0 4px;
  color: var(--afson-ink);
}
.woocommerce ul.products li.product .price {
  color: var(--afson-ink) !important;
  font-weight: 700;
  font-size: 1.05rem;
  margin: 0 0 10px;
  display: block;
}
.woocommerce ul.products li.product .price del { color: var(--afson-muted); font-weight: 400; }

.woocommerce ul.products li.product .button {
  margin-top: auto;
  display: block;
  text-align: center;
  background: var(--afson-primary);
  color: #fff;
  border-radius: 10px;
  padding: .72rem .8rem;
  font-weight: 700;
  font-size: .95rem;
  min-height: 46px;
  line-height: 1.5;
}
.woocommerce ul.products li.product .button:hover { background: var(--afson-primary-dark); color: #fff; }
.woocommerce ul.products li.product .added_to_cart { display: none; }

.woocommerce .woocommerce-ordering,
.woocommerce .woocommerce-result-count,
.woocommerce .woocommerce-breadcrumb { display: none; }

/* ------------------------------------------------------------------ */
/* Fiche produit                                                       */
/* ------------------------------------------------------------------ */

.afson-product .product { display: block; }

.afson-product .woocommerce-product-gallery {
  width: 100% !important;
  float: none !important;
  margin: 0 0 1.25rem !important;
}
.afson-product .woocommerce-product-gallery img { border-radius: var(--afson-radius); }

.afson-product .summary {
  width: 100% !important;
  float: none !important;
  margin: 0 !important;
}

.afson-product .product_title {
  font-size: 1.7rem;
  line-height: 1.2;
  margin: 0 0 .35rem;
}
.afson-product .summary > .price {
  font-size: 1.35rem !important;
  font-weight: 700;
  color: var(--afson-ink) !important;
  margin: 0 0 1rem !important;
  display: block;
}
.afson-product .woocommerce-product-details__short-description {
  color: var(--afson-muted);
  margin-bottom: 1.5rem;
}

.afson-product-bareme {
  margin: 0 0 1.5rem;
  background: var(--afson-soft);
  border-radius: var(--afson-radius);
  padding: 16px;
}
.afson-product-bareme h2 { font-size: 1.05rem; margin: 0 0 .85rem; }

.afson-product-form { margin: 0 0 1.5rem; }
.afson-product-form .afson-vl-wrap { max-width: none; }

/* Le panier, en second choix, replié. */
.afson-secondary-cart {
  border: 1px solid var(--afson-line);
  border-radius: 12px;
  padding: 0 14px;
  margin: 0 0 1.5rem;
  background: #fff;
}
.afson-secondary-cart > summary {
  cursor: pointer;
  padding: 13px 0;
  font-size: .95rem;
  color: var(--afson-muted);
  list-style: none;
}
.afson-secondary-cart > summary::-webkit-details-marker { display: none; }
.afson-secondary-cart > summary::after { content: " +"; font-weight: 700; }
.afson-secondary-cart[open] > summary::after { content: " −"; }
.afson-secondary-cart[open] { padding-bottom: 14px; }

.afson-secondary-cart .quantity input {
  min-height: 46px;
  font-size: 16px;
  border: 1px solid var(--afson-line);
  border-radius: 10px;
  padding: 0 10px;
  width: 5rem;
}
.afson-secondary-cart .single_add_to_cart_button {
  min-height: 46px;
  background: #fff;
  color: var(--afson-primary);
  border: 1.5px solid var(--afson-primary);
  border-radius: 10px;
  font-weight: 700;
  padding: .7rem 1.2rem;
  margin-left: 8px;
}
.afson-secondary-cart .single_add_to_cart_button:hover {
  background: var(--afson-primary);
  color: #fff;
}

.afson-product .product_meta { display: none; }
.afson-product .woocommerce-tabs { display: none; }

/* ------------------------------------------------------------------ */
/* Messages et tunnel                                                  */
/* ------------------------------------------------------------------ */

.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
  border-radius: 12px;
  border: 1px solid var(--afson-line);
  border-top: none;
  background: var(--afson-soft);
  padding: 14px 16px;
  font-size: .95rem;
}
.woocommerce-message::before,
.woocommerce-info::before { color: var(--afson-primary); }

.woocommerce .button,
.wc-block-components-button {
  border-radius: 10px !important;
  font-weight: 700;
  min-height: 46px;
}

.wc-block-components-main input[type="text"],
.wc-block-components-main input[type="tel"],
.wc-block-components-main input[type="email"] { font-size: 16px !important; }

/* ------------------------------------------------------------------ */
/* Écrans plus larges                                                  */
/* ------------------------------------------------------------------ */

@media (min-width: 640px) {
  .woocommerce ul.products { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
}

@media (min-width: 900px) {
  .woocommerce ul.products { grid-template-columns: repeat(4, minmax(0, 1fr)); }

  .afson-product .product {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 40px;
    align-items: start;
  }
  .afson-product .woocommerce-product-gallery { position: sticky; top: 90px; margin: 0 !important; }
  .afson-product .product_title { font-size: 2rem; }
}

/* ------------------------------------------------------------------ */
/* Impression                                                          */
/* ------------------------------------------------------------------ */

@media print {
  .afson-header, .afson-footer, .afson-product-form,
  .afson-secondary-cart, .wp-block-buttons { display: none !important; }
  body { color: #000; }
}

/* ------------------------------------------------------------------ */
/* Mini-panier maison                                                  */
/* ------------------------------------------------------------------ */

.afson-header .wp-block-shortcode { margin: 0; }

.afson-mini-cart {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  color: var(--afson-muted);
  text-decoration: none;
  transition: background .15s ease, color .15s ease;
}
.afson-mini-cart:hover { background: var(--afson-soft); color: var(--afson-ink); }

/* Tant que le panier est vide, le mini-panier s'efface. */
.afson-mini-cart:not(.is-filled) { opacity: .45; }
.afson-mini-cart.is-filled { color: var(--afson-ink); }

.afson-mini-cart-count {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--afson-primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}

.afson-loop-button { text-decoration: none; }
