/* ===== RESPONSIVE DESIGN ENHANCEMENTS ===== */

/* Large Desktop (1200px and up) */
@media (min-width: 1200px) {
    .container {
        max-width: 1400px;
    }
    
    .hero-title {
        font-size: 4rem;
    }
    
    .section-title {
        font-size: 3rem;
    }
}

/* Medium Desktop (992px to 1199px) */
@media (max-width: 1199px) and (min-width: 992px) {
    .hero-title {
        font-size: 3rem;
    }
    
    .about-content,
    .about-us-content,
    .contact-content {
        gap: 3rem;
    }
    
    .about-content {
        justify-content: center;
        align-items: center;
    }
    
    .about-text-centered {
        max-width: 100%;
        padding: 0 20px;
    }
}

/* Tablet Landscape (768px to 991px) */
@media (max-width: 991px) and (min-width: 768px) {
    .hero-title {
        font-size: 2.8rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .about-content,
    .about-us-content,
    .contact-content {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    
    .about-content {
        justify-content: center;
        align-items: center;
    }
    
    .about-text-centered {
        max-width: 100%;
        padding: 0 20px;
    }
    
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .floating-card {
        padding: 1.5rem;
    }
    
    .floating-card i {
        font-size: 2.5rem;
    }
    
    .floating-card h3 {
        font-size: 1.3rem;
    }
}

/* Tablet Portrait (481px to 767px) */
@media (max-width: 767px) and (min-width: 481px) {
    .hero-title {
        font-size: 2.2rem;
    }
    
    .hero-text-centered {
        max-width: 100%;
        padding: 0 20px;
    }
    
    .about-text-centered {
        max-width: 100%;
        padding: 0 20px;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .about-card,
    .contact-card {
        padding: 1.5rem;
    }
    
    .product-content {
        padding: 1.5rem;
    }
    
    .floating-card {
        padding: 1rem;
    }
    
    .floating-card i {
        font-size: 2rem;
    }
    
    .floating-card h3 {
        font-size: 1.1rem;
    }
    
    .stats {
        flex-direction: column;
        gap: 1rem;
    }
    
    .stat-item {
        text-align: center;
    }
    
    .image-stack {
        height: 300px;
    }
    
    .stack-image {
        width: 90%;
        height: 150px;
    }
}

/* Mobile Large (375px to 480px) */
@media (max-width: 480px) and (min-width: 375px) {
    .container {
        padding: 0 10px;
    }
    
    .hero-title {
        font-size: 1.8rem;
        line-height: 1.3;
    }
    
    .hero-text-centered {
        max-width: 100%;
        padding: 0 15px;
    }
    
    .hero-subtitle {
        font-size: 0.9rem;
    }
    
    .section-title {
        font-size: 1.6rem;
    }
    
    .section-subtitle {
        font-size: 1rem;
    }
    
    .btn {
        padding: 10px 18px;
        font-size: 0.85rem;
    }
    
    .about-card,
    .contact-card,
    .story-card,
    .mission-card,
    .vision-card {
        padding: 1.2rem;
    }
    
    .product-content {
        padding: 1.2rem;
    }
    
    .card-icon {
        width: 50px;
        height: 50px;
    }
    
    .card-icon i {
        font-size: 1.2rem;
    }
    
    .floating-card {
        padding: 0.8rem;
    }
    
    .floating-card i {
        font-size: 1.8rem;
    }
    
    .floating-card h3 {
        font-size: 1rem;
    }
    
    .floating-card p {
        font-size: 0.8rem;
    }
    
    .image-stack {
        height: 250px;
    }
    
    .stack-image {
        width: 95%;
        height: 120px;
    }
    
    .contact-form-container {
        padding: 1.5rem;
    }
    
    .form-group input,
    .form-group textarea {
        padding: 10px 12px;
        font-size: 0.9rem;
    }
    
    .products-cta {
        padding: 2rem 1.5rem;
    }
    
    .products-cta h3 {
        font-size: 1.5rem;
    }
    
    .footer-content {
        gap: 1.5rem;
    }
    
    .footer-section {
        text-align: center;
    }
}

/* Mobile Small (320px to 374px) */
@media (max-width: 374px) {
    .container {
        padding: 0 8px;
    }
    
    .hero-title {
        font-size: 1.6rem;
    }
    
    .hero-text-centered {
        max-width: 100%;
        padding: 0 10px;
    }
    
    .hero-subtitle {
        font-size: 0.85rem;
    }
    
    .section-title {
        font-size: 1.4rem;
    }
    
    .section-subtitle {
        font-size: 0.9rem;
    }
    
    .btn {
        padding: 8px 16px;
        font-size: 0.8rem;
    }
    
    .about-card,
    .contact-card,
    .story-card,
    .mission-card,
    .vision-card {
        padding: 1rem;
    }
    
    .product-content {
        padding: 1rem;
    }
    
    .card-icon {
        width: 45px;
        height: 45px;
    }
    
    .card-icon i {
        font-size: 1.1rem;
    }
    
    .floating-card {
        padding: 0.6rem;
    }
    
    .floating-card i {
        font-size: 1.5rem;
    }
    
    .floating-card h3 {
        font-size: 0.9rem;
    }
    
    .floating-card p {
        font-size: 0.75rem;
    }
    
    .image-stack {
        height: 200px;
    }
    
    .stack-image {
        width: 100%;
        height: 100px;
    }
    
    .contact-form-container {
        padding: 1rem;
    }
    
    .form-group input,
    .form-group textarea {
        padding: 8px 10px;
        font-size: 0.85rem;
    }
    
    .products-cta {
        padding: 1.5rem 1rem;
    }
    
    .products-cta h3 {
        font-size: 1.3rem;
    }
    
    .nav-container {
        padding: 0 10px;
    }
    
    .nav-logo a {
        font-size: 1.3rem;
    }
    
    .nav-logo i {
        font-size: 1.5rem;
    }
}

/* ===== ORIENTATION SPECIFIC STYLES ===== */

/* Landscape Mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        min-height: 100vh;
        padding: 2rem 0;
    }
    
    .hero-title {
        font-size: 2rem;
        margin-bottom: 1rem;
    }
    
    .hero-subtitle {
        font-size: 0.9rem;
        margin-bottom: 1rem;
    }
    
    .hero-buttons {
        gap: 0.5rem;
    }
    
    .btn {
        padding: 8px 16px;
        font-size: 0.8rem;
    }
    
    .floating-card {
        padding: 1rem;
    }
    
    .floating-card i {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }
    
    .floating-card h3 {
        font-size: 1rem;
        margin-bottom: 0.3rem;
    }
    
    .floating-card p {
        font-size: 0.8rem;
    }
}

/* ===== TOUCH DEVICE OPTIMIZATIONS ===== */

/* Touch devices */
@media (hover: none) and (pointer: coarse) {
    .btn:hover {
        transform: none;
    }
    
    .about-card:hover,
    .contact-card:hover,
    .product-card:hover {
        transform: none;
    }
    
    .nav-link:hover::after {
        width: 0;
    }
    
    .social-link:hover {
        transform: none;
    }
    
    .back-to-top:hover {
        transform: none;
    }
    
    /* Increase touch targets */
    .nav-link {
        padding: 10px 5px;
    }
    
    .btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    .form-group input,
    .form-group textarea {
        min-height: 44px;
    }
    
    .modal-close {
        min-width: 44px;
        min-height: 44px;
    }
}

/* ===== HIGH DPI DISPLAYS ===== */

/* Retina displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .hero-background {
        background-image: url('https://images.unsplash.com/photo-1518709268805-4e9042af2176?ixlib=rb-4.0.3&auto=format&fit=crop&w=3840&q=80');
    }
}

/* ===== PRINT STYLES ===== */

@media print {
    .navbar,
    .hero-buttons,
    .back-to-top,
    .footer,
    .modal,
    .loading-spinner {
        display: none !important;
    }
    
    .hero {
        min-height: auto;
        padding: 2rem 0;
    }
    
    .hero-title {
        color: #333 !important;
        font-size: 2rem;
    }
    
    .hero-subtitle {
        color: #666 !important;
    }
    
    .section {
        page-break-inside: avoid;
    }
    
    .product-card {
        page-break-inside: avoid;
    }
    
    .about-card,
    .contact-card {
        border: 1px solid #ccc;
        box-shadow: none;
    }
}

/* ===== ACCESSIBILITY IMPROVEMENTS ===== */

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .floating-card {
        animation: none;
    }
    
    .scroll-arrow {
        animation: none;
    }
    
    .spinner {
        animation: none;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .btn-primary {
        background: #000;
        color: #fff;
        border: 2px solid #000;
    }
    
    .btn-secondary {
        background: #fff;
        color: #000;
        border: 2px solid #000;
    }
    
    .nav-link::after {
        background: #000;
    }
    
    .card-icon {
        background: #000;
    }
    
    .contact-icon {
        background: #000;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    body {
        background: #1a1a1a;
        color: #fff;
    }
    
    .navbar {
        background: rgba(26, 26, 26, 0.95);
        border-bottom-color: rgba(255, 255, 255, 0.1);
    }
    
    .nav-link {
        color: #fff;
    }
    
    .about-section,
    .about-us-section {
        background: #2a2a2a;
    }
    
    .about-card,
    .contact-card,
    .story-card,
    .mission-card,
    .vision-card,
    .contact-form-container {
        background: #333;
        color: #fff;
    }
    
    .form-group input,
    .form-group textarea {
        background: #444;
        color: #fff;
        border-color: #555;
    }
    
    .footer {
        background: #1a1a1a;
    }
}

/* ===== PERFORMANCE OPTIMIZATIONS ===== */

/* Optimize for slower devices */
@media (max-width: 480px) {
    .hero-background {
        background-attachment: scroll;
    }
    
    .floating-card {
        backdrop-filter: none;
        background: rgba(255, 255, 255, 0.2);
    }
    
    .navbar {
        backdrop-filter: none;
        background: rgba(255, 255, 255, 0.98);
    }
}

/* ===== SPECIFIC DEVICE FIXES ===== */

/* iPhone X and newer notch devices */
@supports (padding: max(0px)) {
    .navbar {
        padding-top: max(0px, env(safe-area-inset-top));
    }
    
    .hero {
        padding-top: max(70px, env(safe-area-inset-top));
    }
    
    .back-to-top {
        bottom: max(30px, env(safe-area-inset-bottom));
    }
}

/* Samsung Galaxy Fold */
@media (max-width: 280px) {
    .hero-title {
        font-size: 1.4rem;
    }
    
    .hero-subtitle {
        font-size: 0.8rem;
    }
    
    .section-title {
        font-size: 1.2rem;
    }
    
    .container {
        padding: 0 5px;
    }
    
    .btn {
        padding: 6px 12px;
        font-size: 0.75rem;
    }
}
