/* ============================================
   MOBILE PRODUCT PAGE OPTIMIZATIONS
   ============================================ */

/* LAYOUT VERTICAL DES OPTIONS - TOUTES TAILLES D'ÉCRAN */
/* CORRECTION ROBUSTE: Override des styles inline pour forcer le layout vertical */
.toggle-options-grid[style*="display: grid"],
.toggle-options-grid[style*="grid-template-columns"],
.toggle-options-grid[style] {
    display: flex !important;
    flex-direction: column !important;
    grid-template-columns: unset !important;
    gap: 20px !important;
    max-width: 600px !important;
    margin: 0 auto !important;
}

.toggle-options-grid {
    display: flex !important;
    flex-direction: column !important;
    grid-template-columns: none !important;
    gap: 20px !important;
    max-width: 600px !important;
    margin: 0 auto !important;
}

/* RÈGLE ULTRA-SPÉCIFIQUE pour override complet */
div[style*="display: grid"][style*="grid-template-columns"].toggle-options-grid {
    display: flex !important;
    flex-direction: column !important;
    grid-template-columns: unset !important;
}

/* Masquer les caractéristiques et images ajoutées - TOUTES TAILLES */
.option-image-container {
    display: none !important;
}

/* Mobile optimizations for product page */
@media screen and (max-width: 768px) {
    /* Header fixes */
    .header {
        position: sticky;
        top: 0;
        z-index: 1000;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        padding: 10px 0;
    }

    .header-container {
        padding: 0 15px;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .logo-image {
        height: 40px !important;
        width: auto;
    }

    /* Cart button mobile optimization */
    .nav-right {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .cart-icon {
        width: 40px !important;
        height: 40px !important;
        padding: 8px !important;
        background: var(--accent-ice);
        color: white;
        border-radius: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 16px;
        position: relative;
    }

    .cart-count {
        position: absolute;
        top: -8px;
        right: -8px;
        background: #e74c3c;
        color: white;
        border-radius: 50%;
        width: 20px;
        height: 20px;
        font-size: 12px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: bold;
    }

    /* Mobile menu toggle */
    .mobile-toggle {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        width: 30px;
        height: 30px;
        background: none;
        border: none;
        cursor: pointer;
        padding: 0;
    }

    .mobile-toggle span {
        display: block;
        width: 22px;
        height: 2px;
        background: #333;
        margin: 2px 0;
        transition: 0.3s;
    }

    /* Product hero section */
    .product-hero {
        padding: 80px 0 40px;
    }

    .product-hero-grid {
        display: block;
        gap: 0;
    }

    /* Gallery optimization */
    .product-gallery {
        margin-bottom: 30px;
        position: relative !important; /* Force non-sticky on mobile */
    }

    .main-image-container {
        border-radius: 12px;
        margin-bottom: 15px;
        box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    }

    .thumbnail-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 8px;
    }

    .thumbnail {
        height: 60px;
        border-radius: 6px;
    }

    /* Product title and rating */
    .product-name {
        font-size: 1.8rem !important;
        line-height: 1.2;
        margin-bottom: 15px;
        text-align: center;
    }

    .product-rating {
        margin-bottom: 20px;
        text-align: center;
    }

    /* Configuration sections */
    .product-configuration {
        margin-bottom: 30px;
    }

    .configuration-section {
        background: white;
        border-radius: 12px;
        padding: 20px;
        margin-bottom: 20px;
        box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    }

    .configuration-section h3 {
        font-size: 1.3rem !important;
        margin-bottom: 15px;
        color: #333;
    }

    /* Chiller selection cards */
    .chiller-option {
        border-radius: 12px !important;
        margin-bottom: 15px !important;
        padding: 20px !important;
        border: 2px solid #f0f0f0 !important;
        transition: all 0.3s ease !important;
    }

    .chiller-option.selected {
        border-color: var(--accent-ice) !important;
        background: rgba(93, 173, 226, 0.05) !important;
    }

    .chiller-option img {
        max-height: 120px !important;
        width: auto !important;
        margin: 0 auto 15px auto !important;
        display: block !important;
    }

    .chiller-option h4 {
        font-size: 1.2rem !important;
        margin-bottom: 10px !important;
        text-align: center;
    }

    .chiller-option p {
        font-size: 0.9rem !important;
        text-align: center;
        margin-bottom: 15px;
    }

    .chiller-option .accessory-list {
        font-size: 0.85rem !important;
    }

    .chiller-option .price {
        font-size: 1.3rem !important;
        font-weight: bold;
        color: var(--accent-ice);
        text-align: center;
        margin-top: 15px;
    }

    /* Options section */
    .options-grid {
        display: block !important;
    }

    .option-item {
        margin-bottom: 15px !important;
        padding: 15px !important;
        border-radius: 8px !important;
        background: #f8f9fa !important;
    }

    /* Options Additionnelles Disponibles - MOBILE UNIQUEMENT */

    /* Masquer les caractéristiques et images dans les options additionnelles */
    .toggle-options-grid .option-image-container,
    .toggle-options-grid img,
    .toggle-options-grid h5,
    .toggle-options-grid ul {
        display: none !important;
    }

    .toggle-option-card {
        margin-bottom: 15px !important;
        background: #f8f9fa !important;
        border-radius: 10px !important;
        padding: 15px !important;
    }

    /* Layout mobile : titre + prix + toggle sur la même ligne */
    /* Forcer l'alignement correct pour chaque carte d'option */
    .toggle-option-card {
        display: flex !important;
        flex-direction: column !important;
        padding: 12px 15px !important;
        margin-bottom: 10px !important;
        background: #f8f9fa !important;
        border-radius: 8px !important;
    }

    /* Container principal de chaque option - flex horizontal */
    .toggle-option-card > div[style*="display: flex"] {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        width: 100% !important;
        min-height: 40px !important;
        gap: 8px !important;
    }

    /* Container du titre et prix (div interne) */
    .toggle-option-card div[style*="justify-content: space-between"] {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: flex-start !important;
        flex: 1 !important;
        gap: 10px !important;
        min-width: 0 !important;
    }

    /* Titre des options - style compact */
    .toggle-option-card h4.option-title {
        margin: 0 !important;
        font-size: 0.9rem !important;
        font-weight: 500 !important;
        color: #333 !important;
        flex: 0 1 auto !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        max-width: 140px !important;
    }

    /* Prix des options - style compact */
    .toggle-option-card span:not(.toggle-switch *) {
        font-size: 0.85rem !important;
        font-weight: 600 !important;
        color: #4A90E2 !important;
        margin: 0 !important;
        white-space: nowrap !important;
        flex-shrink: 0 !important;
    }

    /* Toggle switch - position fixe à droite */
    .toggle-option-card .toggle-switch {
        flex-shrink: 0 !important;
        margin: 0 !important;
        margin-left: auto !important;
        width: 50px !important;
        height: 24px !important;
    }

    .toggle-option-card .option-toggle {
        margin: 0 !important;
    }

    /* Masquer complètement le contenu des caractéristiques et images */
    .toggle-option-card div[style*="display: none"] {
        display: none !important;
    }

    /* Exclusive offers */
    .exclusive-offers {
        margin: 30px 0;
    }

    .pack-offer {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
        border-radius: 12px !important;
        padding: 25px !important;
        margin-bottom: 20px !important;
        color: white !important;
    }

    .pack-offer h4 {
        font-size: 1.3rem !important;
        margin-bottom: 15px !important;
        text-align: center;
    }

    .pack-offer .pack-content {
        display: block !important;
    }

    .pack-offer ul {
        margin-bottom: 20px !important;
    }

    .pack-offer li {
        font-size: 0.9rem !important;
        margin-bottom: 8px !important;
    }

    .pack-offer .pack-pricing {
        text-align: center !important;
        margin-bottom: 20px !important;
    }

    .pack-offer .original-price {
        font-size: 0.9rem !important;
        text-decoration: line-through !important;
        opacity: 0.8 !important;
    }

    .pack-offer .final-price {
        font-size: 1.5rem !important;
        font-weight: bold !important;
    }

    /* CORRECTION ROBUSTE: Forcer l'affichage vertical des offres exclusives sur mobile */
    .exclusive-offer-section > div[style*="display: grid"][style*="grid-template-columns"] {
        display: flex !important;
        flex-direction: column !important;
        gap: 25px !important;
        max-width: 400px !important;
        margin: 0 auto !important;
        grid-template-columns: unset !important;
    }

    /* Correction des badges -105€ sur mobile */
    .exclusive-offer-section [style*="position: absolute"][style*="top: -3px"] {
        top: 8px !important;
        right: 8px !important;
        transform: rotate(45deg) !important;
        padding: 4px 20px !important;
        font-size: 0.7rem !important;
        font-weight: bold !important;
        background: #ff4757 !important;
        color: white !important;
        border-radius: 2px !important;
        white-space: nowrap !important;
        z-index: 10 !important;
    }
    /* CTA Buttons - MOST IMPORTANT */
    .btn-primary,
    .btn-primary-xl,
    .cta-btn,
    .add-to-cart-btn,
    button[type="submit"] {
        width: 100% !important;
        padding: 16px 20px !important;
        font-size: 1.1rem !important;
        font-weight: 600 !important;
        border-radius: 12px !important;
        border: none !important;
        background: linear-gradient(135deg, var(--accent-ice) 0%, var(--accent-deep) 100%) !important;
        color: white !important;
        text-align: center !important;
        margin: 10px 0 !important;
        cursor: pointer !important;
        transition: all 0.3s ease !important;
        box-shadow: 0 4px 15px rgba(93, 173, 226, 0.3) !important;
        text-decoration: none !important;
        display: block !important;
        touch-action: manipulation !important;
        min-height: 50px !important;
    }

    .btn-primary:hover,
    .btn-primary-xl:hover,
    .cta-btn:hover,
    .add-to-cart-btn:hover {
        transform: translateY(-2px) !important;
        box-shadow: 0 6px 20px rgba(93, 173, 226, 0.4) !important;
    }

    .btn-secondary,
    .btn-outline {
        width: 100% !important;
        padding: 14px 20px !important;
        font-size: 1rem !important;
        border: 2px solid var(--accent-ice) !important;
        background: transparent !important;
        color: var(--accent-ice) !important;
        border-radius: 10px !important;
        margin: 10px 0 !important;
        text-decoration: none !important;
        display: block !important;
        text-align: center !important;
        transition: all 0.3s ease !important;
        min-height: 46px !important;
    }

    .btn-secondary:hover,
    .btn-outline:hover {
        background: var(--accent-ice) !important;
        color: white !important;
    }

    /* Configuration summary */
    .configuration-summary {
        background: #f8f9fa;
        border-radius: 12px;
        padding: 20px;
        margin: 30px 0;
        border: 1px solid #e9ecef;
    }

    .configuration-summary h3 {
        font-size: 1.3rem !important;
        margin-bottom: 20px;
        text-align: center;
        color: #333;
    }

    .summary-item {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 12px 8px;
        border-bottom: 1px solid #e9ecef;
        font-size: 0.9rem;
        gap: 12px;
    }

    .summary-item-name {
        flex: 1;
        font-size: 0.9rem;
        line-height: 1.3;
        max-width: 65%;
    }

    .summary-item-price {
        font-size: 0.9rem;
        font-weight: 600;
        white-space: nowrap;
        flex-shrink: 0;
    }

    .summary-item:last-child {
        border-bottom: none;
        font-weight: bold;
        font-size: 1.1rem;
        padding-top: 20px;
        margin-top: 10px;
        border-top: 2px solid #e9ecef;
    }

    .summary-total {
        font-size: 1.4rem !important;
        color: var(--accent-ice);
    }

    /* Points forts section */
    .product-highlights {
        margin: 30px 0;
        padding: 20px;
        background: white;
        border-radius: 12px;
        box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    }

    .product-highlights h3 {
        font-size: 1.3rem !important;
        margin-bottom: 20px;
        text-align: center;
        color: #333;
    }

    .product-highlights ul {
        list-style: none;
        padding: 0;
    }

    .product-highlights li {
        padding: 10px 0;
        font-size: 0.95rem;
        display: flex;
        align-items: flex-start;
        gap: 10px;
    }

    .product-highlights li::before {
        content: "✓";
        color: #28a745;
        font-weight: bold;
        font-size: 1.1rem;
        flex-shrink: 0;
    }

    /* Tab system */
    .tab-buttons {
        display: flex;
        background: #f8f9fa;
        border-radius: 8px;
        padding: 4px;
        margin-bottom: 20px;
        overflow-x: auto;
        gap: 0;
    }

    .tab-btn {
        flex: 1;
        padding: 12px 8px !important;
        font-size: 0.8rem !important;
        border: none;
        background: transparent;
        color: #666;
        border-radius: 6px;
        cursor: pointer;
        transition: all 0.3s ease;
        white-space: nowrap;
        min-width: 0;
        text-align: center;
    }

    .tab-btn.active {
        background: white;
        color: var(--accent-ice);
        font-weight: 600;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }

    /* Tab content */
    .tab-panel {
        padding: 20px 0;
        line-height: 1.6;
    }

    .tab-panel h3 {
        font-size: 1.2rem !important;
        margin-bottom: 15px;
    }

    .tab-panel p {
        font-size: 0.95rem;
        margin-bottom: 15px;
    }

    .tab-panel ul {
        padding-left: 0;
        list-style: none;
    }

    .tab-panel li {
        padding: 8px 0;
        font-size: 0.9rem;
        display: flex;
        align-items: flex-start;
        gap: 8px;
    }

    .tab-panel li::before {
        content: "•";
        color: var(--accent-ice);
        font-weight: bold;
        flex-shrink: 0;
    }

    /* Reviews section */
    .reviews-grid {
        display: block !important;
    }

    .review-card {
        margin-bottom: 20px !important;
        padding: 20px !important;
        border-radius: 12px !important;
        background: #f8f9fa !important;
        border: 1px solid #e9ecef !important;
    }

    .review-card .reviewer-info {
        margin-bottom: 15px !important;
    }

    .review-card .review-text {
        font-size: 0.95rem !important;
        line-height: 1.6 !important;
    }

    /* Final CTA section */
    .final-cta {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        padding: 40px 20px;
        border-radius: 15px;
        margin: 40px 0;
        text-align: center;
        color: white;
    }

    .final-cta h2 {
        font-size: 1.5rem !important;
        margin-bottom: 15px;
    }

    .final-cta p {
        font-size: 1rem;
        margin-bottom: 30px;
        opacity: 0.9;
    }

    .final-cta .cta-buttons {
        display: flex;
        flex-direction: column;
        gap: 15px;
    }

    .final-cta .btn-white {
        background: white !important;
        color: var(--accent-deep) !important;
        padding: 16px 20px !important;
        border-radius: 10px !important;
        font-weight: 600 !important;
        text-decoration: none !important;
        display: block !important;
    }

    .final-cta .guarantee-features {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px;
        margin-top: 30px;
    }

    .final-cta .feature-item {
        display: flex;
        align-items: center;
        gap: 8px;
        font-size: 0.9rem;
        opacity: 0.9;
    }

    /* Container and spacing fixes */
    .container {
        padding: 0 15px !important;
        max-width: 100% !important;
        margin: 0 auto !important;
    }

    section {
        padding: 30px 0 !important;
    }

    /* Typography adjustments */
    h1 { font-size: 1.8rem !important; line-height: 1.2 !important; }
    h2 { font-size: 1.5rem !important; line-height: 1.3 !important; }
    h3 { font-size: 1.3rem !important; line-height: 1.3 !important; }
    h4 { font-size: 1.1rem !important; line-height: 1.4 !important; }
    p { font-size: 0.95rem !important; line-height: 1.6 !important; }

    /* Force proper text wrapping */
    * {
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        hyphens: auto !important;
    }

    /* Hide desktop-only elements */
    .desktop-only {
        display: none !important;
    }

    /* Show mobile-only elements */
    .mobile-only {
        display: block !important;
    }

    /* Footer adjustments */
    footer {
        padding: 30px 0 !important;
    }

    .footer-content {
        display: block !important;
        text-align: center !important;
    }

    /* Footer logo visibility fix */
    .footer-logo {
        height: 60px !important;
        width: auto !important;
        filter: none !important; /* Remove invert filter for better visibility */
        opacity: 1 !important;
        margin: 0 auto 15px auto !important;
        display: block !important;
    }

    .footer-links {
        margin-bottom: 30px !important;
    }

    .footer-links h4 {
        font-size: 1.1rem !important;
        margin-bottom: 15px !important;
    }

    .footer-links ul {
        list-style: none;
        padding: 0;
    }

    .footer-links li {
        margin-bottom: 10px;
    }

    .footer-links a {
        color: #666;
        text-decoration: none;
        font-size: 0.9rem;
    }

    /* Points forts - Centrage forcé sur mobile */
    .key-features {
        text-align: center !important;
        margin: 30px auto !important;
        max-width: 400px !important;
    }

    .key-features h3 {
        text-align: center !important;
        margin-bottom: 20px !important;
        font-size: 1.3rem !important;
    }

    .key-features ul {
        text-align: left !important;
        display: inline-block !important;
        margin: 0 auto !important;
        padding: 0 !important;
        list-style: none !important;
    }

    .key-features li {
        margin-bottom: 12px !important;
        font-size: 0.95rem !important;
        display: flex !important;
        align-items: flex-start !important;
        gap: 10px !important;
    }

    .key-features li i {
        color: var(--accent-ice) !important;
        margin-top: 3px !important;
        width: 20px !important;
        flex-shrink: 0 !important;
    }
}

/* Extra small devices (phones, 350px and down) */
@media screen and (max-width: 350px) {
    .tab-btn {
        font-size: 0.7rem !important;
        padding: 10px 4px !important;
    }

    .product-name {
        font-size: 1.6rem !important;
    }

    .thumbnail-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}