/* ============================================================
   STYLE-PATCHES.CSS - SMART SWI9A
   Version 1.6.0 — Prix barré bulletproof (fix mobile)
   ============================================================ */

/* ============================================================
   0. POLICES ARABES ÉLÉGANTES
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Amiri:wght@400;700&family=Cairo:wght@400;600;700;800&display=swap');

/* ============================================================
   1. NAVBAR — FIX MOBILE / TABLETTE
   ============================================================ */
@media screen and (max-width: 900px) {

    html body #navbar ul.nav-links,
    html body #navbar .nav-links,
    html body .nav-links {
        display: none !important;
        visibility: hidden !important;
        width: 0 !important;
        height: 0 !important;
        overflow: hidden !important;
        position: absolute !important;
        pointer-events: none !important;
        opacity: 0 !important;
    }

    html body #navbar .burger-btn,
    html body #navbar button.burger-btn,
    html body .burger-btn {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        position: relative !important;
        z-index: 10 !important;
        width: 44px !important;
        height: 44px !important;
        padding: 10px !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 5px !important;
        cursor: pointer !important;
        background: transparent !important;
        border: none !important;
    }

    html body #navbar .burger-btn span,
    html body .burger-btn span {
        display: block !important;
        width: 24px !important;
        height: 2.5px !important;
        background: var(--text) !important;
        border-radius: 2px !important;
        transition: all 0.3s ease !important;
    }

    html body #navbar {
        flex-wrap: nowrap !important;
        overflow: visible !important;
        gap: 0.3rem !important;
    }

    html body #navbar .nav-left {
        flex: 0 0 auto !important;
        min-width: 0 !important;
        max-width: 45% !important;
    }

    html body #navbar .nav-right {
        flex: 1 1 auto !important;
        justify-content: flex-end !important;
        gap: 0.3rem !important;
        min-width: 0 !important;
    }

    html body #navbar .logo-text {
        font-size: 0.95rem !important;
        letter-spacing: 0.5px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        display: inline-block !important;
        max-width: 100% !important;
    }

    html body #navbar .btn-account span {
        display: none !important;
    }

    html body #navbar .btn-account {
        padding: 0.5rem !important;
        min-width: 40px !important;
        justify-content: center !important;
    }

    html body #navbar #langSelect {
        font-size: 0.7rem !important;
        padding: 0.2rem 0.3rem !important;
        max-width: 70px !important;
    }
}

@media screen and (max-width: 400px) {
    html body #navbar .logo-text {
        font-size: 0.85rem !important;
        letter-spacing: 0.3px !important;
    }
    html body #navbar #langSelect {
        font-size: 0.65rem !important;
        padding: 0.15rem 0.25rem !important;
        max-width: 60px !important;
    }
}

@media screen and (max-width: 360px) {
    html body #navbar .logo-text {
        font-size: 0.78rem !important;
    }
    html body #navbar #langSelect {
        font-size: 0.6rem !important;
        max-width: 55px !important;
    }
}

/* ============================================================
   1b. ANIMATION BURGER → CROIX QUAND OUVERT
   ============================================================ */
.burger-btn.open span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px) !important;
}
.burger-btn.open span:nth-child(2) {
    opacity: 0 !important;
}
.burger-btn.open span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px) !important;
}

/* ============================================================
   1c. LOGO ARABE — POLICE AMIRI
   ============================================================ */
html[lang="ar"] .logo-text,
html[dir="rtl"] .logo-text {
    font-family: 'Amiri', 'Playfair Display', Georgia, serif !important;
    font-size: 1.5rem !important;
    font-weight: 700 !important;
    letter-spacing: 0 !important;
    line-height: 1.2 !important;
}

html[lang="ar"] .footer-logo,
html[dir="rtl"] .footer-logo {
    font-family: 'Amiri', 'Playfair Display', Georgia, serif !important;
    font-size: 2rem !important;
    font-weight: 700 !important;
    letter-spacing: 0 !important;
}

html[lang="ar"] .section-title,
html[dir="rtl"] .section-title,
html[lang="ar"] .hero-title,
html[dir="rtl"] .hero-title,
html[lang="ar"] .product-title,
html[dir="rtl"] .product-title,
html[lang="ar"] .product-features-title,
html[dir="rtl"] .product-features-title,
html[lang="ar"] .cart-page-title,
html[dir="rtl"] .cart-page-title,
html[lang="ar"] .cart-page-summary-title,
html[dir="rtl"] .cart-page-summary-title,
html[lang="ar"] .cart-page-form-title,
html[dir="rtl"] .cart-page-form-title {
    font-family: 'Amiri', 'Playfair Display', serif !important;
    letter-spacing: 0 !important;
}

@media screen and (max-width: 900px) {
    html[lang="ar"] .logo-text,
    html[dir="rtl"] .logo-text {
        font-size: 1.2rem !important;
    }
    html[lang="ar"] .footer-logo,
    html[dir="rtl"] .footer-logo {
        font-size: 1.7rem !important;
    }
}

@media screen and (max-width: 400px) {
    html[lang="ar"] .logo-text,
    html[dir="rtl"] .logo-text {
        font-size: 1.1rem !important;
    }
}

@media screen and (max-width: 360px) {
    html[lang="ar"] .logo-text,
    html[dir="rtl"] .logo-text {
        font-size: 1rem !important;
    }
}

/* ============================================================
   2. MENU MOBILE — FIX COMPLET
   ============================================================ */
@media screen and (max-width: 900px) {

    .nav-mobile {
        display: none !important;
        position: fixed !important;
        top: var(--nav-height) !important;
        left: 0 !important;
        right: 0 !important;
        background: var(--bg-card) !important;
        border-bottom: 1px solid var(--border) !important;
        padding: 0.5rem 0 !important;
        flex-direction: column !important;
        gap: 0 !important;
        z-index: 9998 !important;
        max-height: calc(100dvh - var(--nav-height)) !important;
        overflow-y: auto !important;
        box-sizing: border-box !important;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12) !important;
        pointer-events: auto !important;
    }

    .nav-mobile.open {
        display: flex !important;
        animation: slideDownMenu 0.25s ease-out !important;
    }

    @keyframes slideDownMenu {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .nav-mobile a {
        display: block !important;
        padding: 0.9rem 1.5rem !important;
        font-size: 0.95rem !important;
        color: var(--text) !important;
        text-decoration: none !important;
        border-bottom: 1px solid var(--border) !important;
        cursor: pointer !important;
        pointer-events: auto !important;
        transition: background 0.2s, color 0.2s !important;
        text-align: left !important;
    }

    .nav-mobile a:hover,
    .nav-mobile a:active {
        background: rgba(var(--gold-rgb), 0.08) !important;
        color: var(--gold) !important;
    }

    .nav-mobile a:last-child {
        border-bottom: none !important;
    }

    [dir="rtl"] .nav-mobile a {
        text-align: right !important;
    }
}

/* ============================================================
   3. BANNIÈRE IMAGE — v1.5.0 (contain, image entière visible)
   ============================================================ */
.newphoto-banner-wrapper {
    max-width: var(--container-max);
    margin: 0 auto 1rem;
    padding: 0 1rem;
    width: 100%;
    box-sizing: border-box;
}

.responsive-hero-image {
    width: 100%;
    height: auto;
    max-height: 45vh;
    min-height: 180px;
    object-fit: contain;
    object-position: center;
    display: block;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    background: linear-gradient(135deg, #f0ebe0, #e5dfd2);
    padding: 0.5rem;
    box-sizing: border-box;
}

@media (max-width: 900px) {
    .responsive-hero-image {
        max-height: 40vh;
        border-radius: var(--radius-md);
    }
}

@media (max-width: 600px) {
    .newphoto-banner-wrapper {
        padding: 0 0.6rem;
    }
    .responsive-hero-image {
        max-height: 45vh;
        min-height: 200px;
        border-radius: var(--radius-md);
        padding: 0.4rem;
    }
}

@media (max-width: 360px) {
    .responsive-hero-image {
        min-height: 160px;
        max-height: 42vh;
        padding: 0.3rem;
    }
}

@media (orientation: landscape) and (max-height: 500px) {
    .responsive-hero-image {
        max-height: 55vh;
        min-height: 120px;
    }
}

[dir="rtl"] .responsive-hero-image {
    object-position: center;
}

/* ============================================================
   4. ESPACE BAS DE PAGE
   ============================================================ */
body {
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.product-page,
main.product-page,
main[data-product-page] {
    padding-bottom: 10rem !important;
}

.cart-page-main {
    padding-bottom: 10rem !important;
}

.villes-container,
main.villes-container {
    padding-bottom: 8rem !important;
}

main.container,
main#main {
    padding-bottom: 8rem !important;
}

.section:last-of-type {
    padding-bottom: 5rem;
}

@media (min-width: 1024px) {
    .product-page,
    main.product-page,
    main[data-product-page],
    .cart-page-main,
    .villes-container,
    main.villes-container,
    main.container,
    main#main {
        padding-bottom: 5rem !important;
    }
}

/* ============================================================
   5. BOUTON PANIER FLOTTANT
   ============================================================ */
.cart-btn-float {
    position: fixed !important;
    bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px)) !important;
    right: 1.5rem !important;
    z-index: 998 !important;
}

@media (max-width: 480px) {
    .cart-btn-float {
        width: 54px !important;
        height: 54px !important;
        bottom: calc(1.2rem + env(safe-area-inset-bottom, 0px)) !important;
        right: 1.2rem !important;
    }
}

/* ============================================================
   6. BOUTON RETOUR EN HAUT
   ============================================================ */
.back-to-top {
    position: fixed !important;
    bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px)) !important;
    right: 2rem !important;
    z-index: 997 !important;
}

@media (max-width: 480px) {
    .back-to-top {
        width: 44px !important;
        height: 44px !important;
        bottom: calc(4.8rem + env(safe-area-inset-bottom, 0px)) !important;
        right: 1.5rem !important;
        font-size: 1.2rem !important;
    }
}

/* ============================================================
   7. PAGE PRODUIT
   ============================================================ */

/* ------------------------------------------------------------
   ✅ FIX v1.6.0 : PRIX BARRÉ — TECHNIQUE BULLETPROOF
   ------------------------------------------------------------
   Problème : text-decoration: line-through sur un élément
   inline-block dans un flex container n'est PAS toujours rendu
   sur iOS Safari et certains Chrome Android.

   Solution : on dessine la ligne NOUS-MÊMES avec un pseudo-
   élément ::after. Ça marche sur 100% des navigateurs.
   ------------------------------------------------------------ */
.product-old-price {
    position: relative !important;
    display: inline-block !important;
    text-decoration: line-through !important;
    -webkit-text-decoration-line: line-through !important;
    text-decoration-thickness: 1px !important;
    color: var(--text-muted) !important;
    font-size: clamp(0.9rem, 3.5vw, 1.1rem) !important;
}

.product-old-price::after {
    content: '' !important;
    position: absolute !important;
    left: 0 !important;
    right: 0 !important;
    top: 50% !important;
    height: 1.5px !important;
    background: currentColor !important;
    transform: translateY(-50%) !important;
    pointer-events: none !important;
    opacity: 0.85 !important;
}

/* Même technique pour les autres prix barrés (panier, cartes, etc.) */
.p-price small,
.cart-item-old-price,
.cart-suggestion-old {
    position: relative !important;
    display: inline-block !important;
    text-decoration: line-through !important;
}

.p-price small::after,
.cart-item-old-price::after,
.cart-suggestion-old::after {
    content: '' !important;
    position: absolute !important;
    left: 0 !important;
    right: 0 !important;
    top: 50% !important;
    height: 1px !important;
    background: currentColor !important;
    transform: translateY(-50%) !important;
    pointer-events: none !important;
    opacity: 0.85 !important;
}

/* ------------------------------------------------------------
   Reste de la page produit (inchangé)
   ------------------------------------------------------------ */
.product-details-secondary {
    padding-bottom: 3rem !important;
    margin-top: 1rem;
}

.product-desc {
    font-size: 0.95rem !important;
    line-height: 1.8 !important;
    color: var(--text-muted) !important;
    white-space: pre-wrap !important;
    overflow-wrap: break-word !important;
    word-break: break-word !important;
    padding-bottom: 2rem !important;
    margin-bottom: 1rem !important;
}

.product-main-img-wrapper {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    overflow: hidden;
    min-height: 260px;
}

.product-main-img-wrapper img,
#mainImage {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 70vh !important;
    height: auto !important;
    object-fit: contain !important;
    display: block !important;
    background: var(--bg-surface);
}

.product-thumbnails {
    display: flex !important;
    gap: 0.5rem !important;
    flex-wrap: wrap !important;
    margin-top: 0.8rem !important;
    justify-content: center !important;
}

.product-thumbnails img {
    width: 60px !important;
    height: 60px !important;
    object-fit: cover !important;
    border-radius: var(--radius-sm) !important;
    border: 2px solid var(--border) !important;
    cursor: pointer !important;
    transition: border-color 0.2s, transform 0.2s !important;
    background: var(--bg-surface);
}

.product-thumbnails img:hover,
.product-thumbnails img.active {
    border-color: var(--gold) !important;
    transform: scale(1.05) !important;
}

.product-features-list {
    list-style: none !important;
    padding: 0 !important;
    margin: 0.8rem 0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0.5rem !important;
}

.product-features-list li {
    display: flex !important;
    align-items: flex-start !important;
    gap: 0.5rem !important;
    font-size: 0.9rem !important;
    color: var(--text) !important;
    line-height: 1.5 !important;
}

.feature-check {
    color: var(--gold) !important;
    font-weight: 800 !important;
    flex-shrink: 0 !important;
    font-size: 1rem !important;
    line-height: 1.4 !important;
}

.feature-text {
    flex: 1 !important;
    min-width: 0 !important;
    word-break: break-word !important;
}

.product-price-stock-row {
    display: flex !important;
    justify-content: space-between !important;
    align-items: flex-start !important;
    gap: 0.8rem !important;
    flex-wrap: wrap !important;
    margin: 0.8rem 0 !important;
}

.product-price-block {
    display: flex !important;
    align-items: baseline !important;
    gap: 0.5rem !important;
    flex-wrap: wrap !important;
}

.product-actions {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.6rem !important;
    margin-top: 1rem !important;
}

@media (min-width: 600px) {
    .product-actions {
        flex-direction: row !important;
    }
    .product-actions .btn-primary,
    .product-actions .btn-secondary {
        flex: 1 !important;
    }
}

.product-actions .btn-primary,
.product-actions .btn-secondary {
    width: 100% !important;
    justify-content: center !important;
    padding: 0.85rem 1.2rem !important;
}

.breadcrumbs {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 0.3rem !important;
    font-size: 0.85rem !important;
    color: var(--text-muted) !important;
    margin-bottom: 0.8rem !important;
    overflow-wrap: break-word !important;
    word-break: break-word !important;
}

.breadcrumbs a {
    color: var(--gold) !important;
    text-decoration: none !important;
}

.related-products-container {
    margin-top: 2rem !important;
    padding-top: 1.5rem !important;
    border-top: 1px solid var(--border) !important;
}

.related-products-container .product-card {
    min-width: 0 !important;
}

[dir="rtl"] .product-features-list li {
    flex-direction: row-reverse !important;
    text-align: right !important;
}

[dir="rtl"] .breadcrumbs {
    flex-direction: row-reverse !important;
}

/* ============================================================
   8. PAGE VILLES
   ============================================================ */
.villes-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.villes-table {
    min-width: 500px;
}

@media (max-width: 600px) {
    .villes-container {
        padding: 0 0.8rem;
    }
    .villes-stats {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.6rem;
    }
    .ville-stat-card {
        padding: 0.7rem;
    }
    .ville-stat-card strong {
        font-size: 1.2rem;
    }
    .ville-stat-card span {
        font-size: 0.7rem;
    }
    .villes-table th,
    .villes-table td {
        padding: 0.5rem 0.6rem;
        font-size: 0.8rem;
    }
}

/* ============================================================
   9. PAGE BLOG
   ============================================================ */
@media (max-width: 600px) {
    .blog-article-body {
        padding: 1.2rem;
    }
    .blog-article-close {
        top: 0.6rem;
        right: 0.6rem;
        width: 36px;
        height: 36px;
    }
    .blog-search-bar input {
        font-size: 0.9rem;
        padding: 0.7rem 1rem;
    }
}

/* ============================================================
   10. PAGE PANIER
   ============================================================ */
@media (max-width: 480px) {
    .cart-page-item {
        grid-template-columns: 80px 1fr !important;
        padding: 0.8rem !important;
        gap: 0.8rem !important;
    }
    .cart-page-item-img {
        width: 80px !important;
        height: 80px !important;
    }
    .cart-page-item-name {
        font-size: 0.88rem !important;
    }
    .cart-page-summary,
    .cart-page-form {
        padding: 1.1rem !important;
    }
}

/* ============================================================
   11. SECTION HERO
   ============================================================ */
@media (max-width: 600px) {
    .hero-section {
        padding: 1rem 1rem 1.5rem;
    }
    .hero-title {
        font-size: clamp(1.3rem, 5.5vw, 2rem);
    }
    .hero-sub {
        font-size: 0.9rem;
    }
    .hero-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    .hero-actions .btn-primary,
    .hero-actions .btn-ghost {
        width: 100%;
        padding: 0.75rem 1.5rem;
        font-size: 0.9rem;
    }
}

/* ============================================================
   12. BANNIÈRES CARROUSELS
   ============================================================ */
@media (max-width: 768px) {
    .banners-section {
        grid-template-columns: 1fr !important;
        gap: 1.2rem;
    }
    .banner-wrapper {
        padding: 1rem;
    }
    .banner-item {
        flex: 0 0 calc(50% - 12px);
        margin-right: 12px;
    }
}

@media (max-width: 480px) {
    .banner-track-wrapper {
        border-radius: var(--radius-md);
    }
    .banner-nav {
        width: 28px;
        height: 28px;
        font-size: 1rem;
    }
}

/* ============================================================
   13. PRODUITS - Grille
   ============================================================ */
@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.7rem;
    }
    .products-wrap {
        padding: 1rem;
        border-radius: var(--radius-md);
    }
    .product-body {
        padding: 0.65rem;
    }
    .p-name {
        font-size: 0.82rem;
    }
    .p-price {
        font-size: 0.9rem;
    }
    .btn-add-to-cart {
        padding: 0.25rem 0.55rem;
        font-size: 0.65rem;
    }
}

/* ============================================================
   14. TRUST BAR
   ============================================================ */
@media (max-width: 600px) {
    .trust-bar {
        gap: 0.5rem 1rem;
        padding: 0.7rem 0.8rem;
    }
    .trust-item {
        font-size: 0.75rem;
    }
}

/* ============================================================
   15. FOOTER
   ============================================================ */
@media (max-width: 600px) {
    .site-footer {
        padding: 1.5rem 1rem;
    }
    .footer-logo {
        font-size: 1.3rem;
    }
    .footer-contact {
        flex-direction: column;
        gap: 0.6rem;
    }
    .footer-social-links {
        gap: 0.8rem;
    }
}

/* ============================================================
   16. PROMO BANNER MARQUEE
   ============================================================ */
@media (max-width: 480px) {
    .navbar-promo-banner {
        font-size: 0.7rem;
        padding: 0.25rem 0.6rem;
    }
}

/* ============================================================
   17. RTL - Arabe
   ============================================================ */
[dir="rtl"] .nav-links {
    direction: rtl;
}

[dir="rtl"] .cart-btn-float {
    right: auto !important;
    left: 1.5rem !important;
}

[dir="rtl"] .back-to-top {
    right: auto !important;
    left: 2rem !important;
}

/* ============================================================
   18. LANDSCAPE MOBILE
   ============================================================ */
@media (max-height: 500px) and (orientation: landscape) {
    body {
        padding-top: calc(var(--nav-height) + 4px);
    }
    .hero-section {
        padding: 0.8rem 1rem;
    }
    .hero-glow {
        display: none;
    }
    .product-page,
    .cart-page-main,
    .villes-container,
    main.container,
    main#main {
        padding-bottom: 3rem !important;
    }
}

/* ============================================================
   19. SAFE AREA - iPhone avec encoche
   ============================================================ */
@supports (padding-top: env(safe-area-inset-top)) {
    body {
        padding-top: calc(var(--nav-height) + 8px + env(safe-area-inset-top, 0px));
    }
    #navbar {
        padding-top: env(safe-area-inset-top, 0px);
        height: calc(var(--nav-height) + env(safe-area-inset-top, 0px));
    }
    .nav-mobile {
        top: calc(var(--nav-height) + env(safe-area-inset-top, 0px));
        max-height: calc(100dvh - var(--nav-height) - env(safe-area-inset-top, 0px));
    }
}

/* ============================================================
   20. FIX DIVERS
   ============================================================ */
* {
    max-width: 100%;
    box-sizing: border-box;
}

html, body {
    overflow-x: hidden;
    width: 100%;
}

img {
    max-width: 100%;
    height: auto;
}

table {
    max-width: 100%;
}

p, h1, h2, h3, h4, h5, h6 {
    overflow-wrap: break-word;
    word-wrap: break-word;
}

/* ============================================================
   LOG
   ============================================================ */
/* style-patches.css v1.6.0 — Prix barré bulletproof */