/**
 * CSS Responsivo pour Star Store
 * Optimisé pour tous les appareils et tailles d'écran
 * 
 * @package StarStore
 * @since 1.0.0
 */

/* ===== BREAKPOINTS ===== */
/* 
 * Mobile: 320px - 767px
 * Tablet: 768px - 1023px  
 * Desktop: 1024px+
 * Large Desktop: 1200px+
 */

/* ===== BASE RESPONSIVE ===== */
* {
    box-sizing: border-box;
}

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

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== NAVIGATION RESPONSIVE ===== */
@media (max-width: 767px) {
    .main-navigation {
        position: fixed;
        top: 0;
        left: -100%;
        width: 280px;
        height: 100vh;
        background: #fff;
        z-index: 9999;
        transition: left 0.3s ease;
        box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    }
    
    .main-navigation.active {
        left: 0;
    }
    
    .nav-menu {
        flex-direction: column;
        padding: 80px 20px 20px;
        height: 100%;
        overflow-y: auto;
    }
    
    .nav-menu li {
        width: 100%;
        border-bottom: 1px solid #eee;
    }
    
    .nav-menu a {
        display: block;
        padding: 15px 0;
        font-size: 16px;
    }
    
    .mobile-menu-toggle {
        display: block;
        background: none;
        border: none;
        font-size: 24px;
        cursor: pointer;
        padding: 10px;
    }
    
    .mobile-menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 9998;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }
    
    .mobile-menu-overlay.active {
        opacity: 1;
        visibility: visible;
    }
}

@media (min-width: 768px) {
    .mobile-menu-toggle {
        display: none;
    }
}

/* ===== HEADER RESPONSIVE ===== */
.site-header {
    padding: 10px 0;
}

@media (max-width: 767px) {
    .site-header {
        padding: 15px 0;
    }
    
    .header-content {
        flex-direction: column;
        gap: 15px;
    }
    
    .site-branding {
        text-align: center;
    }
    
    .site-logo img {
        max-height: 40px;
    }
    
    .header-actions {
        justify-content: center;
        gap: 20px;
    }
    
    .search-form {
        width: 100%;
        max-width: 300px;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .header-content {
        gap: 20px;
    }
    
    .site-logo img {
        max-height: 50px;
    }
}

/* ===== HERO SECTION RESPONSIVE ===== */
.hero-section {
    padding: 60px 0;
    text-align: center;
}

@media (max-width: 767px) {
    .hero-section {
        padding: 40px 0;
    }
    
    .hero-content h1 {
        font-size: 2rem;
        line-height: 1.2;
        margin-bottom: 15px;
    }
    
    .hero-content p {
        font-size: 16px;
        margin-bottom: 25px;
    }
    
    .hero-buttons {
        flex-direction: column;
        gap: 15px;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 280px;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .hero-section {
        padding: 50px 0;
    }
    
    .hero-content h1 {
        font-size: 2.5rem;
    }
}

/* ===== GRILLES PRODUITS RESPONSIVE ===== */
.products-grid {
    display: grid;
    gap: 30px;
    margin: 40px 0;
}

/* Mobile: 1 colonne */
@media (max-width: 767px) {
    .products-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        margin: 30px 0;
    }
    
    .product-item {
        max-width: 100%;
    }
    
    .product-image {
        aspect-ratio: 1;
    }
    
    .product-info {
        padding: 15px;
    }
    
    .product-title {
        font-size: 16px;
        line-height: 1.3;
    }
    
    .product-price {
        font-size: 18px;
        margin: 10px 0;
    }
    
    .product-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .btn {
        width: 100%;
        padding: 12px;
        font-size: 14px;
    }
}

/* Tablet: 2 colonnes */
@media (min-width: 768px) and (max-width: 1023px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }
    
    .product-item {
        max-width: 100%;
    }
}

/* Desktop: 3-4 colonnes */
@media (min-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .products-grid.four-columns {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 1200px) {
    .products-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .products-grid.five-columns {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* ===== SIDEBAR RESPONSIVE ===== */
@media (max-width: 1023px) {
    .shop-sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 300px;
        height: 100vh;
        background: #fff;
        z-index: 9999;
        transition: left 0.3s ease;
        overflow-y: auto;
        padding: 20px;
        box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    }
    
    .shop-sidebar.active {
        left: 0;
    }
    
    .sidebar-toggle {
        display: block;
        margin-bottom: 20px;
        padding: 10px 20px;
        background: #3498db;
        color: white;
        border: none;
        border-radius: 5px;
        cursor: pointer;
    }
    
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 9998;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }
    
    .sidebar-overlay.active {
        opacity: 1;
        visibility: visible;
    }
    
    .shop-content {
        width: 100%;
    }
}

@media (min-width: 1024px) {
    .sidebar-toggle {
        display: none;
    }
    
    .shop-layout {
        display: flex;
        gap: 30px;
    }
    
    .shop-sidebar {
        width: 280px;
        flex-shrink: 0;
    }
    
    .shop-content {
        flex: 1;
    }
}

/* ===== FORMULAIRES RESPONSIVE ===== */
.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

@media (max-width: 767px) {
    .form-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .form-group {
        width: 100%;
    }
    
    input, select, textarea {
        width: 100%;
        padding: 12px;
        font-size: 16px; /* Évite le zoom sur iOS */
    }
    
    .btn {
        width: 100%;
        padding: 15px;
        font-size: 16px;
    }
}

/* ===== PANIER DRAWER RESPONSIVE ===== */
.cart-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    pointer-events: none;
}

.cart-drawer.active {
    pointer-events: all;
}

.cart-drawer-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cart-drawer.active .cart-drawer-overlay {
    opacity: 1;
}

.cart-drawer-content {
    position: absolute;
    top: 0;
    right: -100%;
    width: 400px;
    max-width: 90vw;
    height: 100%;
    background: #fff;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
}

.cart-drawer.active .cart-drawer-content {
    right: 0;
}

@media (max-width: 767px) {
    .cart-drawer-content {
        width: 100%;
        max-width: 100vw;
    }
}

/* ===== TABLES RESPONSIVE ===== */
@media (max-width: 767px) {
    .responsive-table {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .responsive-table table {
        min-width: 600px;
    }
    
    /* Table alternative pour mobile */
    .mobile-table {
        display: none;
    }
    
    @media (max-width: 600px) {
        .desktop-table {
            display: none;
        }
        
        .mobile-table {
            display: block;
        }
        
        .mobile-table-item {
            background: #fff;
            border: 1px solid #eee;
            border-radius: 8px;
            padding: 20px;
            margin-bottom: 15px;
        }
    }
}

/* ===== NEWSLETTER POPUP RESPONSIVE ===== */
.newsletter-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.newsletter-popup-content {
    background: #fff;
    border-radius: 10px;
    padding: 40px;
    max-width: 500px;
    width: 100%;
    position: relative;
}

@media (max-width: 767px) {
    .newsletter-popup-content {
        padding: 30px 20px;
        margin: 20px;
        max-width: none;
    }
    
    .newsletter-popup h3 {
        font-size: 24px;
    }
}

/* ===== WISHLIST RESPONSIVE ===== */
.wishlist-products {
    display: grid;
    gap: 20px;
}

@media (max-width: 767px) {
    .wishlist-products {
        grid-template-columns: 1fr;
    }
    
    .wishlist-product-item {
        display: flex;
        gap: 15px;
        padding: 15px;
        border: 1px solid #eee;
        border-radius: 8px;
    }
    
    .wishlist-product-item .product-image {
        width: 80px;
        flex-shrink: 0;
    }
    
    .wishlist-product-item .product-info {
        flex: 1;
    }
    
    .wishlist-product-item .product-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .wishlist-product-item .btn {
        font-size: 12px;
        padding: 8px 12px;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .wishlist-products {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .wishlist-products {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1200px) {
    .wishlist-products[data-columns="4"] {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ===== FOOTER RESPONSIVE ===== */
.footer-content {
    display: grid;
    gap: 30px;
    padding: 40px 0;
}

@media (max-width: 767px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
        text-align: center;
    }
    
    .footer-widget h3 {
        font-size: 18px;
        margin-bottom: 15px;
    }
    
    .footer-widget ul {
        margin-bottom: 20px;
    }
    
    .footer-widget li {
        margin-bottom: 8px;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }
}

@media (min-width: 1024px) {
    .footer-content {
        grid-template-columns: repeat(4, 1fr);
        gap: 40px;
    }
}

/* ===== UTILITAIRES RESPONSIVE ===== */
.hide-mobile {
    display: block;
}

.show-mobile {
    display: none;
}

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

.hide-tablet {
    display: block;
}

.show-tablet {
    display: none;
}

@media (min-width: 768px) and (max-width: 1023px) {
    .hide-tablet {
        display: none;
    }
    
    .show-tablet {
        display: block;
    }
}

.hide-desktop {
    display: block;
}

.show-desktop {
    display: none;
}

@media (min-width: 1024px) {
    .hide-desktop {
        display: none;
    }
    
    .show-desktop {
        display: block;
    }
}

/* ===== ACCESSIBILITÉ ===== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus visible pour la navigation au clavier */
.focus-visible {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* Amélioration du contraste pour les liens */
a:focus,
button:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* ===== PRINT STYLES ===== */
@media print {
    .no-print {
        display: none !important;
    }
    
    .site-header,
    .site-footer,
    .sidebar,
    .cart-drawer,
    .newsletter-popup {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
        color: #000;
        background: #fff;
    }
    
    a {
        color: #000;
        text-decoration: underline;
    }
    
    .container {
        max-width: none;
        padding: 0;
    }
}

