/**
 * SMART SUN - Améliorations Mobile & Responsive
 * Ajoutez ce fichier après style.css
 */

/* =====================================================
   MENU MOBILE HAMBURGER
   ===================================================== */

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--gray-700);
    cursor: pointer;
    padding: 10px;
}

@media (max-width: 992px) {
    .mobile-menu-toggle {
        display: block;
    }
    
    .nav {
        position: fixed;
        top: 0;
        left: -100%;
        width: 85%;
        max-width: 320px;
        height: 100vh;
        background: white;
        z-index: 9999;
        transition: left 0.3s ease;
        box-shadow: 5px 0 20px rgba(0,0,0,0.1);
        overflow-y: auto;
    }
    
    .nav.open {
        left: 0;
    }
    
    .nav-list {
        flex-direction: column;
        padding: 20px;
        gap: 0;
    }
    
    .nav-item {
        border-bottom: 1px solid var(--gray-200);
    }
    
    .nav-item a {
        display: flex;
        align-items: center;
        padding: 15px 10px;
        font-size: 15px;
    }
    
    .nav-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 9998;
    }
    
    .nav-overlay.active {
        display: block;
    }
    
    .nav-close {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 20px;
        border-bottom: 1px solid var(--gray-200);
        margin-bottom: 10px;
    }
    
    .nav-close-btn {
        background: none;
        border: none;
        font-size: 28px;
        cursor: pointer;
        color: var(--gray-600);
    }
}

/* =====================================================
   HEADER MOBILE
   ===================================================== */

@media (max-width: 768px) {
    .topbar {
        padding: 6px 0;
        font-size: 11px;
    }
    
    .topbar-content {
        flex-direction: column;
        gap: 5px;
        text-align: center;
    }
    
    .topbar-item {
        display: none;
    }
    
    .topbar-item:first-child {
        display: block;
    }
    
    .header-main {
        padding: 10px 0;
    }
    
    .header-content {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .logo {
        order: 2;
        flex: 1;
    }
    
    .logo-text span:first-child {
        font-size: 20px;
    }
    
    .logo-text span:last-child {
        font-size: 18px;
    }
    
    .mobile-menu-toggle {
        order: 1;
    }
    
    .search-box {
        order: 4;
        width: 100%;
        margin-top: 10px;
    }
    
    .header-contact {
        display: none;
    }
    
    .header-actions {
        order: 3;
        gap: 5px;
    }
    
    .header-action span {
        display: none;
    }
    
    .header-action {
        padding: 8px;
    }
    
    .header-action.pro {
        display: none;
    }
}

/* =====================================================
   HERO SECTION MOBILE
   ===================================================== */

@media (max-width: 768px) {
    .hero {
        padding: 30px 0;
    }
    
    .hero-content {
        flex-direction: column;
        text-align: center;
    }
    
    .hero-text h1 {
        font-size: 28px;
        line-height: 1.2;
    }
    
    .hero-text p {
        font-size: 14px;
    }
    
    .hero-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .hero-buttons .btn {
        width: 100%;
        justify-content: center;
    }
    
    .hero-image {
        margin-top: 30px;
    }
    
    .hero-badge {
        top: 10px;
        right: 10px;
        width: 70px;
        height: 70px;
    }
    
    .hero-badge .percent {
        font-size: 20px;
    }
}

/* =====================================================
   GRILLES PRODUITS MOBILE
   ===================================================== */

@media (max-width: 992px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}

@media (max-width: 576px) {
    .products-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .product-card {
        display: flex;
        flex-direction: row;
        padding: 10px;
    }
    
    .product-image {
        width: 120px;
        min-width: 120px;
        height: 120px;
    }
    
    .product-info {
        padding: 0 0 0 15px;
        flex: 1;
    }
    
    .product-name {
        font-size: 14px;
        -webkit-line-clamp: 2;
    }
    
    .product-specs {
        display: none;
    }
    
    .product-price {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .price-current {
        font-size: 16px;
    }
    
    .price-ht {
        display: none;
    }
    
    .btn-cart {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .btn-cart i {
        margin-right: 0;
    }
    
    .btn-cart span {
        display: none;
    }
    
    .product-actions {
        top: 5px;
        right: 5px;
    }
    
    .product-badges {
        top: 5px;
        left: 5px;
    }
    
    .badge {
        font-size: 10px;
        padding: 3px 6px;
    }
}

/* =====================================================
   CATEGORIES MOBILE
   ===================================================== */

@media (max-width: 768px) {
    .categories-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
    
    .category-card {
        padding: 15px 10px;
    }
    
    .category-icon {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
    
    .category-card h3 {
        font-size: 12px;
    }
    
    .category-card span {
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* =====================================================
   FILTRES MOBILE
   ===================================================== */

@media (max-width: 992px) {
    .catalog-layout {
        flex-direction: column;
    }
    
    .filters-sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 85%;
        max-width: 320px;
        height: 100vh;
        background: white;
        z-index: 9999;
        transition: left 0.3s ease;
        overflow-y: auto;
        padding-bottom: 80px;
    }
    
    .filters-sidebar.open {
        left: 0;
    }
    
    .filters-toggle {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 12px 20px;
        background: var(--gray-100);
        border: 1px solid var(--gray-300);
        border-radius: var(--radius);
        margin-bottom: 15px;
        cursor: pointer;
        font-weight: 600;
    }
    
    .filters-apply {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 85%;
        max-width: 320px;
        padding: 15px 20px;
        background: white;
        border-top: 1px solid var(--gray-200);
        display: flex;
        gap: 10px;
    }
    
    .filters-apply .btn {
        flex: 1;
    }
}

/* =====================================================
   PANIER MOBILE
   ===================================================== */

@media (max-width: 768px) {
    .cart-layout {
        flex-direction: column;
    }
    
    .cart-summary {
        position: static;
        width: 100%;
    }
    
    .cart-item {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }
    
    .cart-item-image {
        width: 100%;
        max-width: 150px;
        margin: 0 auto;
    }
    
    .cart-item-info {
        text-align: center;
    }
    
    .cart-item-actions {
        justify-content: center;
    }
}

/* =====================================================
   FOOTER MOBILE
   ===================================================== */

@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 30px;
        text-align: center;
    }
    
    .footer-col ul {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px 20px;
    }
    
    .footer-social {
        justify-content: center;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .footer-payments {
        justify-content: center;
    }
}

/* =====================================================
   BOUTONS & FORMULAIRES MOBILE
   ===================================================== */

@media (max-width: 576px) {
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .btn-group {
        flex-direction: column;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .newsletter-form {
        flex-direction: column;
    }
    
    .newsletter-form input {
        border-radius: var(--radius);
    }
    
    .newsletter-form button {
        border-radius: var(--radius);
        width: 100%;
    }
}

/* =====================================================
   TRUST BAR MOBILE
   ===================================================== */

@media (max-width: 768px) {
    .trust-bar {
        padding: 15px 0;
    }
    
    .trust-items {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .trust-item {
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }
    
    .trust-icon {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .trust-text strong {
        font-size: 13px;
    }
    
    .trust-text span {
        font-size: 11px;
    }
}

/* =====================================================
   COUNTDOWN MOBILE
   ===================================================== */

@media (max-width: 576px) {
    .countdown {
        gap: 10px;
    }
    
    .countdown-item {
        min-width: 55px;
        padding: 10px 8px;
    }
    
    .countdown-item .number {
        font-size: 24px;
    }
    
    .countdown-item .label {
        font-size: 10px;
    }
}

/* =====================================================
   PAGINATION MOBILE
   ===================================================== */

@media (max-width: 576px) {
    .pagination {
        gap: 5px;
    }
    
    .page-btn {
        width: 36px;
        height: 36px;
        font-size: 13px;
    }
}

/* =====================================================
   BREADCRUMB MOBILE
   ===================================================== */

@media (max-width: 576px) {
    .breadcrumb-list {
        font-size: 12px;
    }
    
    .breadcrumb-list li:not(:last-child):not(:first-child) {
        display: none;
    }
}

/* =====================================================
   UTILITAIRES MOBILE
   ===================================================== */

.hide-mobile {
    display: block;
}

.show-mobile {
    display: none;
}

@media (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }
    
    .show-mobile {
        display: block !important;
    }
}

/* Touch-friendly */
@media (pointer: coarse) {
    .btn, button, a {
        min-height: 44px;
    }
    
    .product-action-btn {
        width: 44px;
        height: 44px;
    }
}

/* Safe areas (iPhone X+) */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .floating-buttons {
        bottom: calc(20px + env(safe-area-inset-bottom));
    }
    
    .filters-apply {
        padding-bottom: calc(15px + env(safe-area-inset-bottom));
    }
}
