/* ============================================
   Klean&Kare Website - Responsive Styles
   ============================================ */

/* Tablet Styles (768px - 1024px) */
@media screen and (max-width: 1024px) {
    .feature-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .feature-item:nth-child(3n) {
        border-right: 1px solid rgba(255, 255, 255, 0.3);
    }
    
    .feature-item:nth-child(2n) {
        border-right: none;
    }
    
    .feature-item:nth-child(5),
    .feature-item:nth-child(6) {
        border-bottom: none;
    }
    
    .articles-grid,
    .news-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }
    
    .footer-content {
        grid-template-columns: 1fr 1fr;
        gap: 30px;
    }
    
    .footer-social {
        grid-column: 1 / -1;
    }
}

/* Mobile Styles (max-width: 768px) */
@media screen and (max-width: 768px) {
    :root {
        --header-height: 70px;
    }
    
    .container {
        padding: 0 15px;
    }
    
    /* Header Mobile */
    .header-content {
        flex-wrap: wrap;
    }
    
    .main-nav {
        order: 3;
        width: 100%;
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 9998;
        opacity: 0;
        transition: opacity 0.3s ease;
    }
    
    .main-nav.active {
        display: block;
        opacity: 1;
    }
    
    .main-nav .nav-menu {
        position: fixed;
        top: 0 !important;
        right: 0;
        width: 280px;
        max-width: 85%;
        height: 100vh;
        background-color: var(--white);
        flex-direction: column;
        gap: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
        padding-top: 0 !important;
        margin-top: 0 !important;
        box-shadow: -5px 0 20px rgba(0, 0, 0, 0.2);
        transform: translateX(100%);
        transition: transform 0.3s ease;
        overflow-y: auto;
        overflow-x: hidden;
        z-index: 9999;
        list-style: none !important;
        border: none !important;
        line-height: 0;
        display: flex !important;
        align-items: flex-start;
        justify-content: flex-start;
    }
    
    .main-nav .nav-menu::before {
        display: none !important;
        content: none !important;
    }
    
    .main-nav .nav-menu::after {
        display: none !important;
        content: none !important;
    }
    
    .main-nav.active .nav-menu {
        transform: translateX(0);
    }
    
    .main-nav .nav-menu li {
        border-bottom: 1px solid #eee;
        position: relative;
        margin: 0 !important;
        padding: 0 !important;
        list-style: none !important;
    }
    
    .main-nav .nav-menu li:first-child {
        border-top: none !important;
    }
    
    .main-nav .nav-menu li.nav-menu-close {
        display: block !important;
        border-bottom: 1px solid #eee;
        border-top: none !important;
        padding: 0 !important;
        margin: 0 !important;
        position: absolute;
        top: 0;
        right: 0;
        z-index: 100;
        background-color: transparent;
    }
    
    .mobile-menu-close {
        background: none;
        border: none;
        font-size: 1.5rem;
        color: var(--text-dark);
        cursor: pointer;
        padding: 15px 20px !important;
        margin: 0 !important;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: color 0.3s ease, transform 0.3s ease;
        line-height: 1;
    }
    
    .main-nav .nav-menu li.nav-menu-close .mobile-menu-close {
        padding: 15px 20px !important;
        margin: 0 !important;
    }
    
    .main-nav .nav-menu li:not(.nav-menu-close) {
        min-height: 50px;
    }
    
    .main-nav .nav-menu li:not(.nav-menu-close) a {
        min-height: 50px;
        display: flex;
        align-items: center;
    }
    
    .mobile-menu-close:hover {
        color: var(--orange);
        transform: rotate(90deg);
    }
    
    .nav-menu a {
        display: block;
        padding: 15px 20px;
        font-size: 1rem;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    /* Hide hamburger menu when nav is active - use body class instead */
    body.menu-open .mobile-menu-toggle {
        display: none;
    }
    
    .mobile-menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(8px, 8px);
    }
    
    .mobile-menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .mobile-menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -7px);
    }
    
    .social-icons {
        order: 2;
    }
    
    .mobile-menu-toggle {
        order: 3;
        margin-left: auto;
    }
    
    /* Hero Mobile */
    .hero-section {
        padding: 0;
    }
    
    .hero-banner-img {
        width: 100%;
        height: auto;
    }
    
    /* Feature Mobile */
    .feature-section {
        padding: 40px 0;
    }
    
    .feature-grid {
        grid-template-columns: 1fr;
    }
    
    .feature-item {
        padding: 30px 20px;
        border-right: none !important;
    }
    
    .feature-item:not(:last-child) {
        border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    }
    
    .feature-item:last-child {
        border-bottom: none;
    }
    
    /* Articles Mobile */
    .articles-section,
    .news-section {
        padding: 50px 0;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    .section-subtitle {
        font-size: 1.3rem;
    }
    
    .section-intro {
        font-size: 1rem;
        margin-bottom: 30px;
    }
    
    .articles-grid,
    .news-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .article-card img,
    .news-card img {
        aspect-ratio: 1 / 1;
    }
    
    .article-card h4,
    .news-card h4 {
        min-height: auto;
        padding: 15px;
        font-size: 0.95rem;
    }
    
    /* Footer Mobile */
    .main-footer {
        padding: 40px 0 15px;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 20px;
    }
    
    .footer-social {
        text-align: center;
    }
    
    .social-links {
        align-items: center;
    }
}

/* Small Mobile Styles (max-width: 480px) */
@media screen and (max-width: 480px) {
    .section-title {
        font-size: 1.5rem;
    }
    
    .section-subtitle {
        font-size: 1.1rem;
    }
    
    .feature-icon {
        width: 60px;
        height: 60px;
    }
    
    .feature-item h3 {
        font-size: 1.1rem;
    }
    
    .feature-item p {
        font-size: 0.9rem;
    }
    
    .article-card img,
    .news-card img {
        aspect-ratio: 1 / 1;
    }
    
    .article-card h4,
    .news-card h4 {
        font-size: 0.9rem;
        padding: 12px;
    }
}

/* Large Desktop Styles (min-width: 1400px) */
@media screen and (min-width: 1400px) {
    :root {
        --container-width: 1400px;
    }
    
    .section-title {
        font-size: 2.5rem;
    }
}

/* Landscape Mobile Orientation */
@media screen and (max-width: 768px) and (orientation: landscape) {
    .hero-section {
        padding: 0;
    }
}

/* High DPI Displays */
@media screen and (-webkit-min-device-pixel-ratio: 2),
       screen and (min-resolution: 192dpi) {
    .logo-img,
    .footer-logo img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Accessibility - Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Breadcrumb Responsive */
@media screen and (max-width: 768px) {
    .breadcrumb-nav {
        padding: 12px 0;
    }
    
    .breadcrumb {
        font-size: 0.85rem;
        flex-wrap: wrap;
    }
}

/* Products Section Responsive */
@media screen and (max-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }
}

@media screen and (max-width: 768px) {
    .products-content-section {
        padding: 40px 0;
    }
    
    .products-content-section .section-title {
        font-size: 1.8rem;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .product-image {
        height: 150px;
    }
    
    /* Contact Page Mobile */
    .contact-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .contact-form-wrapper {
        padding: 30px 20px;
    }
    
    .contact-form-wrapper h2 {
        font-size: 1.5rem;
    }
    
    /* Distribution Page Mobile */
    .distribution-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .distribution-card {
        padding: 30px 20px;
    }
    
    .distribution-icon {
        width: 70px;
        height: 70px;
        font-size: 1.8rem;
    }
    
    .distribution-card h3 {
        font-size: 1.3rem;
    }
    
    .distribution-note {
        padding: 20px;
    }
    
    /* About Page Mobile */
    .about-intro h2 {
        font-size: 2rem;
    }
    
    .intro-text {
        font-size: 1.1rem;
    }
    
    .about-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .about-card {
        padding: 30px 20px;
    }
    
    .about-icon {
        width: 70px;
        height: 70px;
        font-size: 1.8rem;
    }
    
    .about-company h2 {
        font-size: 1.8rem;
    }
    
    .company-info {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .about-values h2 {
        font-size: 1.8rem;
    }
    
    .values-list {
        flex-direction: column;
        align-items: stretch;
    }
    
    .value-item {
        justify-content: center;
    }
    
    /* About Page New Design Mobile */
    .about-hero-title {
        font-size: 2.5rem;
    }
    
    .about-hero-subtitle {
        font-size: 1.4rem;
    }
    
    .history-text .section-title,
    .expertise-main .section-title,
    .quality-title,
    .export-content .section-title,
    .company-info-content .section-title,
    .policies-content .section-title {
        font-size: 2rem;
    }
    
    .history-timeline {
        padding-left: 30px;
    }
    
    .timeline-item {
        flex-direction: column;
        gap: 15px;
    }
    
    .timeline-year {
        min-width: auto;
        width: fit-content;
    }
    
    .standards-grid {
        grid-template-columns: 1fr;
    }
    
    .quality-grid {
        grid-template-columns: 1fr;
    }
    
    .countries-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .company-details-grid {
        grid-template-columns: 1fr;
    }
    
    .policies-grid {
        grid-template-columns: 1fr;
    }
    
    /* Product Detail Page Mobile */
    .product-detail-title {
        font-size: 2rem;
    }
    
    .product-detail-subtitle {
        font-size: 1.1rem;
    }
    
    .product-detail-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .product-info-box {
        padding: 30px 20px;
    }
    
    .product-info-title {
        font-size: 1.5rem;
    }
    
    .retailers-grid {
        gap: 15px;
    }
    
    .retailer-item {
        width: 100px;
        height: 100px;
    }
    
    .related-articles-grid {
        grid-template-columns: 1fr;
    }
    
    /* Article Detail Page Mobile */
    .article-title {
        font-size: 1.8rem;
    }
    
    .article-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .article-body {
        font-size: 1rem;
    }
    
    /* Privacy Policy Page Mobile */
    .policy-title {
        font-size: 2rem;
    }
    
    .policy-section h2 {
        font-size: 1.5rem;
    }
    
    .policy-section p,
    .policy-section li {
        font-size: 1rem;
    }
    
    .contact-info {
        padding: 20px;
    }
    
    /* News Detail Page Mobile */
    .news-title {
        font-size: 1.8rem;
    }
    
    .news-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .news-body {
        font-size: 1rem;
    }
    
    .related-news-grid {
        grid-template-columns: 1fr;
    }
    
    /* FAQ Page Mobile */
    .faq-title {
        font-size: 2rem;
    }
    
    .faq-question {
        padding: 20px;
    }
    
    .faq-question h3 {
        font-size: 1.1rem;
    }
    
    .faq-answer {
        padding: 0 20px !important;
    }
    
    .faq-item.active .faq-answer {
        padding: 0 20px 20px !important;
    }
    
    .faq-answer p,
    .faq-answer li {
        font-size: 1rem;
    }
    
    .faq-contact {
        padding: 20px;
    }
    
    /* Event Popup Mobile */
    .event-popup-content {
        max-width: 95%;
    }
    
    .event-popup-close {
        width: 35px;
        height: 35px;
        top: -10px;
        right: -10px;
    }
    
    .event-popup-close i {
        font-size: 1rem;
    }
}

/* Print Styles */
@media print {
    .hero-section {
        background: var(--white) !important;
        color: var(--text-dark) !important;
    }
    
    .article-card,
    .news-card {
        break-inside: avoid;
        page-break-inside: avoid;
    }
    
    .breadcrumb-nav {
        display: none;
    }
}

