/* ===================================
   AGROES - ESTILOS RESPONSIVOS
   responsive.css
   ================================= */

/* Large Desktop (1200px and up) */
@media (min-width: 1200px) {
    .container {
        max-width: 1400px;
    }
    
    .hero-title {
        font-size: 5rem;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    }
}

/* Desktop (992px to 1199px) */
@media (max-width: 1199px) {
    .hero-title {
        font-size: 3.5rem;
    }
    
    .hero-content .container {
        gap: var(--spacing-xl);
    }
}

/* Tablet (768px to 991px) */
@media (max-width: 991px) {
    /* Navigation */
    .nav-menu {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 70px);
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(20px);
        flex-direction: column;
        justify-content: flex-start;
        padding: var(--spacing-xl);
        gap: var(--spacing-lg);
        transition: all var(--transition-base);
        border-top: 1px solid var(--gray-200);
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .nav-toggle {
        display: flex;
    }
    
    .nav-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(6px, 6px);
    }
    
    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .nav-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(6px, -6px);
    }
    
    /* Hero Section */
    .hero-content .container {
        grid-template-columns: 1fr;
        text-align: center;
        gap: var(--spacing-2xl);
    }
    
    .hero-text {
        order: 2;
    }
    
    .hero-visual {
        order: 1;
        
    }
    
    .hero-title {
        font-size: 3rem;
    }
    
    .hero-subtitle {
        margin: 0 auto var(--spacing-xl);
    }
    
    .hero-image {
        width: 300px;
        height: 300px;
    }
    
    /* About Section */
    .about-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-xl);
    }
    
    /* Contact Section */
    .contact-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-xl);
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
        text-align: center;
    }
    
    /* Products Grid */
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: var(--spacing-lg);
    }
    
    /* Categories Grid */
    .categories-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
    
    /* Modal */
    .modal-content {
        width: 95%;
        margin: 5% auto;
    }
    
    .product-modal-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
    
    .pdf-modal .modal-content {
        height: 70vh;
        margin: 15vh auto;
    }
}

/* Mobile Large (576px to 767px) */
@media (max-width: 767px) {
    /* Typography adjustments */
    h1 { font-size: 2.5rem; }
    h2 { font-size: 2rem; }
    h3 { font-size: 1.5rem; }

     .floating-card {
        font-size: 0.7rem;
        padding: 4px 8px;
        /* Mantener position: absolute */
    }
    
    .card-1 { top: 5%; left: -5%; }
    .card-2 { top: 45%; right: -5%; }
    .card-3 { bottom: 5%; left: 15%; }
    
    /* Container */
    .container {
        padding: 0 var(--spacing-sm);
    }
    
.brand-logo {
    height: 75px;
    width: auto;
}

    /* Navigation */
    .nav-container {
        padding: 0 var(--spacing-sm);
        height: 60px;
    }
    
    .nav-menu {
        top: 60px;
        height: calc(100vh - 60px);
        padding: var(--spacing-lg) var(--spacing-sm);
    }
    
    .nav-link {
        padding: var(--spacing-sm);
        text-align: center;
        border-radius: var(--radius-lg);
    }
    
    /* Hero Section */
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .slide-content {
        padding: 1rem;
    }
    
    .slider-indicators {
        bottom: 1rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        gap: var(--spacing-sm);
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 280px;
    }
    
    .hero-image {
        width: 250px;
        height: 250px;
    }
    
    .floating-card {
        font-size: 0.875rem;
        padding: var(--spacing-xs) var(--spacing-sm);
    }
    
    .card-icon {
        font-size: 1.25rem;
    }
    
    /* Section spacing */
    section {
        padding: var(--spacing-xl) 0;
    }
    
    .section-header {
        margin-bottom: var(--spacing-xl);
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .section-subtitle {
        font-size: 1rem;
    }
    
    /* About Section */
    .feature-item {
        padding: var(--spacing-md);
        text-align: center;
    }
    
    .feature-icon {
        font-size: 2rem;
    }
    
    /* Categories */
    .categories-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    .category-card {
        padding: var(--spacing-lg);
    }
    
    /* Catalog Filters */
    .catalog-filters {
        flex-direction: column;
        gap: var(--spacing-md);
        text-align: center;
        padding: var(--spacing-md);
    }
    
    .filter-group {
        width: 100%;
        justify-content: center;
    }
    
    .filter-select {
        width: 100%;
        max-width: 300px;
    }

     .pdf-modal .modal-content {
        width: 98vw;
        height: 95vh;
        margin: 2.5vh auto;
    }
    
    .pdf-viewer {
        width: 100%;
        min-height: calc(95vh - 60px);
    }
    
    /* Products Grid */
    .products-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
     .products-container {
        gap: 1rem; /* Reduce el espacio entre las tarjetas en móviles */
    }
    
    .product-actions {
        flex-direction: column;
        gap: var(--spacing-xs);
    }
    
    .btn-outline,
    .btn-ghost {
        width: 100%;
        min-width: auto;
    }
    
    /* Contact Form */
    .contact-form {
        padding: var(--spacing-lg);
    }
    
    .form-group {
        margin-bottom: var(--spacing-md);
    }
    
    /* Footer */
    .footer-links {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
    
    /* Modal */
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .modal-body {
        padding: var(--spacing-lg);
    }
    
    .modal-header {
        padding: var(--spacing-md) var(--spacing-lg);
    }
    
    .modal-close {
        top: var(--spacing-xs);
        right: var(--spacing-sm);
        font-size: 1.5rem;
        width: 32px;
        height: 32px;
    }
    
    .pdf-modal .modal-content {
        width: 98%;
        height: 80vh;
        margin: 10vh auto;
    }
    
    .modal-product-actions {
        flex-direction: column;
        gap: var(--spacing-xs);
    }
}

/* Mobile Medium (481px to 575px) */
@media (max-width: 575px) {
    /* Further reduce spacing for smaller screens */
    :root {
        --spacing-xs: 0.375rem;
        --spacing-sm: 0.75rem;
        --spacing-md: 1.25rem;
        --spacing-lg: 1.5rem;
        --spacing-xl: 2rem;
        --spacing-2xl: 2.5rem;
    }
    
    .hero-title {
        font-size: 2.25rem;
    }
    
    .hero-image {
        width: 220px;
        height: 220px;
    }

}

/* Mobile Small (320px to 480px) */
@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .hero-image {
        width: 200px;
        height: 200px;
    }
    
    .section-title {
        font-size: 1.75rem;
    }
    
    .product-card {
        max-width: 100%;
    }
    
    .modal-content {
        margin: 5% auto;
        border-radius: var(--radius-lg);
    }
    
    .pdf-modal .modal-content {
        height: 85vh;
        margin: 7.5vh auto;
    }
}

/* Extra Small Mobile (less than 320px) */
@media (max-width: 319px) {
    .hero-title {
        font-size: 1.75rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .btn {
        font-size: 0.875rem;
        padding: var(--spacing-xs) var(--spacing-sm);
    }
    
    .nav-container {
        height: 55px;
    }
    
    .nav-menu {
        top: 55px;
        height: calc(100vh - 55px);
    }
}

/* Landscape orientation adjustments */
@media (max-height: 600px) and (orientation: landscape) {
    .hero {
        min-height: 100vh;
        padding: var(--spacing-lg) 0;
    }
    
    .hero-content {
        padding: var(--spacing-lg) 0;
    }
    
    .hero-image {
        width: 180px;
        height: 180px;
    }
    
    .floating-card {
        display: none;
    }
    
    .modal-content {
        margin: 2% auto;
        max-height: 96vh;
        overflow-y: auto;
    }
    
    .pdf-modal .modal-content {
        height: 95vh;
        margin: 2.5vh auto;
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .hero-particles {
        background-size: 30px 30px;
    }
    
    .loading-spinner {
        border-width: 2px;
    }
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .hero-particles {
        animation: none;
    }
    
    .floating-card {
        animation: none;
    }
    
    .loading-spinner {
        animation: none;
        border-top-color: transparent;
    }
}

/* Dark mode support (if needed in the future) */
@media (prefers-color-scheme: dark) {
    /* This section is prepared for future dark mode implementation */
    /* Currently using light theme only as per design requirements */
}

/* Print styles */
@media print {
    * {
        background: transparent !important;
        color: black !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }
    
    .navbar,
    .hero,
    .contact,
    .footer,
    .modal,
    .btn {
        display: none !important;
    }
    
    .container {
        max-width: none;
        margin: 0;
        padding: 0;
    }
    
    h1, h2, h3 {
        page-break-after: avoid;
    }
    
    .product-card {
        break-inside: avoid;
        margin-bottom: 1rem;
        border: 1px solid #ddd;
    }
}

/* Accessibility improvements */
@media (max-width: 991px) {
    /* Larger touch targets for mobile */
    .nav-toggle {
        padding: var(--spacing-sm);
        margin: calc(-1 * var(--spacing-sm));
    }
    
    .btn,
    .filter-select {
        min-height: 44px; /* Minimum recommended touch target size */
    }
    
    .modal-close {
        min-width: 44px;
        min-height: 44px;
    }
}

/* Focus improvements for keyboard navigation */
@media (max-width: 767px) {
    .nav-link:focus,
    .btn:focus,
    .filter-select:focus {
        outline: 2px solid var(--primary-color);
        outline-offset: 2px;
    }
}