/* =====================================================
   TEXTILE CO. - Responsive Styles
   ===================================================== */

/* -----------------------------------------------------
   Tablet (max-width: 1024px)
   ----------------------------------------------------- */
@media (max-width: 1024px) {
    :root {
        --section-padding: 5rem;
    }

    /* Navigation */
    .nav-menu {
        display: none;
    }

    .nav-toggle {
        display: flex;
    }

    /* Stats */
    .stats-grid .stat-item {
        flex: 0 1 calc(50% - 1.5rem);
    }

    /* About */
    .about-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .about-visual {
        order: -1;
    }

    .about-image {
        height: 350px;
    }

    /* Process */
    .process-grid .process-card {
        flex: 0 1 calc(50% - 1rem);
        max-width: calc(50% - 1rem);
    }

    /* Products */
    .products-grid .product-card {
        flex: 0 1 calc(50% - 1rem);
        max-width: calc(50% - 1rem);
    }

    /* Products Page */
    .products-layout {
        grid-template-columns: 240px 1fr;
        gap: 2rem;
    }

    .products-page .products-grid .product-card {
        flex: 0 1 calc(50% - 1rem);
        max-width: calc(50% - 1rem);
    }

    .filter-sidebar {
        padding: 1.5rem;
    }

    /* Sources */
    .sources-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .globe-decoration {
        width: 280px;
        height: 280px;
    }

    /* Partners */
    .partners-grid .partner-card {
        flex: 0 1 calc(33.333% - 1rem);
        max-width: calc(33.333% - 1rem);
    }

    /* Team */
    .team-grid .team-card {
        flex: 0 1 calc(50% - 1rem);
        max-width: calc(50% - 1rem);
    }

    /* Gallery */
    .gallery-grid .gallery-item {
        flex: 0 1 calc(33.333% - 0.75rem);
        max-width: calc(33.333% - 0.75rem);
        height: 180px;
    }

    /* Testimonials */
    .testimonials-grid .testimonial-card {
        flex: 0 1 calc(50% - 1rem);
        max-width: calc(50% - 1rem);
    }

    /* Contact */
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    /* Footer */
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2.5rem;
    }

    /* Partners Page */
    .partners-showcase__card {
        min-height: 380px;
    }

    .partners-showcase__card-content {
        padding: 3rem;
    }
}

/* -----------------------------------------------------
   Mobile (max-width: 768px)
   ----------------------------------------------------- */
@media (max-width: 768px) {
    :root {
        --section-padding: 4rem;
        --container-padding: 1.25rem;
    }

    /* Typography */
    .section-title {
        font-size: clamp(1.75rem, 6vw, 2.5rem);
    }

    /* Hero */
    .hero {
        min-height: 100vh;
        padding: 0 1.25rem;
    }

    .hero-title {
        font-size: clamp(2rem, 8vw, 3rem);
    }

    .hero-description {
        font-size: 1rem;
    }

    .hero-buttons {
        flex-direction: column;
        gap: 0.75rem;
    }

    .hero-buttons .btn {
        width: 100%;
        text-align: center;
    }

    .scroll-indicator {
        bottom: 2rem;
    }

    /* Stats */
    .stats-bar {
        padding: 3rem 0;
    }

    .stats-grid {
        gap: 1.5rem;
    }

    .stats-grid .stat-item {
        flex: 0 1 calc(50% - 0.75rem);
    }

    .stat-number {
        font-size: clamp(2rem, 8vw, 2.5rem);
    }

    /* About */
    .feature-cards {
        justify-content: center;
    }

    .feature-card {
        flex: 0 1 100%;
        max-width: 100%;
    }

    /* Process */
    .process-grid .process-card {
        flex: 0 1 100%;
        max-width: 100%;
        padding: 2rem;
    }

    /* Products */
    .filter-buttons {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .filter-btn {
        padding: 0.6rem 1rem;
        font-size: 0.75rem;
    }

    .products-grid .product-card {
        flex: 0 1 100%;
        max-width: 100%;
    }

    .product-image {
        height: 200px;
    }

    /* Products Page - Mobile Drawer */
    .products-page-hero {
        padding: 8rem 0 3rem;
    }

    .page-title {
        font-size: clamp(2rem, 6vw, 2.5rem);
    }

    .filter-toggle-bar {
        display: block;
    }

    .products-layout {
        grid-template-columns: 1fr;
    }

    .filter-sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 85%;
        max-width: 320px;
        height: 100vh;
        z-index: 999;
        overflow-y: auto;
        transition: left var(--transition-base);
        padding: 1.5rem;
        padding-bottom: 6rem;
    }

    .filter-sidebar.active {
        left: 0;
    }

    .filter-close-btn {
        display: block;
    }

    .filter-drawer-overlay {
        display: block;
    }

    .apply-filters-btn {
        display: block;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 85%;
        max-width: 320px;
        border-radius: 0;
        margin: 0;
        z-index: 1000;
        opacity: 0;
        visibility: hidden;
        transition: opacity var(--transition-base), visibility var(--transition-base);
    }

    .filter-sidebar.active ~ .apply-filters-btn,
    .filter-sidebar.active + .products-main .apply-filters-btn {
        opacity: 1;
        visibility: visible;
    }

    /* Fix: Apply button inside sidebar */
    .filter-sidebar .apply-filters-btn {
        position: sticky;
        bottom: -1.5rem;
        left: 0;
        width: calc(100% + 3rem);
        margin: 1.5rem -1.5rem -1.5rem;
        opacity: 1;
        visibility: visible;
    }

    .products-page .products-grid .product-card {
        flex: 0 1 100%;
        max-width: 100%;
    }

    .products-page {
        padding-top: 0;
    }

    /* Team Page */
    .team-page-hero {
        padding: 8rem 0 3rem;
    }

    /* Partners */
    .partners-grid .partner-card {
        flex: 0 1 calc(50% - 0.75rem);
        max-width: calc(50% - 0.75rem);
    }

    /* Team */
    .team-grid .team-card {
        flex: 0 1 100%;
        max-width: 100%;
    }

    .team-photo {
        height: 280px;
    }

    /* Gallery */
    .gallery-grid .gallery-item {
        flex: 0 1 calc(50% - 0.5rem);
        max-width: calc(50% - 0.5rem);
        height: 150px;
    }

    /* Lightbox */
    .lightbox-prev,
    .lightbox-next {
        font-size: 2rem;
        padding: 0.5rem;
    }

    .lightbox-prev {
        left: 1rem;
    }

    .lightbox-next {
        right: 1rem;
    }

    .lightbox-close {
        top: 1rem;
        right: 1rem;
        font-size: 2rem;
    }

    .lightbox-content {
        width: 90%;
        height: 50vh;
    }

    /* Testimonials */
    .testimonials-grid .testimonial-card {
        flex: 0 1 100%;
        max-width: 100%;
        padding: 2rem;
    }

    /* Contact */
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .contact-form {
        padding: 1.5rem;
    }

    /* Newsletter */
    .newsletter {
        padding: 4rem 0;
    }

    .newsletter-form {
        flex-direction: column;
    }

    .newsletter-input {
        max-width: 100%;
    }

    /* Footer */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .footer-brand {
        text-align: center;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 1.5rem;
        text-align: center;
    }

    /* Back to Top */
    .back-to-top {
        bottom: 1.5rem;
        right: 1.5rem;
        width: 44px;
        height: 44px;
    }

    /* Partners Page */
    .partners-showcase__card {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .partners-showcase__card:nth-child(even) {
        direction: ltr;
    }

    .partners-showcase__card-image {
        min-height: 300px;
    }

    .partners-showcase__card-content {
        padding: 3rem 2rem;
    }
}

/* -----------------------------------------------------
   Small Mobile (max-width: 480px)
   ----------------------------------------------------- */
@media (max-width: 480px) {
    :root {
        --container-padding: 1rem;
    }

    .section-label {
        font-size: 0.65rem;
    }

    /* Hero */
    .hero-label {
        font-size: 0.6rem;
        letter-spacing: 0.3em;
    }

    .hero-title {
        font-size: clamp(1.75rem, 10vw, 2.5rem);
    }

    /* Stats */
    .stats-grid {
        gap: 1.5rem 1rem;
    }

    .stats-grid .stat-item {
        flex: 0 1 calc(50% - 0.5rem);
        text-align: center;
    }

    /* Mobile Menu */
    .mobile-menu-link {
        font-size: 1.5rem;
    }

    /* Buttons */
    .btn {
        padding: 0.9rem 1.5rem;
        font-size: 0.8rem;
    }

    /* Gallery */
    .gallery-grid .gallery-item {
        flex: 0 1 100%;
        max-width: 100%;
        height: 200px;
    }

    /* Globe */
    .globe-decoration {
        width: 220px;
        height: 220px;
    }

    .globe-center {
        width: 100px;
        height: 100px;
    }

    .globe-center span {
        font-size: 0.75rem;
    }

    /* Partners Page */
    .partners-showcase__card-image {
        min-height: 250px;
    }

    .partners-showcase__card-content {
        padding: 2rem 1.5rem;
    }

    .partners-showcase__card-name {
        margin-bottom: 1.5rem;
    }

    .partners-showcase__card-link {
        padding: 0.875rem 1.5rem;
        font-size: 0.8rem;
    }
}

/* -----------------------------------------------------
   Large Desktop (min-width: 1400px)
   ----------------------------------------------------- */
@media (min-width: 1400px) {
    :root {
        --container-width: 1320px;
    }

    .hero-title {
        font-size: 5rem;
    }

    .gallery-grid .gallery-item {
        height: 250px;
    }
}

/* -----------------------------------------------------
   Touch Device Adjustments
   ----------------------------------------------------- */
@media (hover: none) {
    /* Remove hover effects on touch devices */
    .feature-card:hover,
    .process-card:hover,
    .product-card:hover,
    .testimonial-card:hover {
        transform: none;
    }

    /* Team overlay always visible on mobile */
    .team-overlay {
        opacity: 1;
        background-color: rgba(26, 26, 26, 0.6);
    }

    /* Gallery overlay always visible */
    .gallery-overlay {
        opacity: 1;
        background-color: rgba(196, 114, 78, 0.4);
    }

    .gallery-icon {
        font-size: 2rem;
    }
}

/* -----------------------------------------------------
   High Contrast Mode
   ----------------------------------------------------- */
@media (prefers-contrast: high) {
    :root {
        --light-gray: #6a6a6a;
    }

    .nav-link,
    .mobile-menu-link {
        opacity: 1;
    }

    .btn {
        border-width: 2px;
    }
}

/* -----------------------------------------------------
   Print Styles
   ----------------------------------------------------- */
@media print {
    .header,
    .mobile-menu-overlay,
    .back-to-top,
    .newsletter,
    .lightbox,
    .scroll-indicator {
        display: none !important;
    }

    .hero {
        height: auto;
        min-height: 0;
        padding: 2rem 0;
        background: var(--charcoal) !important;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    .section {
        padding: 2rem 0;
    }

    .section-dark {
        background-color: var(--charcoal) !important;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    body {
        font-size: 12pt;
    }
}
