/* =============================================================================
 * mobile-enhance.css — Cybergear front — Phase mobile + trust + engagement
 *
 * Applique les quick wins du top 10 audit sans toucher au SPA React source :
 *   - Trust bar fixe en haut (livraison + paiement sécurisé + SAV)
 *   - Touch targets 44px mobile sur tous les liens/boutons nav
 *   - Sticky "Add to cart" mobile bottom sur product detail
 *   - Viewport fluide, no horizontal scroll
 *   - Burger menu accessible, panels mobile correctement dimensionnés
 *   - Skeleton loaders metallic pour cards en cours de chargement
 *   - Image sizes responsive sur product cards
 *   - Typography lisible mobile (font-size 16px+ pour éviter zoom iOS)
 * ============================================================================= */

/* ===== 1. Trust bar top ===== */
/* Barre fine en haut (au-dessus du header) avec 3 badges confiance */
#lux-trust-bar {
    position: relative;
    z-index: 1050;
    background: linear-gradient(90deg, #0a1628 0%, #1a3458 50%, #0a1628 100%);
    color: #f0c060;
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    padding: 0.45rem 1rem;
    text-align: center;
    border-bottom: 1px solid rgba(224, 166, 62, 0.22);
    line-height: 1.3;
}
#lux-trust-bar .lux-trust-items {
    display: inline-flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
}
#lux-trust-bar .lux-trust-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    white-space: nowrap;
}
#lux-trust-bar .lux-trust-item svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}
@media (max-width: 640px) {
    #lux-trust-bar { font-size: 0.72rem; padding: 0.35rem 0.5rem; }
    #lux-trust-bar .lux-trust-items { gap: 0.75rem; }
}
@media (max-width: 420px) {
    /* Cacher les 2 derniers items sur très petit écran */
    #lux-trust-bar .lux-trust-item:nth-child(n+3) { display: none; }
}

/* ===== 2. Mobile : pas de scroll horizontal ===== */
@media (max-width: 768px) {
    html, body { overflow-x: hidden; max-width: 100vw; }
    img, video, iframe { max-width: 100% !important; height: auto; }
    table { display: block; overflow-x: auto; }
}

/* ===== 3. Touch targets 44px minimum sur mobile ===== */
@media (max-width: 768px) {
    header a, .navbar a, nav a,
    header button, .navbar button,
    .btn, button.btn,
    .social-icons a, footer a,
    .cart-icon, .account-icon,
    [role="button"] {
        min-height: 44px;
        min-width: 44px;
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
    }
    /* Sauf les liens inline dans le texte */
    p a, .description a, .content a {
        min-height: 0 !important;
        min-width: 0 !important;
        display: inline !important;
    }
}

/* ===== 4. Font-size mobile ≥ 16px pour éviter zoom iOS sur input focus ===== */
@media (max-width: 768px) {
    input[type="text"], input[type="email"], input[type="password"],
    input[type="search"], input[type="tel"], input[type="number"],
    input[type="url"], textarea, select {
        font-size: 16px !important;  /* iOS ne zoom plus sur focus */
    }
    body, p, li, span {
        font-size: clamp(14px, 3.5vw, 16px);
    }
}

/* ===== 5. Sticky "Add to cart" CTA mobile sur product detail ===== */
#lux-sticky-cart {
    display: none;
}
@media (max-width: 768px) {
    #lux-sticky-cart.active {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 1040;
        background: linear-gradient(180deg, rgba(10, 22, 40, 0.97) 0%, rgba(5, 15, 30, 0.99) 100%);
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
        padding: 0.75rem 1rem;
        padding-bottom: calc(0.75rem + env(safe-area-inset-bottom));
        gap: 0.75rem;
        align-items: center;
        box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.3);
        border-top: 1px solid rgba(224, 166, 62, 0.3);
        animation: luxSlideUp 320ms cubic-bezier(0.25, 0.8, 0.25, 1);
    }
    #lux-sticky-cart .lux-price {
        flex: 1;
        color: #f0c060;
        font-weight: 700;
        font-size: 1.1rem;
        font-variant-numeric: tabular-nums;
        line-height: 1.1;
    }
    #lux-sticky-cart .lux-price small {
        display: block;
        color: #cdd4dd;
        font-size: 0.72rem;
        font-weight: 400;
        margin-top: 2px;
    }
    #lux-sticky-cart button {
        background: linear-gradient(180deg, #d9966b 0%, #b8733a 55%, #8a5426 100%) !important;
        color: #fff !important;
        border: 1px solid #8a5426 !important;
        border-radius: 999px;
        padding: 0.7rem 1.5rem !important;
        font-weight: 700;
        font-size: 0.9rem;
        letter-spacing: 0.02em;
        box-shadow: 0 4px 14px rgba(184, 115, 58, 0.4);
        white-space: nowrap;
    }
    #lux-sticky-cart button:active { filter: brightness(0.92); }
}
@keyframes luxSlideUp {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* ===== 6. Newsletter popup (coin bas-droit, non-intrusif) ===== */
#lux-newsletter-popup {
    display: none;
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    z-index: 1060;
    width: min(380px, calc(100vw - 2rem));
    background: linear-gradient(180deg, #1b2230 0%, #0a1628 100%);
    border: 1px solid rgba(224, 166, 62, 0.3);
    border-radius: 16px;
    padding: 1.25rem 1.4rem;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    color: #f1f5f9;
    animation: luxFadeIn 320ms ease-out;
}
#lux-newsletter-popup.active { display: block; }
#lux-newsletter-popup .lux-nw-close {
    position: absolute;
    top: 0.5rem;
    right: 0.75rem;
    background: transparent;
    border: 0;
    color: #94a3b8;
    font-size: 1.4rem;
    cursor: pointer;
    line-height: 1;
    padding: 4px 8px;
    border-radius: 4px;
}
#lux-newsletter-popup .lux-nw-close:hover { color: #f0c060; background: rgba(255, 255, 255, 0.06); }
#lux-newsletter-popup h4 {
    font-family: "Playfair Display", Georgia, serif;
    font-size: 1.2rem;
    color: #f0c060;
    margin: 0 0 0.4rem 0;
    letter-spacing: -0.01em;
}
#lux-newsletter-popup p {
    font-size: 0.88rem;
    color: #cbd5e1;
    margin: 0 0 0.85rem 0;
    line-height: 1.4;
}
#lux-newsletter-popup form { display: flex; gap: 0.4rem; }
#lux-newsletter-popup input[type="email"] {
    flex: 1;
    padding: 0.6rem 0.85rem !important;
    border-radius: 999px 0 0 999px !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    background: rgba(255, 255, 255, 0.05) !important;
    color: #f1f5f9 !important;
    font-size: 0.9rem !important;
}
#lux-newsletter-popup input[type="email"]::placeholder { color: #64748b; }
#lux-newsletter-popup button[type="submit"] {
    padding: 0.6rem 1.1rem !important;
    border-radius: 0 999px 999px 0 !important;
    background: linear-gradient(180deg, #d9966b, #b8733a) !important;
    color: #fff !important;
    border: 1px solid #8a5426 !important;
    font-weight: 600 !important;
    white-space: nowrap;
}
#lux-newsletter-popup .lux-nw-code {
    display: inline-block;
    background: rgba(224, 166, 62, 0.15);
    color: #f0c060;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-family: ui-monospace, Menlo, monospace;
    font-weight: 600;
    letter-spacing: 0.05em;
}
@media (max-width: 480px) {
    #lux-newsletter-popup {
        left: 0.5rem;
        right: 0.5rem;
        bottom: 0.5rem;
        width: auto;
    }
}
@keyframes luxFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== 7. Skeleton metallic shimmer sur product cards ===== */
.product-card.lux-loading,
.product-card[aria-busy="true"],
.card-product.lux-loading {
    position: relative;
    pointer-events: none;
}
.product-card.lux-loading::before,
.card-product.lux-loading::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(100deg, transparent 0%, rgba(255, 255, 255, 0.08) 50%, transparent 100%);
    background-size: 200% 100%;
    animation: luxShimmer 1.5s infinite linear;
    pointer-events: none;
    border-radius: inherit;
}
@keyframes luxShimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* ===== 8. Product card enhancement ===== */
.product-card img, .card-product img, .product-item img {
    object-fit: contain;
    background: rgba(255, 255, 255, 0.02);
}
.product-card .product-title, .card-product .product-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 2.6em;  /* Uniformise hauteur cards */
}

/* ===== 9. Footer mobile : columns stacks ===== */
@media (max-width: 640px) {
    footer .row > [class*="col-"], .footer .row > [class*="col-"] {
        margin-bottom: 1.5rem;
    }
    footer h3, footer h4, footer h5 { margin-top: 0.5rem; }
    .social-icons { justify-content: flex-start; }
}

/* ===== 10. Header mobile : compact ===== */
@media (max-width: 768px) {
    header, .navbar, nav.navbar {
        padding: 0.45rem 1rem !important;
    }
    .navbar-brand img, .logo img {
        max-height: 38px !important;
        width: auto !important;
    }
}

/* ===== 11. Hide-scrollbar helper (for horizontal product rows) ===== */
.lux-scroll-x {
    overflow-x: auto;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}
.lux-scroll-x::-webkit-scrollbar { height: 5px; }
.lux-scroll-x::-webkit-scrollbar-thumb { background: rgba(224, 166, 62, 0.4); border-radius: 10px; }

/* ===== 12. Image lazy-load placeholder ===== */
img[loading="lazy"] {
    background: linear-gradient(90deg, #1a2130 0%, #242c3c 50%, #1a2130 100%);
    background-size: 200% 100%;
}
img[loading="lazy"]:not([src]) { animation: luxShimmer 1.5s infinite linear; }

/* ===== 13. Price contrast ===== */
.product-price, .price-current {
    color: #c8922a;
    font-weight: 700;
}
.product-price-old, .price-old, del {
    color: #64748b;
    text-decoration: line-through;
    font-size: 0.85em;
    margin-right: 0.4em;
}

/* ===== 14. Focus premium ===== */
:focus-visible {
    outline: 3px solid #e0a63e;
    outline-offset: 2px;
    border-radius: 6px;
}

/* ===== 15. Reduce motion safeguard ===== */
@media (prefers-reduced-motion: reduce) {
    #lux-trust-bar, #lux-sticky-cart, #lux-newsletter-popup {
        animation: none !important;
        transition: none !important;
    }
}
