/* ===== Réactivité mobile / tablette / performance (chargé en dernier) ===== */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html { overflow-x: hidden; }
body { -webkit-tap-highlight-color: transparent; }
@media (max-width: 960px) { .js .reveal.from-left, .js .reveal.from-right { transform: translateY(28px); } .js .reveal.from-left.in, .js .reveal.from-right.in { transform: none; } }
img, svg, video { max-width: 100%; }
img { height: auto; }
.logo img { height: 52px; width: auto; max-width: none; }
.flogo img { height: 44px; width: auto; max-width: none; }
.nav a { white-space: nowrap; }
@media (max-width: 1100px) { .nav a { padding: 8px 10px; font-size: .88rem; } .nav a.nav-admin { margin-left: 4px; padding: 8px 12px; } }

/* Colonnes pilotées par variable (remplace les styles en ligne) */
.stats-grid { grid-template-columns: repeat(var(--cols, 4), 1fr); }
.steps { grid-template-columns: repeat(var(--cols, 4), 1fr); }

/* Écran de chargement de l'accueil */
.boot { min-height: 70vh; display: grid; place-items: center; background: linear-gradient(160deg, #041a5c, #06277f 60%, #0a3fc4); }
.spinner-sun { width: 54px; height: 54px; border-radius: 50%; border: 5px solid rgba(255,255,255,.18); border-top-color: #ffb020; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.kit-flagship:empty { min-height: 380px; background: linear-gradient(90deg, #eef2f7 25%, #f8fafc 50%, #eef2f7 75%); background-size: 200% 100%; animation: skel 1.3s ease-in-out infinite; }

/* Éléments tactiles confortables */
@media (pointer: coarse) {
  .btn { min-height: 44px; }
  .btn-sm { min-height: 40px; padding: 9px 16px; }
  .chip-btn { min-height: 40px; }
  .nav a, .nav-btn { min-height: 44px; }
  .icon-btn, .mini { min-width: 40px; min-height: 40px; }
  .qty button { width: 40px; height: 40px; }
  .faq summary { padding: 18px 0; }
}

/* Tablette */
@media (max-width: 1024px) {
  .container { padding: 0 18px; }
  .section { padding: 48px 0; }
  .hero-pro .hero-grid { gap: 36px; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

/* Mobile */
@media (max-width: 760px) {
  body { font-size: 15.5px; }
  input, select, textarea { font-size: 16px !important; } /* évite le zoom automatique sur iOS */
  .container { padding: 0 16px; }
  .section { padding: 38px 0; }
  .section-title { font-size: 1.45rem; }
  .topbar { font-size: .74rem; }
  .topbar .container { padding-top: 6px; padding-bottom: 6px; justify-content: center; text-align: center; }
  .site-header .container { height: 62px; gap: 10px; }
  .logo img { width: auto; height: 40px; }
  .site-header.scrolled .logo img { height: 36px; }
  .cart-link { padding: 8px 12px; font-size: .85rem; }
  .nav { max-height: calc(100vh - 100px); overflow-y: auto; box-shadow: 0 20px 40px rgba(4,26,92,.15); }
  .nav a { border-radius: 12px; }

  .hero-pro { padding: 40px 0 84px; }
  .hero-pro h1 { font-size: clamp(1.9rem, 8vw, 2.5rem); margin: 16px 0 12px; }
  .hero-pro p.lead { font-size: 1rem; }
  .hero-cta { flex-direction: column; }
  .hero-cta .btn { width: 100%; }
  .pills { gap: 8px; }
  .pill { font-size: .74rem; }
  .hero-card img { height: 260px; }
  .hero-card .caption { padding: 18px; }
  .chip { padding: 8px 12px; font-size: .72rem; border-radius: 14px; gap: 8px; }
  .chip i { font-size: 1.1rem; }
  .chip.c1 { left: 6px; top: -14px; }
  .chip.c2 { right: 6px; top: 46px; bottom: auto; }
  .stats-strip { margin-top: -44px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); border-radius: 18px; }
  .stat-item { padding: 16px 8px; }
  .stat-item + .stat-item::before { display: none; }
  .stat-item:nth-child(n+3) { border-top: 1px solid var(--line); }
  .stat-item:nth-child(even) { border-left: 1px solid var(--line); }
  .marquee-track span { font-size: 1.2rem; }
  .marquee-track { gap: 36px; }
  .steps { grid-template-columns: 1fr; row-gap: 22px; }
  .step { display: grid; grid-template-columns: 56px 1fr; column-gap: 14px; text-align: left; align-items: center; }
  .step .num { grid-row: 1 / 3; width: 56px; height: 56px; margin: 0; font-size: 1.3rem; box-shadow: 0 8px 18px rgba(6,55,184,.25); }
  .step h3 { align-self: end; } .step p { align-self: start; }
  .kit-banner .txt { padding: 28px 20px; }
  .kit-banner .price-tag b { font-size: 2rem; }
  .final-cta { padding: 44px 18px; border-radius: 22px; }
  .final-cta .row-btns .btn { width: 100%; }
  .cta-band { padding: 26px 20px; }
  .cta-band .btn { width: 100%; }
  .grid { gap: 16px; }
  .grid-3, .grid-4, .grid-2 { grid-template-columns: 1fr; }
  .cat-card { aspect-ratio: 16/10; }

  .page-hero { padding: 36px 0 70px; }
  .page-hero h1 { font-size: clamp(1.7rem, 7.5vw, 2.3rem); }
  .page-hero p { font-size: .98rem; }
  .filter-bar { margin-top: -46px; padding: 12px; border-radius: 16px; }
  .filter-top { flex-direction: column; }
  .filter-top select, .search-wrap { width: 100%; flex: 1 1 auto; }
  .chips { flex-wrap: nowrap; overflow-x: auto; margin: 12px -12px 0; padding: 2px 12px 6px; scrollbar-width: none; scroll-snap-type: x proximity; }
  .chips::-webkit-scrollbar { display: none; }
  .chip-btn { flex: none; scroll-snap-align: start; }
  .quick-grid { gap: 12px; }
  .quick { display: grid; grid-template-columns: 52px 1fr auto; grid-template-areas: "i b g" "i s g"; column-gap: 14px; row-gap: 0; align-items: center; padding: 16px; }
  .quick .qi { grid-area: i; margin: 0; }
  .quick b { grid-area: b; align-self: end; }
  .quick small { grid-area: s; align-self: start; }
  .quick .go { grid-area: g; margin: 0; }
  .kit-flagship .kbody { padding: 22px 18px; }
  .kit-flagship h2 { font-size: 1.4rem; }
  .variant { padding: 12px; }
  .variant .btn { width: 100%; }
  .info-card, .wa-card { padding: 20px; }
  .modal-box { max-height: 94vh; }
  .modal-box img { min-height: 200px; max-height: 260px; }
  .modal-box .mbody { padding: 18px; }

  .cart-layout { gap: 18px; }
  .cart-item { grid-template-columns: 70px 1fr; padding: 12px; gap: 12px; }
  .cart-item img { width: 70px; height: 70px; }
  .cart-item .line-total { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; }
  .link-danger { margin: 0; }
  .summary { padding: 18px; position: static; }
  .stepper { margin-bottom: 18px; }
  .stepper .st { font-size: .7rem; }

  .site-footer { padding: 36px 0 90px; }
  .footer-grid { gap: 22px; }
  .wa-float { right: 14px; bottom: calc(14px + env(safe-area-inset-bottom)); width: 52px; height: 52px; font-size: 1.5rem; }
  .toast { bottom: calc(80px + env(safe-area-inset-bottom)); max-width: calc(100vw - 32px); text-align: center; }

  /* Performance : on coupe les effets coûteux */
  .orb { display: none; }
  .hero-pro::before, .page-hero::before, .login-brand::before { animation: none; }
  .sun::after { display: none; }
  .grid.testi-scroll { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 14px; margin-left: -16px; margin-right: -16px; padding: 4px 16px 16px; scrollbar-width: none; }
  .grid.testi-scroll::-webkit-scrollbar { display: none; }
  .grid.testi-scroll > * { flex: 0 0 86%; scroll-snap-align: center; }
  .site-header, .filter-bar, .pg-bar, .topbar { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
  .site-header { background: #fff; }
}

/* Petits téléphones */
@media (max-width: 380px) {
  .container { padding: 0 14px; }
  .cart-link { padding: 7px 10px; }
  .logo img { height: 36px; }
  .hero-pro h1 { font-size: 1.75rem; }
  .stat-item b { font-size: 1.6rem; }
  .stats-grid .stat-item > span { font-size: .75rem; }
}

/* Appareils sans survol : pas d'effets de survol coûteux */
@media (hover: none) {
  .product-card:hover, .cat-card:hover, .feature:hover, .testi:hover, .quick:hover, .trust:hover { transform: none; }
  .product-card:hover .pimg img, .cat-card:hover img { transform: none; }
}

/* ===== Admin mobile ===== */
@media (max-width: 760px) {
  .admin-body .content { padding: 16px 12px 70px; }
  .adm-top { gap: 10px; }
  .kpi { padding: 14px; } .kpi b { font-size: 1.6rem; }
  .panel { padding: 16px; }
  .recent { grid-template-columns: 1fr; }
  .toolbar { gap: 8px; }
  .toolbar select, .toolbar .search { flex: 1 1 100%; }
  .pg-bar { position: static; }
  .pg-actions { width: 100%; } .pg-actions .btn { flex: 1; }
  .pg-tabs { flex-wrap: nowrap; overflow-x: auto; margin: 0 -12px 14px; padding: 0 12px 4px; scrollbar-width: none; }
  .pg-tab { flex: none; }
  details.sec > summary { padding: 14px 14px; }
  .sec-body { padding: 14px; }
  .mf-body { padding: 16px; gap: 18px; }
  .mf-head, .mf-foot { padding-left: 16px; padding-right: 16px; }
  .modal { padding: 10px 8px; }
  .modal-form { border-radius: 18px; }
  .mf-foot .btn { flex: 1; }
  .imgf { flex-direction: column; align-items: flex-start; }

  /* Tableau des produits => cartes */
  .table { min-width: 0; display: block; }
  .table thead { display: none; }
  .table tbody { display: grid; gap: 0; }
  .table tbody tr { display: grid; grid-template-columns: 62px 1fr auto; gap: 8px 12px; padding: 14px; border-bottom: 1px solid #eef2f7; align-items: center; }
  .table td { padding: 0; border: 0; }
  .table td:nth-child(1) { grid-row: 1 / 3; }
  .table td:nth-child(2) { grid-column: 2 / 3; }
  .table td:nth-child(3) { grid-column: 2 / 3; }
  .table td:nth-child(4) { grid-column: 3 / 4; grid-row: 1; justify-self: end; }
  .table td:nth-child(5), .table td:nth-child(6) { grid-column: 1 / -1; }
  .table td:nth-child(5) { grid-row: 3; } .table td:nth-child(6) { grid-row: 4; }
  .table td:nth-child(7) { grid-column: 1 / -1; grid-row: 5; }
  .sw.mini span { display: inline; }
  .acts { justify-content: flex-start; }
  .table td.empty-row { grid-column: 1 / -1; }
  .table tbody tr:has(.empty-row) { display: block; }
}

/* Connexion mobile */
@media (max-width: 900px) {
  .login-panel { min-height: 100vh; padding: 24px 18px; align-content: center; }
  .login-box .lock { width: 52px; height: 52px; }
}

/* Mouvement réduit */
@media (prefers-reduced-motion: reduce) {
  .boot .spinner-sun { animation-duration: 2s; }
}

.img-fallback { object-fit: contain !important; padding: 12%; background: #f1f5f9; }

.info-list li > div { min-width: 0; overflow-wrap: anywhere; }


/* Menu hamburger dès 1000px (le menu complet + bouton admin ne tient pas sur tablette) */
@media (max-width: 1000px) {
  .menu-toggle { display: block; }
  .nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: #fff; border-bottom: 1px solid var(--line); flex-direction: column; align-items: stretch; gap: 2px; padding: 10px 20px 16px; max-height: calc(100vh - 120px); overflow-y: auto; box-shadow: 0 20px 40px rgba(4,26,92,.15); }
  .nav.open { display: flex; }
  .nav a { padding: 12px 14px; font-size: .95rem; }
  .nav a.nav-admin { margin: 8px 0 0; justify-content: center; }
}
