/* =========================================================================
   Reifenparadies.ch — feuille de style unique, responsive, thème clair/sombre
   Palette : anthracite + turquoise (issue du logo)
   ========================================================================= */

/* ---- Variables de thème ---- */
:root {
  --brand:        #16a6be;
  --brand-dark:   #0f7e90;
  --brand-contrast:#ffffff;

  --bg:           #f6f8f9;
  --surface:      #ffffff;
  --surface-2:    #eef2f4;
  --text:         #1f2a30;
  --text-muted:   #5a6b73;
  --border:       #dfe6e9;
  --shadow:       0 6px 24px rgba(20, 40, 50, .08);

  --logo-fg:      #333a3d;
  --logo-tread:   #c6cdd0;

  --radius:       14px;
  --radius-sm:    9px;
  --container:    1100px;
  --header-h:     66px;

  --font: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
}

html[data-theme="dark"] {
  --brand:        #2bc0d8;
  --brand-dark:   #1b9cb2;
  --brand-contrast:#04181c;

  --bg:           #0f1518;
  --surface:      #182126;
  --surface-2:    #1f2c32;
  --text:         #e7eef1;
  --text-muted:   #9fb0b7;
  --border:       #2a3a41;
  --shadow:       0 6px 24px rgba(0, 0, 0, .4);

  --logo-fg:      #e7eef1;
  --logo-tread:   #38474e;
}

/* ---- Reset léger ---- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; } /* sinon .btn{display:inline-flex} écrase l'attribut hidden */
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background .25s ease, color .25s ease;
}
img, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 18px; }

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 1000;
  background: var(--brand); color: var(--brand-contrast); padding: 10px 16px; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* ---- En-tête / navigation ---- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--border);
}
.site-header__inner {
  display: flex; align-items: center; gap: 18px;
  min-height: var(--header-h);
}
.brand { display: inline-flex; align-items: center; }
.brand:hover { text-decoration: none; }
.rfp-logo { height: 42px; width: auto; }
.rfp-logo__w1 { fill: var(--logo-fg); }
.rfp-logo__w2 { fill: var(--brand); }
.rfp-logo__tread { fill: var(--logo-tread); }

.primary-nav {
  display: flex; align-items: center; gap: 16px;
  margin-left: auto;
}
.primary-nav__links {
  display: flex; align-items: center; gap: 15px;
  list-style: none; margin: 0; padding: 0;
}
.primary-nav__links a {
  color: var(--text); font-weight: 600; font-size: .9rem; white-space: nowrap;
  padding: 6px 2px; border-bottom: 2px solid transparent;
}
.primary-nav__links a:hover { color: var(--brand); text-decoration: none; border-color: var(--brand); }
.nav-admin { color: #e0533d !important; }

.nav-tools { display: flex; align-items: center; gap: 8px; white-space: nowrap; }

/* Sélecteur de langue */
.lang-switch { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.lang-switch__item {
  color: var(--text-muted); font-size: .78rem; font-weight: 700; letter-spacing: .04em;
  padding: 5px 9px;
}
.lang-switch__item:hover { background: var(--surface-2); text-decoration: none; }
.lang-switch__item.is-active { background: var(--brand); color: var(--brand-contrast); }

/* Bouton thème */
.theme-toggle {
  display: inline-grid; place-items: center;
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  cursor: pointer; transition: transform .15s ease, background .2s ease;
}
.theme-toggle:hover { transform: rotate(-12deg); }
.theme-toggle .icon-moon { display: none; }
html[data-theme="dark"] .theme-toggle .icon-sun  { display: none; }
html[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

/* Hamburger */
.nav-toggle {
  display: none; margin-left: auto;
  width: 44px; height: 40px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface-2); cursor: pointer; padding: 10px 9px;
}
.nav-toggle span { display: block; height: 2px; background: var(--text); border-radius: 2px; transition: .25s; }
.nav-toggle span + span { margin-top: 5px; }

/* ---- Boutons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-weight: 700; font-size: .95rem; line-height: 1; white-space: nowrap;
  padding: 12px 20px; border-radius: 999px; border: 1px solid transparent;
  cursor: pointer; transition: transform .12s ease, background .2s ease, box-shadow .2s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn--primary { background: var(--brand); color: var(--brand-contrast); }
.btn--primary:hover { background: var(--brand-dark); }
.btn--ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn--ghost:hover { background: var(--surface-2); }
.btn--sm { padding: 8px 14px; font-size: .85rem; }
.btn--lg { padding: 15px 30px; font-size: 1.05rem; }

/* ---- Cartes & sections ---- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 28px;
}
section.block { padding: 40px 0; }
.text-muted { color: var(--text-muted); }

/* ---- Hero ---- */
.hero {
  display: grid; gap: 18px; text-align: center;
  padding: 48px 28px;
  background:
    radial-gradient(1200px 300px at 50% -40%, color-mix(in srgb, var(--brand) 22%, transparent), transparent),
    var(--surface);
}
.hero h1 { font-size: clamp(1.7rem, 4vw, 2.6rem); }
.hero p { color: var(--text-muted); max-width: 620px; margin: 0 auto; font-size: 1.05rem; }
.hero__actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 8px; }
.badge {
  display: inline-block; background: var(--surface-2); color: var(--text-muted);
  font-size: .8rem; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--border);
}

.grid-2 { display: grid; gap: 22px; grid-template-columns: 1fr; }
@media (min-width: 820px) { .grid-2 { grid-template-columns: 1fr 1fr; } }

/* ---- Pied de page ---- */
.site-footer { margin-top: 56px; border-top: 1px solid var(--border); background: var(--surface); }
.site-footer__inner {
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px;
  padding: 24px 18px; justify-content: space-between;
}
.site-footer__brand { display: flex; flex-direction: column; }
.site-footer__brand span { color: var(--text-muted); font-size: .9rem; }
.site-footer__links { display: flex; gap: 18px; }
.site-footer__links a { color: var(--text-muted); }
.site-footer__copy { color: var(--text-muted); font-size: .85rem; width: 100%; }
.dev-badge {
  text-align: center; font-size: .75rem; padding: 6px;
  background: #ffd54a; color: #3a2d00; letter-spacing: .03em;
}

/* ---- Formulaires (base, pour login/contact à venir) ---- */
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; margin-bottom: 6px; font-size: .9rem; }
.input {
  width: 100%; padding: 12px 14px; font-size: 1rem;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.input:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: var(--brand); }
.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; }
.alert--error { background: #fdecea; color: #8a1c10; }
.alert--ok    { background: #e7f7ee; color: #0c6b3c; }
html[data-theme="dark"] .alert--error { background: #3a1714; color: #ffb4a8; }
html[data-theme="dark"] .alert--ok    { background: #0f3322; color: #97e7bd; }

/* ---- Responsive : navigation mobile (hamburger dès que le menu admin est trop large) ---- */
@media (max-width: 1024px) {
  .nav-toggle { display: block; }
  .primary-nav {
    position: fixed; inset: var(--header-h) 0 auto 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--surface); border-bottom: 1px solid var(--border);
    padding: 10px 18px 18px; margin: 0;
    transform: translateY(-130%); transition: transform .28s ease;
    box-shadow: var(--shadow);
  }
  .site-header.nav-open .primary-nav { transform: translateY(0); }
  .primary-nav__links { flex-direction: column; align-items: stretch; gap: 0; }
  .primary-nav__links li { border-bottom: 1px solid var(--border); }
  .primary-nav__links a { display: block; padding: 14px 4px; border-bottom: none; }
  .nav-tools { margin-top: 14px; justify-content: space-between; flex-wrap: wrap; }
}

/* ---- En-tête : panier ---- */
.cart-link { position: relative; display: inline-grid; place-items: center; width: 38px; height: 38px; color: var(--text); }
.cart-link:hover { color: var(--brand); }
.cart-badge {
  position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px;
  background: var(--brand); color: var(--brand-contrast); font-size: .7rem; font-weight: 700;
  border-radius: 999px; display: grid; place-items: center; padding: 0 4px;
}
/* Panier visible dans la barre sur mobile (hors menu hamburger) */
.cart-link--mobile { display: none; }
@media (max-width: 1024px) {
  .cart-link--mobile { display: inline-grid; margin-left: auto; }
  .nav-toggle { margin-left: 10px; }
}
/* Colonne de mise à jour grisée tant que des commandes bloquent le changement de prix */
.update-steps.is-blocked { opacity: .45; }

/* ---- Titres de page ---- */
.page-title { font-size: clamp(1.4rem, 3vw, 2rem); margin: 6px 0 18px; }

/* ---- Barre d'outils boutique ---- */
.shop-toolbar { display: grid; gap: 14px; margin-bottom: 20px; }
.filters { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 700px) { .filters { grid-template-columns: repeat(6, 1fr); } }
.shop-searchrow { display: flex; gap: 8px; flex-wrap: wrap; }
.shop-searchrow .input { flex: 1; min-width: 180px; }
.shop-sortrow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.input--auto { width: auto; }
.sort-group { display: inline-flex; gap: 6px; margin-left: auto; }

/* ---- Grille produits ---- */
.product-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.product-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column;
  transition: transform .15s ease, box-shadow .2s ease;
}
.product-card:hover { transform: translateY(-3px); }
.product-card__img { width: 100%; height: 180px; object-fit: contain; background: #fff; padding: 12px; }
.product-card__body { padding: 12px 14px; flex: 1; }
.product-card__title { font-size: 1rem; margin: 0 0 6px; }
.product-card__meta { color: var(--text-muted); font-size: .85rem; margin: 0 0 4px; }
.product-card__season { color: var(--brand); font-size: .8rem; font-weight: 600; margin: 0; }
.product-card__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--border); }
.price { font-weight: 700; font-size: 1.05rem; }
.shop-empty { grid-column: 1 / -1; text-align: center; padding: 40px 0; }

/* ---- Pagination ---- */
.pager { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 18px 0; }
.pageinfo { text-align: center; margin-top: 14px; font-size: .85rem; }

/* ---- Toast ---- */
.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translate(-50%, 30px);
  background: var(--text); color: var(--surface); padding: 12px 20px; border-radius: 999px;
  box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: .3s ease; z-index: 1000;
  font-size: .9rem; font-weight: 600;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---- Tableaux (panier, commandes, admin) ---- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.data th, table.data td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; }
table.data thead th { background: var(--surface-2); font-weight: 700; }
table.data tfoot td { font-weight: 700; }
.qty-input { width: 64px; padding: 8px; text-align: center; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); }
.text-end { text-align: right; }

/* ---- Mise en page centrée (login, contact…) ---- */
.narrow { max-width: 520px; margin: 0 auto; }
.wide { max-width: 1100px; margin: 0 auto; }
.stack > * + * { margin-top: 14px; }
.row-2 { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .row-2 { grid-template-columns: 1fr 1fr; } }
.code-input { font-size: 26px; letter-spacing: 10px; text-align: center; font-weight: 700; }

/* ---- Badges de statut ---- */
.tag { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; }
.tag--ok { background: var(--bg-ok, #e7f7ee); color: #0c6b3c; }
.tag--wait { background: #fff3d6; color: #8a5a00; }
.tag--bad { background: #fdecea; color: #8a1c10; }
html[data-theme="dark"] .tag--ok { background: #0f3322; color: #97e7bd; }
html[data-theme="dark"] .tag--wait { background: #3a2e0f; color: #f2d27a; }
html[data-theme="dark"] .tag--bad { background: #3a1714; color: #ffb4a8; }

/* ---- Texte long (AGB, etc.) ---- */
.prose h1 { font-size: 1.6rem; }
.prose h2 { font-size: 1.15rem; margin-top: 1.4em; color: var(--brand-dark); }
.prose p, .prose li { color: var(--text); line-height: 1.7; }
.prose ul { padding-left: 1.2em; }

/* ---- Admin ---- */
.admin-controls { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-top: 12px; }
.admin-controls .field { margin: 0; }
.admin-confirm {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border);
}
.admin-filter { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.admin-settings { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.row-results { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; max-height: 240px; overflow: auto; }
.row-result { text-align: left; white-space: normal; font-size: .8rem; }
.xml-preview { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px; overflow: auto; max-height: 400px; font-size: .8rem; white-space: pre; }
.brand-rule { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.brand-rule .input { max-width: 220px; }
.brand-rule .input--auto { max-width: 100px; }
.admin-override { margin-top: 12px; }
.admin-override summary { cursor: pointer; display: inline-block; }

/* ---- Survol doux ---- */
.card { transition: transform .16s ease, box-shadow .22s ease; }
.card.lift:hover { transform: translateY(-4px); box-shadow: 0 14px 32px rgba(20,40,50,.13); }
html[data-theme="dark"] .card.lift:hover { box-shadow: 0 14px 32px rgba(0,0,0,.5); }
.cart-link, .theme-toggle, .lang-switch__item { transition: transform .12s ease, background .2s ease, color .2s ease; }
.cart-link:hover { transform: translateY(-1px); }

/* ---- Hero : badge "prix actualisés" ---- */
.hero { justify-items: center; }
.badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: color-mix(in srgb, var(--brand) 13%, var(--surface));
  color: var(--brand-dark);
  border: 1px solid color-mix(in srgb, var(--brand) 30%, transparent);
  font-weight: 600; font-size: .82rem;
  padding: 7px 16px; border-radius: 999px;
}
.badge::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: var(--brand); animation: rfp-pulse 2s infinite;
}
@keyframes rfp-pulse {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--brand) 55%, transparent); }
  70%  { box-shadow: 0 0 0 8px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* ---- Accueil : espace entre les cartes ---- */
.home-features { gap: 26px; margin-top: 28px; }
.hero { margin-bottom: 4px; }

/* ---- Honeypot (anti-spam invisible) ---- */
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

/* ---- Shop : overlay de chargement (pas de collapse) ---- */
.product-area { position: relative; min-height: 340px; }
.grid-loader {
  position: absolute; inset: 0; display: none;
  align-items: flex-start; justify-content: center; padding-top: 90px; z-index: 5;
}
.product-area.is-loading .grid-loader { display: flex; }
.product-area.is-loading .product-grid { opacity: .35; pointer-events: none; transition: opacity .2s ease; }
.spinner {
  width: 46px; height: 46px; border-radius: 50%;
  border: 4px solid var(--surface-2); border-top-color: var(--brand);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Vérification paiement live (admin) : sablier qui tourne + libellé LIVE */
.sync-hourglass { display: inline-block; font-size: 1.05em; animation: spin 1.4s linear infinite; transform-origin: 50% 50%; }
.sync-live { font-size: .78rem; font-weight: 600; color: #b56b00; animation: sync-blink 1.5s ease-in-out infinite; }
@keyframes sync-blink { 0%,100% { opacity: 1; } 50% { opacity: .45; } }

/* ---- Panier : livraison gratuite ---- */
.ship-banner {
  display: inline-flex; align-items: center; gap: 8px; margin: 0 auto 8px;
  font-size: 1.15rem; font-weight: 700; color: #0c6b3c;
  background: #e7f7ee; border: 1px solid #aee5c6; padding: 9px 20px; border-radius: 999px;
}
html[data-theme="dark"] .ship-banner { background: #0f3322; color: #97e7bd; border-color: #1c5d3c; }

/* ---- Bandeau cookies (discret, bas-gauche) ---- */
.cookie-banner {
  position: fixed; left: 16px; bottom: 16px; z-index: 200; max-width: 380px;
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--border);
  box-shadow: 0 10px 34px rgba(20, 40, 50, .18); border-radius: 14px;
  padding: 12px 14px; animation: cookie-in .35s ease;
}
html[data-theme="dark"] .cookie-banner { box-shadow: 0 10px 34px rgba(0, 0, 0, .55); }
.cookie-banner__txt { font-size: .8rem; color: var(--text-muted); line-height: 1.45; }
.cookie-banner__txt a { color: var(--brand); font-weight: 600; white-space: nowrap; }
.cookie-banner__ok { flex-shrink: 0; }
.cookie-banner[hidden] { display: none; }
@keyframes cookie-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 520px) { .cookie-banner { left: 12px; right: 12px; max-width: none; } }

/* ---- Panier : totaux ---- */
.cart-summary { margin-top: 14px; max-width: 360px; margin-left: auto; }
.cart-summary > div { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; border-top: 1px solid var(--border); }
.cart-summary__total { font-weight: 700; font-size: 1.1rem; }

/* ---- Panier responsive : cartes empilées sur mobile ---- */
@media (max-width: 640px) {
  .cart-table thead { display: none; }
  .cart-table, .cart-table tbody, .cart-table tr, .cart-table td { display: block; width: 100%; }
  .cart-table tr { border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 12px; padding: 6px 12px; background: var(--surface); }
  .cart-table td { border: none; text-align: right; padding: 8px 0; }
  .cart-table td + td { border-top: 1px solid var(--surface-2); }
  .cart-table td::before { content: attr(data-label); float: left; font-weight: 700; color: var(--text-muted); margin-right: 12px; }
  .cart-table .qty-input { width: 80px; }
  .cart-summary { max-width: none; }
}

/* ---- Règles de marge sur mobile ---- */
@media (max-width: 560px) {
  .brand-rule .input { max-width: none; flex: 1 1 140px; }
}

/* ---- FAQ / Ratgeber ---- */
.faq-item { border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 10px; background: var(--surface); overflow: hidden; }
.faq-q {
  cursor: pointer; padding: 15px 16px; font-weight: 600; font-size: 1rem; color: var(--text);
  list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 14px;
}
.faq-q::-webkit-details-marker { display: none; }
.faq-q::after { content: '+'; color: var(--brand); font-size: 1.4rem; line-height: 1; flex-shrink: 0; }
.faq-item[open] .faq-q::after { content: '−'; }
.faq-q:hover { color: var(--brand); }
.faq-a { padding: 0 16px 16px; color: var(--text-muted); line-height: 1.7; }
.faq-a p { margin: 0; }

/* ---- Footer : moyens de paiement ---- */
.footer-payments { width: 100%; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }
.footer-payments img { height: 26px; width: auto; background: #fff; border: 1px solid var(--border); border-radius: 5px; padding: 2px 4px; }

/* ---- Accueil : contenu SEO ---- */
.seo-block { margin-top: 26px; }
.seo-block h2 { font-size: 1.35rem; margin-top: 1.2em; }
.seo-block h3 { font-size: 1.05rem; margin-top: 1.1em; color: var(--brand-dark); }
.seo-block p { color: var(--text-muted); line-height: 1.7; }
.seo-block ul { columns: 2; column-gap: 24px; padding-left: 1.1em; color: var(--text-muted); }
.seo-block ul.seo-check { columns: 1; list-style: none; padding-left: 0; }
.seo-block ul.seo-check li { padding: 3px 0; }
.seo-tags { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; list-style: none; }
.seo-tags li { background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 5px 12px; font-size: .85rem; color: var(--text); }
@media (max-width: 560px) { .seo-block ul { columns: 1; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
