/* =====================================================================
 * Fichier : assets/css/pages/angebote.css
 * Projet  : Brennholz Shop24
 * Rôle    : Styles propres à la page des offres (angebote.php) :
 *           en-tête avec compte à rebours, avantages, bandeaux de
 *           promotions, meilleure offre, puces de filtre et tri,
 *           étiquettes d'économie, état vide, texte et newsletter.
 * ===================================================================== */

/* ---------------------------------------------------------------------
 * 1. En-tête et compte à rebours
 * ------------------------------------------------------------------- */
.ag-hero { padding-bottom: clamp(3.5rem, 7vw, 5.5rem); }
.ag-hero::before { z-index: 0; background: radial-gradient(circle, rgba(229, 56, 59, .5), transparent 65%); }
.ag-hero-embers { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.ag-hero-inner { position: relative; z-index: 2; }
.ag-hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 440px); gap: clamp(1.5rem, 4vw, 4rem); align-items: center; margin-top: 1rem; }
.ag-hero-text h1 { font-size: clamp(2.1rem, 4.6vw, 3.5rem); animation: hfk-fade-up .7s var(--hfk-ease) both; }
.ag-hero-text h1 span { display: block; background: var(--hfk-grad-fire-h); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ag-hero-text p { animation: hfk-fade-up .7s .12s var(--hfk-ease) both; }
.ag-stats { display: flex; flex-wrap: wrap; gap: .8rem; margin: 1.6rem 0 0; padding: 0; list-style: none; animation: hfk-fade-up .7s .22s var(--hfk-ease) both; }
.ag-stats li { min-width: 130px; padding: .8rem 1.1rem; background: rgba(255, 255, 255, .07); border-left: 3px solid var(--hfk-ember); }
.ag-stats li:nth-child(2) { border-color: var(--hfk-amber); }
.ag-stats li:nth-child(3) { border-color: var(--hfk-forest); }
.ag-stats strong { display: block; font-family: var(--hfk-font-head); font-size: 1.8rem; line-height: 1.05; color: #fff; white-space: nowrap; }
.ag-stats span { font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; color: #D5DADF; }

.ag-countdown { position: relative; padding: clamp(1.2rem, 2.6vw, 1.8rem); background: #fff; color: var(--hfk-text); border-top: 5px solid var(--hfk-ember); box-shadow: var(--hfk-shadow-lg); animation: hfk-fade-up .7s .2s var(--hfk-ease) both; }
.ag-countdown::after { content: ''; position: absolute; top: -5px; left: 0; height: 5px; width: 100%; background: var(--hfk-grad-fire-h); background-size: 200% 100%; animation: hfk-gradient-pan 4s linear infinite; }
.ag-countdown-label { display: inline-flex; align-items: center; gap: .45rem; font-family: var(--hfk-font-head); font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--hfk-ember-dark); }
.ag-countdown .ag-countdown-name { margin: .35rem 0 1rem; max-width: none; font-family: var(--hfk-font-head); font-size: 1.2rem; font-weight: 700; line-height: 1.3; color: var(--hfk-charcoal); }
.ag-countdown-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; }
.ag-countdown-grid div { padding: .7rem .3rem; text-align: center; background: var(--hfk-charcoal); color: #fff; }
.ag-countdown-grid strong { display: block; font-family: var(--hfk-font-head); font-size: clamp(1.6rem, 3vw, 2.2rem); line-height: 1; font-variant-numeric: tabular-nums; }
.ag-countdown-grid strong.is-tick { animation: ag-tick .4s var(--hfk-ease); }
.ag-countdown-grid span { font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: #D5DADF; }
.ag-countdown-grid div:last-child { background: var(--hfk-grad-ember); }
.ag-countdown .ag-countdown-date { margin: .9rem 0 0; max-width: none; font-size: .88rem; color: var(--hfk-muted); }
.ag-countdown .ag-countdown-over { margin: .8rem 0 0; max-width: none; padding: .6rem .8rem; font-size: .88rem; font-weight: 600; background: #FDE8E8; color: var(--hfk-ember-dark); border-left: 4px solid var(--hfk-ember); }
.ag-countdown-over[hidden] { display: none; }
.ag-countdown.is-static { border-top-color: var(--hfk-forest); }
@keyframes ag-tick { from { transform: translateY(-6px); opacity: .3; } to { transform: none; opacity: 1; } }

/* ---------------------------------------------------------------------
 * 2. Avantages
 * ------------------------------------------------------------------- */
.ag-perks { position: relative; z-index: 3; margin-top: -2.2rem; }
.ag-perks-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); background: #fff; box-shadow: var(--hfk-shadow-lg); }
.ag-perks article { display: flex; align-items: center; gap: .9rem; padding: 1.2rem 1.3rem; border-right: 1px solid var(--hfk-border); transition: background .3s; }
.ag-perks article:last-child { border-right: 0; }
.ag-perks article:hover { background: var(--hfk-cream); }
.ag-perks article > span { width: 50px; height: 50px; flex: 0 0 50px; display: grid; place-items: center; background: var(--hfk-grad-fire); color: #fff; font-size: 1.2rem; transition: transform .4s var(--hfk-ease-bounce); }
.ag-perks article:hover > span { transform: rotate(-8deg) scale(1.1); }
.ag-perks article > span.is-forest { background: var(--hfk-forest); }
.ag-perks article > span.is-sky { background: var(--hfk-sky); }
.ag-perks article > span.is-plum { background: var(--hfk-plum); }
.ag-perks strong { display: block; font-family: var(--hfk-font-head); font-size: 1.04rem; line-height: 1.3; color: var(--hfk-charcoal); }
.ag-perks small { font-size: .82rem; line-height: 1.35; color: var(--hfk-muted); }

/* ---------------------------------------------------------------------
 * 3. Promotions actives
 * ------------------------------------------------------------------- */
.ag-promos .section-head { max-width: 860px; margin-bottom: 2rem; }
.ag-promo-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; }
.ag-promo { --ag-promo: var(--hfk-flame); position: relative; display: grid; grid-template-columns: 170px minmax(0, 1fr) auto; align-items: center; gap: 1.5rem; padding: 1.2rem 1.4rem 1.2rem 0; background: #fff; border: 1px solid var(--hfk-border); border-left: 0; overflow: hidden; transition: transform .35s var(--hfk-ease), box-shadow .35s var(--hfk-ease); }
.ag-promo::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 6px; background: var(--ag-promo); }
.ag-promo:hover { transform: translateY(-4px); box-shadow: var(--hfk-shadow); }
.ag-promo-value { align-self: stretch; display: flex; flex-direction: column; justify-content: center; margin: -1.2rem 0; padding: 1rem 1rem 1rem 1.6rem; background: var(--ag-promo); color: #fff; clip-path: polygon(0 0, 100% 0, 88% 50%, 100% 100%, 0 100%); }
.ag-promo-value strong { font-family: var(--hfk-font-head); font-size: 2rem; line-height: 1; white-space: nowrap; }
.ag-promo-value span { margin-top: .35rem; font-size: .74rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; opacity: .92; }
.ag-promo-body h3 { margin: 0 0 .35rem; font-size: 1.2rem; }
.ag-promo-body p { margin: 0 0 .5rem; font-size: .93rem; color: var(--hfk-muted); }
.ag-promo-meta { display: flex; flex-wrap: wrap; gap: .3rem 1.2rem; margin: 0; padding: 0; list-style: none; font-size: .84rem; font-weight: 600; color: var(--hfk-charcoal); }
.ag-promo-meta i { color: var(--ag-promo); margin-right: .2rem; }
.ag-promo-btn { white-space: nowrap; }
.ag-promo-btn i { transition: transform .3s var(--hfk-ease); }
.ag-promo:hover .ag-promo-btn i { transform: translateX(4px); }

/* ---------------------------------------------------------------------
 * 4. Meilleure offre
 * ------------------------------------------------------------------- */
.ag-best { overflow-x: clip; }
.ag-best-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(1.5rem, 5vw, 4.5rem); align-items: center; }
.ag-best-media { position: relative; aspect-ratio: 4 / 3; background: var(--hfk-placeholder); box-shadow: 0 30px 60px rgba(0, 0, 0, .35); }
.ag-best-media > a, .ag-best-media .img-ph { display: block; width: 100%; height: 100%; }
.ag-best-media img { width: 100%; height: 100%; object-fit: cover; }
.ag-best-media .img-ph i { font-size: 4rem; }
.ag-best-burst { position: absolute; top: -18px; right: -18px; width: 120px; height: 120px; display: grid; place-content: center; text-align: center; border-radius: 50%; background: var(--hfk-grad-ember); color: #fff; box-shadow: var(--hfk-shadow-fire); animation: hfk-pulse-soft 2.4s ease-in-out infinite; }
.ag-best-burst b { font-family: var(--hfk-font-head); font-size: 1.9rem; line-height: 1; }
.ag-best-burst small { font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.ag-best-cat { display: block; margin-bottom: .3rem; font-size: .82rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--hfk-amber); }
.ag-best-cat:hover { color: #fff; }
.ag-best-text h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); }
.ag-best-text h2 a { color: #fff; }
.ag-best-text h2 a:hover { color: var(--hfk-amber); }
.ag-best-text > p { color: #D5DADF; }
.ag-best-price { display: flex; flex-wrap: wrap; align-items: stretch; gap: 1rem; margin: 1.4rem 0 .6rem; }
.ag-best-price > div:first-child { flex: 1 1 220px; padding: 1rem 1.2rem; background: rgba(255, 255, 255, .06); border-left: 4px solid var(--hfk-flame); }
.ag-best-old { display: block; font-size: .95rem; color: #A3A9AF; text-decoration: line-through; }
.ag-best-price strong { display: block; font-family: var(--hfk-font-head); font-size: clamp(2rem, 4vw, 2.8rem); line-height: 1.1; color: #fff; }
.ag-best-price small { color: #D5DADF; font-size: .84rem; }
.ag-best-save { flex: 0 1 200px; display: flex; flex-direction: column; justify-content: center; padding: 1rem 1.2rem; background: var(--hfk-forest); color: #fff; }
.ag-best-save span { font-size: .78rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; opacity: .9; }
.ag-best-save strong { font-size: 1.8rem; }
.ag-best .ag-best-tax { font-size: .84rem; color: #A3A9AF; }
.ag-best-tax a { color: #D5DADF; text-decoration: underline; }
.ag-best-actions { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.2rem; }

/* ---------------------------------------------------------------------
 * 5. Liste des offres
 * ------------------------------------------------------------------- */
.ag-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; padding: .9rem 1rem; background: var(--hfk-cream); border-left: 4px solid var(--hfk-ember); }
.ag-chips { display: flex; flex-wrap: wrap; gap: .45rem; min-width: 0; }
.ag-chips button { display: inline-flex; align-items: center; gap: .45rem; padding: .5rem .85rem; border: 1px solid var(--hfk-border); background: #fff; color: var(--hfk-charcoal); font-size: .88rem; font-weight: 600; white-space: nowrap; transition: background .25s, color .25s, border-color .25s, transform .25s var(--hfk-ease); }
.ag-chips button i { color: var(--hfk-flame); transition: color .25s; }
.ag-chips button b { min-width: 22px; padding: 0 .3rem; background: var(--hfk-ash); color: var(--hfk-muted); font-size: .74rem; line-height: 1.5; text-align: center; transition: background .25s, color .25s; }
.ag-chips button:hover { border-color: var(--hfk-flame); color: var(--hfk-flame-dark); transform: translateY(-2px); }
.ag-chips button.is-active { background: var(--hfk-ember); border-color: var(--hfk-ember); color: #fff; }
.ag-chips button.is-active i { color: #fff; }
.ag-chips button.is-active b { background: rgba(255, 255, 255, .25); color: #fff; }
.ag-sort { display: inline-flex; align-items: center; gap: .6rem; margin: 0; font-size: .88rem; font-weight: 600; color: var(--hfk-charcoal); }
.ag-sort select { height: 44px; padding: 0 2.2rem 0 .8rem; border: 1px solid var(--hfk-border); border-radius: 0; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23FF6B1A' stroke-width='2'/%3E%3C/svg%3E") no-repeat right .8rem center / 12px 8px; -webkit-appearance: none; appearance: none; font-weight: 600; color: var(--hfk-charcoal); cursor: pointer; transition: border-color .25s, box-shadow .25s; }
.ag-sort select:focus { outline: 0; border-color: var(--hfk-flame); box-shadow: 0 0 0 3px rgba(34, 166, 75, .15); }
.ag-count { margin: 1rem 0 1.4rem; font-size: .92rem; color: var(--hfk-muted); }
.ag-count strong { font-family: var(--hfk-font-head); font-size: 1.2rem; color: var(--hfk-ember-dark); }

.ag-item { display: flex; flex-direction: column; min-width: 0; }
.ag-item[hidden] { display: none; }
.ag-item.is-in { animation: ag-in .45s var(--hfk-ease) both; }
@keyframes ag-in { from { opacity: 0; transform: translateY(14px) scale(.98); } }
.ag-item > .product-card { flex: 1; }
.ag-save-tag { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .45rem .7rem; background: var(--hfk-charcoal); color: #fff; font-size: .82rem; }
.ag-save-tag i { color: var(--hfk-amber); margin-right: .15rem; }
.ag-save-tag strong { color: var(--hfk-amber); }
.ag-save-tag b { padding: .05rem .45rem; background: var(--hfk-ember); font-family: var(--hfk-font-head); white-space: nowrap; transition: transform .3s var(--hfk-ease-bounce); }
.ag-item:hover .ag-save-tag b { transform: scale(1.12) rotate(-3deg); }
.ag-item-end { margin: 0; padding: .45rem .7rem; font-size: .8rem; font-weight: 600; color: var(--hfk-ember-dark); background: #FDE8E8; }

/* ---------------------------------------------------------------------
 * 6. État vide
 * ------------------------------------------------------------------- */
.ag-empty-box { max-width: 760px; margin: 0 auto; }
.ag-empty-box p { color: var(--hfk-muted); }
.ag-empty-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .7rem; margin-top: 1.2rem; }
.ag-empty-head { margin-top: 3rem; }

/* ---------------------------------------------------------------------
 * 7. Texte et newsletter
 * ------------------------------------------------------------------- */
.ag-info { overflow-x: clip; scroll-margin-top: var(--hfk-header-h, 80px); }
.ag-info-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: clamp(1.5rem, 4vw, 4rem); align-items: start; }
.ag-news { position: sticky; top: calc(var(--hfk-header-h, 80px) + 1rem); padding: clamp(1.4rem, 3vw, 2.2rem); background: #fff; border-top: 5px solid var(--hfk-flame); box-shadow: var(--hfk-shadow); }
.ag-news-icon { width: 58px; height: 58px; display: grid; place-items: center; margin-bottom: 1rem; background: var(--hfk-grad-fire); color: #fff; font-size: 1.4rem; animation: hfk-float 3.5s ease-in-out infinite; }
.ag-news h2 { font-size: 1.6rem; }
.ag-news > p { color: var(--hfk-muted); font-size: .95rem; }
.ag-news-form .form-label { margin-top: .6rem; }
.ag-news-form .form-label small { font-weight: 400; color: var(--hfk-muted); }
.ag-news-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.ag-news-consent { display: flex; align-items: flex-start; gap: .6rem; margin: 1rem 0; font-size: .84rem; line-height: 1.45; color: var(--hfk-text); cursor: pointer; }
.ag-news-consent input { flex: 0 0 18px; width: 18px; height: 18px; margin-top: .1rem; accent-color: var(--hfk-flame); }

/* ---------------------------------------------------------------------
 * 8. Adaptation aux écrans
 * ------------------------------------------------------------------- */
@media (max-width: 1199.98px) {
    .ag-perks-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ag-perks article:nth-child(2n) { border-right: 0; }
    .ag-perks article:nth-child(-n+2) { border-bottom: 1px solid var(--hfk-border); }
}
@media (max-width: 991.98px) {
    .ag-hero-grid, .ag-info-grid, .ag-best-grid { grid-template-columns: minmax(0, 1fr); }
    .ag-news { position: static; }
    .ag-promo { grid-template-columns: 140px minmax(0, 1fr); }
    .ag-promo-btn { grid-column: 2; justify-self: start; }
    .ag-best-media { max-width: 560px; }
}
@media (max-width: 767.98px) {
    .ag-toolbar { flex-direction: column; flex-wrap: nowrap; align-items: stretch; }
    .ag-chips { flex-wrap: nowrap; overflow-x: auto; margin: 0 -1rem; padding: 0 1rem .4rem; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
    .ag-sort { justify-content: space-between; }
    .ag-sort select { flex: 1; }
}
@media (max-width: 575.98px) {
    .ag-stats li { flex: 1; min-width: 0; padding: .7rem .7rem; }
    .ag-stats strong { font-size: 1.25rem; }
    .ag-stats span { font-size: .66rem; letter-spacing: .02em; }
    .ag-perks { margin-top: -1.5rem; }
    .ag-perks-grid { grid-template-columns: minmax(0, 1fr); }
    .ag-perks article { border-right: 0; border-bottom: 1px solid var(--hfk-border); padding: .9rem 1rem; }
    .ag-perks article:last-child { border-bottom: 0; }
    .ag-promo { grid-template-columns: minmax(0, 1fr); gap: 1rem; padding: 0 1rem 1.2rem 1.2rem; }
    .ag-promo-value { margin: 0 -1rem 0 -1.2rem; padding: .9rem 1.2rem; flex-direction: row; align-items: baseline; justify-content: space-between; clip-path: none; }
    .ag-promo-btn { grid-column: 1; width: 100%; }
    .ag-best-burst { top: -12px; right: -6px; width: 92px; height: 92px; }
    .ag-best-burst b { font-size: 1.45rem; }
    .ag-best-save { flex: 1 1 100%; }
    .ag-best-actions .btn { width: 100%; }
    .ag-countdown-grid { gap: .35rem; }
    /* Bandeau d'économie sous la carte compacte (deux cartes par ligne) */
    .ag-save-tag { flex-wrap: wrap; gap: .15rem .4rem; padding: .35rem .5rem; font-size: clamp(.62rem, .54rem + .4vw, .72rem); line-height: 1.3; }
    .ag-item-end { padding: .35rem .5rem; font-size: clamp(.62rem, .54rem + .4vw, .72rem); }
}
@media (prefers-reduced-motion: reduce) {
    .ag-best-burst, .ag-news-icon, .ag-countdown::after { animation: none; }
}