/* Enhanced Mobile Responsiveness - Additional Improvements */

/* Hero Button Mobile Enhancements */
@media (max-width: 768px) {
    .hero-buttons-center {
        flex-direction: column;
        gap: 1rem;
        margin-top: 2rem;
    }
    
    .hero-background .btn-primary,
    .hero-background .btn-secondary {
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
        padding: 1.25rem 2rem;
        font-size: 1rem;
        justify-content: center;
        display: flex;
        align-items: center;
    }
    
    .hero-background .btn-primary i,
    .hero-background .btn-secondary i {
        margin-right: 0.75rem;
    }
}

@media (max-width: 480px) {
    .hero-background .btn-primary,
    .hero-background .btn-secondary {
        max-width: 280px;
        padding: 1rem 1.5rem;
        font-size: 0.95rem;
    }
}

/* About Page Mobile Enhancements */
@media (max-width: 767.98px) {
    /* FAQ Section Improvements */
    .faq-item {
        margin-bottom: 0.75rem;
    }
    
    .faq-question {
        padding: 1rem !important;
        font-size: 1rem;
        line-height: 1.4;
    }
    
    .faq-answer {
        padding: 1rem !important;
        font-size: 0.95rem;
        line-height: 1.5;
    }
    
    /* About Cards Mobile */
    .about-card {
        padding: 1.5rem 1rem;
        margin-bottom: 1rem;
    }
    
    .about-card h3 {
        font-size: 1.25rem;
        margin-bottom: 0.75rem;
    }
    
    .about-card p {
        font-size: 0.95rem;
        line-height: 1.5;
    }
    
    /* Services Grid Mobile */
    .services-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .service-item {
        padding: 1.5rem 1rem;
        text-align: center;
    }
    
    .service-item .service-icon {
        margin-bottom: 1rem;
        font-size: 2.5rem;
    }
    
    .service-item h4 {
        font-size: 1.1rem;
        margin-bottom: 0.75rem;
    }
    
    .service-item p {
        font-size: 0.9rem;
        line-height: 1.4;
    }
}

/* Login/Register Forms Mobile Enhancements */
@media (max-width: 767.98px) {
    .auth-container {
        padding: 1rem;
        margin: 1rem;
        max-width: none;
    }
    
    .auth-form {
        padding: 2rem 1.5rem;
    }
    
    .auth-header h2 {
        font-size: 1.75rem;
        margin-bottom: 0.5rem;
    }
    
    .auth-header p {
        font-size: 0.95rem;
        margin-bottom: 2rem;
    }
    
    .form-group {
        margin-bottom: 1.25rem;
    }
    
    .form-label {
        font-size: 0.95rem;
        margin-bottom: 0.5rem;
    }
    
    .form-input {
        padding: 1rem;
        font-size: 1rem;
        border-radius: var(--radius-md);
    }
    
    .password-toggle {
        right: 1rem;
        top: 50%;
        transform: translateY(-50%);
    }
    
    .btn-auth {
        padding: 1rem;
        font-size: 1.1rem;
        margin-top: 1rem;
    }
    
    .auth-links {
        margin-top: 1.5rem;
        text-align: center;
    }
    
    .auth-links a {
        font-size: 0.95rem;
        padding: 0.5rem 1rem;
    }
    
    /* Password Strength Indicator Mobile */
    .password-strength {
        margin-top: 0.75rem;
    }
    
    .strength-bar {
        height: 6px;
        border-radius: 3px;
    }
    
    .strength-text {
        font-size: 0.85rem;
        margin-top: 0.5rem;
    }
    
    /* Toggle Button Mobile */
    .toggle-container {
        margin: 1.5rem 0;
        padding: 1rem;
        border-radius: var(--radius-md);
    }
    
    .toggle-option {
        padding: 0.75rem 1rem;
        font-size: 0.95rem;
        border-radius: var(--radius-sm);
    }
}

/* Profile Page Mobile Enhancements */
@media (max-width: 767.98px) {
    .profile-container {
        margin: 0.5rem;
    }
    
    .profile-card {
        padding: 2rem 1.5rem;
        margin-bottom: 1rem;
    }
    
    .profile-avatar {
        width: 80px;
        height: 80px;
        margin-bottom: 1rem;
    }
    
    .profile-avatar i {
        font-size: 2rem;
    }
    
    .profile-header h2 {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }
    
    .profile-header p {
        font-size: 0.9rem;
    }
    
    .profile-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.75rem;
        margin-top: 1.5rem;
    }
    
    .stat-card {
        padding: 1rem 0.75rem;
    }
    
    .stat-icon {
        width: 40px;
        height: 40px;
        margin-bottom: 0.75rem;
    }
    
    .stat-icon i {
        font-size: 1rem;
    }
    
    .stat-card h4 {
        font-size: 1rem;
        margin: 0;
    }
    
    .stat-card p {
        font-size: 0.8rem;
        margin: 0;
    }
    
    .account-options {
        margin-top: 1.5rem;
    }
    
    .option-link {
        padding: 1rem;
        margin-bottom: 0.75rem;
    }
    
    .option-icon {
        width: 35px;
        height: 35px;
    }
    
    .option-icon i {
        font-size: 0.9rem;
    }
    
    .option-content h4 {
        font-size: 0.95rem;
        margin: 0;
    }
    
    .option-content p {
        font-size: 0.8rem;
        margin: 0;
    }
}

/* Contact Page Mobile Enhancements */
@media (max-width: 767.98px) {
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .contact-info {
        order: 2;
        padding: 1.5rem;
    }
    
    .contact-form {
        order: 1;
        padding: 1.5rem;
    }
    
    .contact-info-item {
        padding: 1rem;
        margin-bottom: 1rem;
        border-radius: var(--radius-md);
        background: var(--bg-light);
    }
    
    .contact-info-item i {
        font-size: 1.25rem;
        margin-bottom: 0.5rem;
    }
    
    .contact-info-item h4 {
        font-size: 1rem;
        margin-bottom: 0.25rem;
    }
    
    .contact-info-item p {
        font-size: 0.9rem;
        margin: 0;
    }
}

/* Product Pages Mobile Enhancements */
@media (max-width: 767.98px) {
    .product-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .product-gallery {
        order: 1;
    }
    
    .product-info {
        order: 2;
        padding: 1.5rem;
    }
    
    .product-gallery img {
        height: 250px !important;
        border-radius: var(--radius-lg);
    }
    
    .product-title {
        font-size: 1.5rem;
        text-align: center;
        margin-bottom: 1rem;
    }
    
    .product-price {
        font-size: 1.75rem;
        text-align: center;
        margin-bottom: 1.5rem;
    }
    
    .product-description {
        font-size: 0.95rem;
        line-height: 1.5;
        margin-bottom: 2rem;
    }
    
    .product-actions {
        flex-direction: column;
        gap: 1rem;
    }
    
    .btn-product {
        width: 100%;
        padding: 1rem;
        font-size: 1.1rem;
    }
    
    /* Products Grid Mobile */
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
        padding: 0 0.5rem;
    }
    
    .product-card {
        padding: 1rem;
    }
    
    .product-card-image {
        height: 150px;
        margin-bottom: 0.75rem;
    }
    
    .product-card h3 {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }
    
    .product-card .price {
        font-size: 1.1rem;
        margin-bottom: 0.75rem;
    }
    
    .product-card .btn {
        padding: 0.75rem;
        font-size: 0.9rem;
    }
}

/* Navigation Mobile Enhancements */
@media (max-width: 767.98px) {
    .modern-navbar {
        padding: 0.75rem 0;
    }
    
    .navbar-container {
        padding: 0 1rem;
    }
    
    .mobile-toggle {
        padding: 0.5rem;
        background: var(--bg-light);
        border-radius: var(--radius-sm);
    }
    
    .mobile-toggle span {
        width: 25px;
        height: 3px;
        margin: 5px 0;
    }
    
    .nav-menu.active {
        padding: 1rem;
        border-radius: var(--radius-lg);
        box-shadow: var(--shadow-xl);
    }
    
    .nav-link {
        padding: 1rem;
        margin-bottom: 0.5rem;
        border-radius: var(--radius-md);
        font-size: 1.05rem;
        text-align: center;
    }
    
    .nav-link:hover,
    .nav-link:focus {
        background: var(--primary-light);
        color: var(--primary-color);
    }
}

/* Footer Mobile Enhancements */
@media (max-width: 767.98px) {
    .footer {
        padding: 2rem 0 1rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        text-align: center;
    }
    
    .footer-section h3 {
        font-size: 1.1rem;
        margin-bottom: 1rem;
    }
    
    .footer-section p,
    .footer-section a {
        font-size: 0.9rem;
        line-height: 1.5;
    }
    
    .footer-bottom {
        padding: 1rem 0;
        text-align: center;
    }
    
    .footer-bottom p {
        font-size: 0.85rem;
        margin: 0;
    }
}

/* Loading States Mobile */
@media (max-width: 767.98px) {
    .loading-container {
        padding: 2rem 1rem;
    }
    
    .loading-spinner {
        width: 50px;
        height: 50px;
        margin-bottom: 1rem;
    }
    
    .loading-text {
        font-size: 0.95rem;
    }
    
    /* Button Loading States */
    .btn.loading {
        pointer-events: none;
        opacity: 0.7;
    }
    
    .btn.loading::after {
        content: '';
        width: 16px;
        height: 16px;
        margin-left: 0.5rem;
        border: 2px solid transparent;
        border-top: 2px solid currentColor;
        border-radius: 50%;
        animation: spin 1s linear infinite;
        display: inline-block;
    }
}

/* Message Alerts Mobile */
@media (max-width: 767.98px) {
    .alert {
        margin: 0.5rem;
        padding: 1rem;
        border-radius: var(--radius-md);
        font-size: 0.95rem;
    }
    
    .alert-success {
        background: var(--success-light);
        color: var(--success-color);
        border: 1px solid var(--success-color);
    }
    
    .alert-warning {
        background: var(--warning-light);
        color: var(--warning-color);
        border: 1px solid var(--warning-color);
    }
    
    .alert-error {
        background: var(--error-light);
        color: var(--error-color);
        border: 1px solid var(--error-color);
    }
    
    .alert-info {
        background: var(--info-light);
        color: var(--info-color);
        border: 1px solid var(--info-color);
    }
}

/* Touch Optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets */
    .btn,
    .nav-link,
    button,
    .form-input,
    .faq-question {
        min-height: 48px;
        min-width: 48px;
    }
    
    /* Remove hover effects */
    .card:hover,
    .btn:hover,
    .nav-link:hover {
        transform: none;
        box-shadow: var(--shadow-md);
    }
    
    /* Tap highlight color */
    .btn,
    .nav-link,
    button {
        -webkit-tap-highlight-color: rgba(var(--primary-rgb), 0.2);
    }
}

/* Utility Classes for Mobile */
@media (max-width: 767.98px) {
    .mobile-hidden {
        display: none !important;
    }
    
    .mobile-only {
        display: block !important;
    }
    
    .mobile-center {
        text-align: center !important;
    }
    
    .mobile-full-width {
        width: 100% !important;
    }
    
    .mobile-no-margin {
        margin: 0 !important;
    }
    
    .mobile-small-padding {
        padding: 0.75rem !important;
    }
    
    .mobile-large-padding {
        padding: 1.5rem !important;
    }
}

/* Dark mode mobile adjustments */
@media (max-width: 767.98px) and (prefers-color-scheme: dark) {
    .form-input {
        background: var(--bg-secondary);
        color: var(--text-primary);
        border-color: var(--border-color);
    }
    
    .card {
        background: var(--bg-secondary);
        border-color: var(--border-color);
    }
    
    .nav-menu.active {
        background: var(--bg-secondary);
        border-color: var(--border-color);
    }
}

/* Performance optimizations for mobile */
@media (max-width: 767.98px) {
    * {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }
    
    .card,
    .btn,
    .form-input {
        will-change: transform;
    }
    
    /* Reduce animations on slower devices */
    @media (prefers-reduced-motion: reduce) {
        *,
        *::before,
        *::after {
            animation-duration: 0.01ms !important;
            animation-iteration-count: 1 !important;
            transition-duration: 0.01ms !important;
        }
    }
}
