/* ========================================
   MOBILE FIXES FOR ELIXOR MEDICAL
   Add this to your WordPress theme
   ======================================== */

/* ===== FIX 1: Mobile Navigation Menu ===== */
@media screen and (max-width: 968px) {
    /* Make sure nav toggle button is visible and clickable */
    .nav-toggle {
        display: flex !important;
        flex-direction: column;
        justify-content: space-around;
        width: 30px;
        height: 25px;
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 0;
        z-index: 1001;
        position: relative;
    }
    
    .nav-toggle span {
        width: 100%;
        height: 3px;
        background: var(--primary-gold, #D4AF37);
        border-radius: 10px;
        transition: all 0.3s ease;
        display: block;
    }
    
    /* Animate hamburger to X when active */
    .nav-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(8px, 8px);
    }
    
    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
        transform: translateX(-20px);
    }
    
    .nav-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(8px, -8px);
    }
    
    /* Mobile Menu Styles */
    .nav-menu,
    ul.nav-menu {
        position: fixed !important;
        top: 80px;
        right: -100%;
        width: 280px;
        height: calc(100vh - 80px);
        background: rgba(0, 0, 0, 0.98);
        backdrop-filter: blur(10px);
        flex-direction: column;
        padding: 30px 20px;
        gap: 0;
        transition: right 0.4s ease;
        overflow-y: auto;
        z-index: 999;
        box-shadow: -5px 0 20px rgba(0, 0, 0, 0.5);
        border-left: 2px solid var(--primary-gold, #D4AF37);
    }
    
    /* Show menu when active */
    .nav-menu.active,
    ul.nav-menu.active {
        right: 0 !important;
    }
    
    /* Mobile menu items */
    .nav-menu li {
        width: 100%;
        margin: 0;
        padding: 0;
        list-style: none;
        border-bottom: 1px solid rgba(212, 175, 55, 0.2);
    }
    
    .nav-menu li:last-child {
        border-bottom: none;
    }
    
    .nav-menu a {
        display: block;
        padding: 15px 20px;
        color: var(--white, #ffffff) !important;
        text-decoration: none;
        font-size: 16px;
        font-weight: 500;
        transition: all 0.3s ease;
        border-left: 3px solid transparent;
    }
    
    .nav-menu a:hover,
    .nav-menu a.active {
        background: rgba(212, 175, 55, 0.1);
        border-left-color: var(--primary-gold, #D4AF37);
        transform: translateX(5px);
    }
    
    .nav-menu .btn-gold {
        margin-top: 20px;
        background: var(--primary-gold, #D4AF37);
        color: var(--black, #000000) !important;
        border-radius: 5px;
        text-align: center;
        font-weight: 600;
        border-left: none !important;
    }
    
    .nav-menu .btn-gold:hover {
        background: var(--gold-light, #FFD700);
        transform: translateX(0) scale(1.05);
    }
}

/* ===== FIX 2: AMC Packages Mobile Alignment ===== */
@media screen and (max-width: 768px) {
    /* AMC Packages Section - Service Detail Page */
    .service-features ul.feature-list {
        padding-left: 0 !important;
        margin: 20px 0;
    }
    
    .service-features ul.feature-list li {
        display: flex;
        align-items: flex-start;
        padding: 12px 15px;
        margin-bottom: 12px;
        background: rgba(212, 175, 55, 0.05);
        border-radius: 8px;
        border-left: 3px solid var(--primary-gold, #D4AF37);
        font-size: 14px;
        line-height: 1.6;
        word-wrap: break-word;
    }
    
    .service-features ul.feature-list li i {
        color: var(--primary-gold, #D4AF37);
        margin-right: 12px;
        font-size: 16px;
        flex-shrink: 0;
        margin-top: 2px;
    }
    
    .service-features ul.feature-list li strong {
        display: block;
        margin-bottom: 4px;
        color: var(--black, #000000);
    }
    
    /* Fix PPM, CM, AMC content alignment */
    .service-content {
        flex-direction: column !important;
        padding: 20px 15px;
    }
    
    .service-content-text,
    .service-content-image {
        width: 100% !important;
        margin-bottom: 30px;
    }
    
    .service-content-text h2 {
        font-size: 24px;
        line-height: 1.3;
        margin-bottom: 15px;
        word-wrap: break-word;
    }
    
    .service-content-text p {
        font-size: 15px;
        line-height: 1.7;
        margin-bottom: 20px;
        text-align: justify;
    }
    
    /* Image placeholders on mobile */
    .service-content-image .image-placeholder {
        padding: 60px 20px;
        min-height: 250px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }
}

/* ===== FIX 3: Service Excellence Section (Black Background) ===== */
@media screen and (max-width: 768px) {
    /* Fix "Why Choose Our Services" section visibility */
    .service-benefits-grid,
    .why-choose .why-grid,
    .features-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 20px 15px;
    }
    
    .benefit-card,
    .why-item,
    .feature-item {
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(212, 175, 55, 0.3);
        border-radius: 12px;
        padding: 25px 20px;
        text-align: center;
        transition: all 0.3s ease;
    }
    
    .benefit-card i,
    .why-item i,
    .feature-item i {
        font-size: 40px;
        color: var(--primary-gold, #D4AF37);
        margin-bottom: 15px;
        display: block;
    }
    
    .benefit-card h3,
    .why-item h3,
    .feature-item h3 {
        color: var(--white, #ffffff);
        font-size: 18px;
        font-weight: 600;
        margin-bottom: 10px;
        line-height: 1.3;
    }
    
    .benefit-card p,
    .why-item p,
    .feature-item p {
        color: rgba(255, 255, 255, 0.85);
        font-size: 14px;
        line-height: 1.6;
    }
    
    /* Section dark background text contrast */
    .section-dark,
    .section.section-dark {
        background: var(--black, #000000);
        color: var(--white, #ffffff);
        padding: 60px 0;
    }
    
    .section-dark .section-title,
    .section-dark h2 {
        color: var(--white, #ffffff);
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    }
    
    .section-dark .section-subtitle {
        color: var(--primary-gold, #D4AF37);
    }
}

/* ===== FIX 4: Better "Reasons to Trust" Section Design ===== */
@media screen and (max-width: 768px) {
    /* Redesign numbered reasons section */
    .reasons-grid,
    .values-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 0 15px;
    }
    
    .reason-item,
    .value-card {
        position: relative;
        background: linear-gradient(135deg, rgba(212, 175, 55, 0.1) 0%, rgba(255, 215, 0, 0.05) 100%);
        border-radius: 15px;
        padding: 30px 25px;
        border: 2px solid var(--primary-gold, #D4AF37);
        box-shadow: 0 5px 20px rgba(212, 175, 55, 0.15);
        transition: all 0.3s ease;
        overflow: hidden;
    }
    
    .reason-item:hover,
    .value-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 10px 30px rgba(212, 175, 55, 0.3);
        border-color: var(--gold-light, #FFD700);
    }
    
    /* Replace old number style */
    .reason-item .reason-number {
        position: absolute;
        top: -10px;
        right: 20px;
        font-size: 80px;
        font-weight: 800;
        color: rgba(212, 175, 55, 0.15);
        line-height: 1;
        font-family: var(--font-secondary, 'Playfair Display', serif);
    }
    
    /* Add icon instead of number */
    .reason-item::before,
    .value-card .value-icon {
        content: '';
        display: block;
        width: 60px;
        height: 60px;
        background: linear-gradient(135deg, var(--primary-gold, #D4AF37), var(--gold-light, #FFD700));
        border-radius: 50%;
        margin-bottom: 20px;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 5px 15px rgba(212, 175, 55, 0.4);
    }
    
    .value-icon {
        font-size: 28px;
        color: var(--black, #000000);
        width: 60px;
        height: 60px;
        display: flex;
        align-items: center;
        justify-content: center;
        margin: 0 auto 20px;
    }
    
    .reason-item h3,
    .value-card h3 {
        font-size: 20px;
        font-weight: 700;
        color: var(--black, #000000);
        margin-bottom: 12px;
        line-height: 1.3;
        position: relative;
        z-index: 1;
    }
    
    .reason-item p,
    .value-card p {
        font-size: 15px;
        line-height: 1.7;
        color: var(--text-dark, #333333);
        position: relative;
        z-index: 1;
        margin: 0;
    }
    
    /* Decorative line */
    .reason-item::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 4px;
        background: linear-gradient(90deg, var(--primary-gold, #D4AF37), transparent);
    }
}

/* ===== Additional Mobile Optimizations ===== */
@media screen and (max-width: 768px) {
    /* Container padding */
    .container {
        padding: 0 20px;
    }
    
    /* Section spacing */
    .section {
        padding: 50px 0;
    }
    
    /* Hero section mobile */
    .hero {
        min-height: 70vh;
        padding: 100px 0 50px;
    }
    
    .hero-title {
        font-size: 32px;
    }
    
    /* Buttons mobile */
    .btn,
    .product-btn,
    .service-link {
        padding: 12px 24px;
        font-size: 14px;
        display: inline-block;
        width: auto;
        min-width: 150px;
    }
    
    /* CTA Section */
    .cta-content h2 {
        font-size: 24px;
        line-height: 1.3;
        margin-bottom: 15px;
    }
    
    .cta-buttons {
        flex-direction: column;
        gap: 15px;
    }
    
    .cta-buttons .btn {
        width: 100%;
        text-align: center;
    }
    
    /* Portfolio grid mobile */
    .portfolio-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    /* Testimonials mobile */
    .testimonials-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    /* Footer mobile */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    /* Statistics mobile */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .stat-number {
        font-size: 36px;
    }
}

/* ===== Extra Small Devices ===== */
@media screen and (max-width: 480px) {
    .nav-menu {
        width: 100%;
        right: -100%;
    }
    
    .nav-menu.active {
        right: 0 !important;
    }
    
    .hero-title {
        font-size: 28px;
    }
    
    .section-title {
        font-size: 26px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== Accessibility & Touch Targets ===== */
@media screen and (max-width: 768px) {
    /* Ensure touch targets are at least 44x44px */
    button,
    .btn,
    .nav-menu a,
    .nav-toggle {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Improve text readability */
    body {
        font-size: 15px;
        line-height: 1.7;
    }
    
    /* Prevent horizontal scroll */
    body,
    html {
        overflow-x: hidden;
        max-width: 100vw;
    }
}
