/* ============================================
   PRODUCT CARD : VARIANTES + FAVORIS
   ============================================ */

/* --- Pills variantes --- */
.product-card__variants {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 12px 0 14px;
}

.product-card__variant {
    background: #f5f1ea;
    color: #5a5a5a;
    border: 1px solid #e5dfd2;
    border-radius: 999px;
    padding: 5px 12px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s ease;
    line-height: 1;
}

.product-card__variant:hover {
    background: #ece6d8;
    color: #2d3a2d;
    border-color: #d4cdb9;
}

.product-card__variant--active {
    background: #4a7c4e;
    color: #fff;
    border-color: #4a7c4e;
}

.product-card__variant--active:hover {
    background: #3d6841;
    border-color: #3d6841;
    color: #fff;
}

/* --- Coeur favori actif --- */
.product-card__fav-btn {
    cursor: pointer;
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.9);
    border: none;
}

.product-card__fav-btn:hover {
    background: #fff;
    transform: scale(1.08);
    color: #e74c3c;
}

.product-card__fav-btn:hover svg {
    stroke: #e74c3c;
}

.product-card__fav-btn--active {
    background: #fff;
    color: #e74c3c;
}

.product-card__fav-btn--active svg,
.product-card__fav-btn--active svg path {
    fill: #e74c3c !important;
    stroke: #e74c3c;
}

.product-card__fav-btn--active:hover {
    background: #ffeae8;
}

/* --- Compteur favoris dans le header --- */
.header__fav-link {
    position: relative;
}
.header__fav-count {
    position: absolute;
    top: 2px;
    right: 2px;
    background: #e74c3c;
    color: #fff;
    border-radius: 999px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    font-size: 11px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
}
.header__fav-count[hidden] { display: none; }

/* --- Toast notification --- */
.cart-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9000;
    background: #2d3a2d;
    color: #fff;
    padding: 14px 20px;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
    font-size: 14px;
    font-weight: 500;
    max-width: 90vw;
    white-space: nowrap;
    transform: translateY(100px);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    pointer-events: none;
}
.cart-toast--visible {
    transform: translateY(0);
    opacity: 1;
}
.cart-toast--error {
    background: #c0392b;
}

/* ============================================
   SEARCH OVERLAY
   ============================================ */
.search-overlay[hidden] { display: none; }
.search-overlay {
    position: fixed;
    inset: 0;
    z-index: 9500;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 80px;
}
.search-overlay__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(20, 25, 20, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.search-overlay__panel {
    position: relative;
    background: #fff;
    border-radius: 14px;
    width: min(640px, 92vw);
    max-height: calc(100vh - 120px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px rgba(0,0,0,0.3);
    animation: searchIn 0.2s ease-out;
}
@keyframes searchIn {
    from { opacity: 0; transform: translateY(-12px); }
    to   { opacity: 1; transform: translateY(0); }
}
.search-overlay__form {
    position: relative;
    border-bottom: 1px solid #eee;
}
.search-overlay__input {
    width: 100%;
    border: none;
    outline: none;
    font-size: 17px;
    padding: 20px 56px 20px 24px;
    font-family: inherit;
    color: #2d3a2d;
    background: transparent;
}
.search-overlay__close {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border: none;
    background: #f5f1ea;
    border-radius: 50%;
    font-size: 22px;
    cursor: pointer;
    color: #555;
    line-height: 1;
}
.search-overlay__close:hover { background: #e9e3d4; }
.search-overlay__results {
    overflow-y: auto;
    max-height: 60vh;
}
.search-overlay__empty {
    padding: 32px 24px;
    color: #888;
    text-align: center;
    font-size: 14px;
}
.search-result {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 20px;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid #f5f1ea;
    transition: background 0.15s;
}
.search-result:hover { background: #faf8f3; }
.search-result img {
    width: 52px;
    height: 52px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}
.search-result__body {
    flex: 1;
    min-width: 0;
}
.search-result__cat {
    display: block;
    font-size: 11px;
    color: #b08960;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    margin-bottom: 2px;
}
.search-result__name {
    display: block;
    font-weight: 600;
    color: #2d3a2d;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.search-result__price {
    font-weight: 700;
    color: #4a7c4e;
    flex-shrink: 0;
}
.search-result--more {
    justify-content: center;
    color: #4a7c4e;
    font-weight: 600;
    padding: 14px;
    border-bottom: none;
}
body.search-open { overflow: hidden; }

/* ============================================
   ADRESSE AUTOCOMPLETE (api-adresse.gouv.fr)
   ============================================ */
.addr-autocomplete { position: relative; }
.addr-autocomplete__dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e5dfd2;
    border-radius: 8px;
    margin-top: 4px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    z-index: 100;
    max-height: 280px;
    overflow-y: auto;
}
.addr-autocomplete__dropdown[hidden] { display: none; }
.addr-autocomplete__item {
    display: block;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid #f5f1ea;
    font-family: inherit;
    color: #2d3a2d;
}
.addr-autocomplete__item:last-child { border-bottom: none; }
.addr-autocomplete__item:hover { background: #faf8f3; }
.addr-autocomplete__item strong {
    display: block;
    font-weight: 600;
    font-size: 14px;
}
.addr-autocomplete__item span {
    display: block;
    font-size: 12px;
    color: #888;
    margin-top: 2px;
}

/* ============================================
   RÉSUMÉ COMMANDE — actions sur ligne produit
   ============================================ */
.order-line-actions {
    display: flex;
    gap: 6px;
    margin-top: 4px;
}
.order-line-action {
    background: none;
    border: none;
    padding: 2px 6px;
    font-size: 11px;
    cursor: pointer;
    border-radius: 4px;
    color: #888;
    text-decoration: none;
    font-family: inherit;
    transition: all 0.15s;
}
.order-line-action:hover {
    background: #f5f1ea;
    color: #2d3a2d;
}
.order-line-action--remove:hover {
    color: #c0392b;
    background: #fdecea;
}

/* --- Correctif description : troncature propre 2 lignes + ellipse ---
   pages.css imposait `.product-card__desc { flex:1 }` sans line-clamp, ce qui
   supprimait la troncature -> le texte long debordait et etait coupe brutalement
   (ex. White Siberian Cryo, Bubble Mint). On restaure un clamp 2 lignes. */
.product-card .product-card__desc {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 0 0 auto;
}
