/* ============================================================
   BIKRI — CSS MOBILE COMPLET
   Optimisé pour tous les écrans < 768px
   ============================================================ */

/* Base mobile */
@media (max-width: 768px) {

    /* ======================================
       GLOBAL
       ====================================== */
    html, body {
        overflow-x: hidden;
        font-size: 15px;
    }

    .container {
        padding-left: 14px !important;
        padding-right: 14px !important;
    }

    /* Cacher le chat widget sur mobile (remplacé par bottom nav) */
    .chat-widget { display: none !important; }

    /* ======================================
       HEADER
       ====================================== */
    #bikri-header .header-inner {
        padding: 0 14px;
        height: 58px;
        gap: 10px;
    }

    /* Logo plus petit */
    .header-logo img { height: 36px !important; }

    /* Barre de recherche : plein écran sous le header */
    .header-search {
        display: none; /* cachée par défaut, affichée via toggle */
    }

    /* Nav : garder seulement l'essentiel */
    .header-nav {
        gap: 8px;
    }

    /* Cacher le drapeau et "Connexion" texte sur mobile */
    .header-flag,
    .header-nav-link:not(.btn-sell) {
        display: none !important;
    }

    /* Bouton Vendre compact */
    .header-nav-link.btn-sell {
        padding: 8px 14px !important;
        font-size: 13px !important;
    }

    /* Avatar gardé visible */
    .header-avatar {
        width: 36px !important;
        height: 36px !important;
        font-size: 13px !important;
    }

    /* Toggle hamburger visible */
    .header-menu-toggle {
        display: flex !important;
    }

    /* Menu mobile plein écran */
    .bikri-mobile-menu {
        padding: 16px 14px;
    }

    .mobile-search input {
        font-size: 15px;
        padding: 12px 16px;
    }

    /* Espace pour la bottom nav */
    #bikri-main {
        padding-bottom: 70px;
    }

    /* ======================================
       HOMEPAGE — Hero
       ====================================== */
    .hero-section {
        padding: 28px 0 24px !important;
    }

    .hero-inner {
        grid-template-columns: 1fr !important;
        text-align: center;
        gap: 20px !important;
    }

    .hero-title {
        font-size: 26px !important;
        line-height: 1.2 !important;
    }

    .hero-subtitle {
        font-size: 15px !important;
    }

    .hero-cta {
        flex-direction: column !important;
        align-items: center !important;
        gap: 10px !important;
    }

    .hero-cta .bikri-btn {
        width: 100%;
        max-width: 280px;
        justify-content: center;
    }

    .hero-features {
        flex-wrap: wrap;
        justify-content: center !important;
        gap: 8px !important;
    }

    .hero-feature {
        font-size: 12px !important;
    }

    .hero-image { display: none !important; }

    /* ======================================
       HOMEPAGE — Recherche mobile
       ====================================== */
    .hero-search-bar {
        flex-direction: column !important;
        gap: 8px !important;
        padding: 12px !important;
    }

    .hero-search-bar input {
        font-size: 15px !important;
        padding: 12px 16px !important;
    }

    .hero-search-bar button {
        width: 100% !important;
        padding: 12px !important;
    }

    /* ======================================
       CATÉGORIES
       ====================================== */
    .categories-section { padding: 24px 0 !important; }

    .categories-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 10px !important;
    }

    .category-card {
        padding: 14px 8px !important;
    }

    .category-icon { font-size: 26px !important; }
    .category-name { font-size: 11px !important; }

    /* ======================================
       PRODUITS
       ====================================== */
    .products-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }

    .product-card {
        border-radius: 12px !important;
    }

    .product-card-img {
        height: 160px !important;
    }

    .product-card-body {
        padding: 10px !important;
    }

    .product-card-title {
        font-size: 13px !important;
        -webkit-line-clamp: 2;
    }

    .product-card-price {
        font-size: 16px !important;
    }

    /* ======================================
       SECTION VENDRE (homepage)
       ====================================== */
    .sell-promo-inner {
        grid-template-columns: 1fr !important;
        text-align: center !important;
        padding: 24px 20px !important;
    }

    .sell-promo-image { display: none !important; }

    .sell-promo-title { font-size: 22px !important; }

    .sell-promo-features {
        justify-content: center !important;
    }

    /* ======================================
       SECTION PRO
       ====================================== */
    .pro-comparison {
        grid-template-columns: 1fr !important;
        gap: 14px !important;
    }

    .pro-card {
        padding: 20px !important;
    }

    /* ======================================
       FOOTER
       ====================================== */
    .footer-top {
        grid-template-columns: 1fr !important;
        gap: 24px !important;
        padding: 32px 0 20px !important;
    }

    .footer-bottom {
        flex-direction: column !important;
        text-align: center !important;
        gap: 8px !important;
    }

    /* ======================================
       PAGE PRODUIT
       ====================================== */
    .product-single-grid {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }

    .product-gallery-main {
        height: 300px !important;
        border-radius: 14px !important;
    }

    .product-price-big {
        font-size: 28px !important;
    }

    .product-actions {
        flex-direction: column !important;
        gap: 10px !important;
    }

    .product-actions .bikri-btn {
        width: 100% !important;
        justify-content: center !important;
    }

    /* ======================================
       PAGES AUTH (Connexion / Inscription)
       ====================================== */
    .bikri-auth-wrap {
        grid-template-columns: 1fr !important;
        min-height: auto !important;
        margin: 0 !important;
    }

    .bikri-auth-left {
        position: static !important;
        height: auto !important;
        padding: 28px 20px !important;
        min-height: auto !important;
    }

    .bauth-tagline h1 { font-size: 24px !important; }

    .bauth-perks {
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
    }

    .bauth-perk {
        font-size: 13px !important;
        padding: 10px 12px !important;
    }

    .bikri-auth-right {
        padding: 20px 16px 30px !important;
    }

    .bauth-form-wrap {
        padding: 24px 18px !important;
        border-radius: 16px !important;
    }

    .bauth-profiles {
        grid-template-columns: 1fr 1fr !important;
        gap: 10px !important;
    }

    .bauth-profile-inner {
        padding: 14px 10px !important;
    }

    .bauth-profile-emoji { font-size: 26px !important; }
    .bauth-profile-label { font-size: 12px !important; }

    .bauth-row {
        grid-template-columns: 1fr !important;
    }

    /* ======================================
       DASHBOARD COMPTE
       ====================================== */
    .bikri-account-wrap {
        grid-template-columns: 1fr !important;
        min-height: auto !important;
    }

    .bikri-account-sidebar {
        display: none !important;
    }

    .bikri-account-content {
        padding: 16px 14px 80px !important;
        min-height: auto !important;
    }

    /* Stats en 2 colonnes */
    .bikri-stats-grid,
    .dashboard-stats {
        grid-template-columns: 1fr 1fr !important;
        gap: 10px !important;
    }

    .bikri-stat-card {
        padding: 14px !important;
    }

    .bikri-stat-value {
        font-size: 22px !important;
    }

    /* Actions en colonne */
    .bikri-actions-grid,
    .dashboard-actions {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    /* Annonces en 2 colonnes */
    .bikri-listings-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 10px !important;
    }

    /* ======================================
       BOTTOM NAVIGATION BAR
       ====================================== */
    .bikri-bottom-nav {
        display: flex !important;
        position: fixed;
        bottom: 0; left: 0; right: 0;
        background: #1A1A2E;
        z-index: 9999;
        height: 62px;
        border-top: 1px solid rgba(255,255,255,0.08);
        box-shadow: 0 -4px 20px rgba(0,0,0,0.25);
        padding: 0 8px;
        padding-bottom: env(safe-area-inset-bottom);
        align-items: center;
        justify-content: space-around;
    }

    .bbn-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        text-decoration: none;
        color: rgba(255,255,255,0.4);
        font-size: 10px;
        font-weight: 700;
        padding: 6px 4px;
        border-radius: 10px;
        transition: color 0.2s;
        position: relative;
        -webkit-tap-highlight-color: transparent;
    }

    .bbn-item.active { color: #FF6B00; }
    .bbn-item:hover  { color: white; }

    .bbn-icon {
        font-size: 22px;
        line-height: 1;
        display: block;
    }

    .bbn-label {
        font-size: 9px;
        font-weight: 700;
        white-space: nowrap;
        line-height: 1;
    }

    /* Bouton central Vendre */
    .bbn-item.bbn-sell {
        background: linear-gradient(135deg, #FF6B00, #FF9A3C);
        color: white !important;
        border-radius: 14px;
        min-width: 58px;
        max-width: 70px;
        margin: 0 4px;
        padding: 8px 6px;
        box-shadow: 0 3px 12px rgba(255,107,0,0.45);
    }

    .bbn-badge {
        position: absolute;
        top: 2px; right: 4px;
        background: #EF4444;
        color: white;
        font-size: 9px;
        font-weight: 900;
        min-width: 16px;
        height: 16px;
        border-radius: 50px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0 4px;
    }

    /* ======================================
       DIVERS
       ====================================== */

    /* Boutons full width sur mobile */
    .bikri-btn-full-mobile {
        width: 100% !important;
        justify-content: center !important;
    }

    /* Titres de section */
    .section-title {
        font-size: 20px !important;
    }

    /* Tables → scroll horizontal */
    .woocommerce-orders-table,
    .shop_table {
        font-size: 13px !important;
        display: block !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }

    /* Formulaires WC */
    .woocommerce-checkout .col2-set,
    .woocommerce-checkout .col-1,
    .woocommerce-checkout .col-2 {
        float: none !important;
        width: 100% !important;
    }

    /* Protection bloc au checkout */
    .bikri-protection-block {
        margin: 14px 0 !important;
    }

    .protection-header {
        flex-wrap: wrap !important;
        gap: 8px !important;
    }
}

/* Très petits écrans (320px) */
@media (max-width: 380px) {
    .categories-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .products-grid {
        grid-template-columns: 1fr !important;
    }

    .bbn-label { display: none !important; }

    .hero-title { font-size: 22px !important; }
}

/* Desktop — cacher bottom nav */
@media (min-width: 769px) {
    .bikri-bottom-nav { display: none !important; }
}

/* ======================================
   MENU MOBILE DANS LE COMPTE
   ====================================== */

/* Caché sur desktop */
.bikri-mobile-account-menu { display: none; }

@media (max-width: 768px) {
    .bikri-mobile-account-menu {
        display: block;
        margin-top: 24px;
        padding-top: 20px;
        border-top: 2px solid #E5E7EB;
    }

    .bikri-mobile-account-menu h3 {
        font-size: 13px;
        font-weight: 800;
        color: #9CA3AF;
        text-transform: uppercase;
        letter-spacing: 1px;
        margin-bottom: 14px;
    }

    .bmam-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .bmam-item {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 12px 14px;
        background: white;
        border: 1.5px solid #E5E7EB;
        border-radius: 12px;
        color: #1A1A2E;
        text-decoration: none;
        font-size: 13px;
        font-weight: 700;
        transition: all 0.2s;
        -webkit-tap-highlight-color: transparent;
    }

    .bmam-item:active {
        background: #F3F4F6;
        transform: scale(0.97);
    }

    .bmam-item.bmam-cta {
        grid-column: 1 / -1;
        background: linear-gradient(135deg, #FF6B00, #FF9A3C);
        color: white;
        border-color: transparent;
        justify-content: center;
        font-size: 14px;
        padding: 14px;
        border-radius: 50px;
        box-shadow: 0 4px 14px rgba(255,107,0,0.35);
    }

    .bmam-item.bmam-logout {
        grid-column: 1 / -1;
        color: #EF4444;
        border-color: #FEE2E2;
        background: #FEF2F2;
        justify-content: center;
    }
}
