/* ================================================
   RESPONSIVE STYLES - CÔNG TY NAM TRIỆU
   Breakpoints: 1024px, 768px, 480px
   ================================================ */

/* ==================== SMALL DESKTOP (max-width: 1280px) ==================== */
@media (max-width: 1280px) {
    .nav-link {
        padding: 10px 9px;
        font-size: 0.75rem;
        letter-spacing: 0.2px;
    }

    .logo-name {
        font-size: 1rem;
    }

    .logo-img-congan {
        height: 52px;
        width: 52px;
    }

    .logo-img-namtrieu {
        height: 44px;
        width: 44px;
    }

    .header-actions .btn {
        padding: 8px 14px;
        font-size: 0.7rem;
    }

    .header-actions .search-btn {
        width: 36px;
        height: 36px;
    }
}

/* ==================== MID DESKTOP (max-width: 1180px) ==================== */
@media (max-width: 1180px) {
    .header-actions .btn {
        display: none;
    }

    .logo-name {
        display: none;
    }
}

/* ==================== TABLET LANDSCAPE (max-width: 1024px) ==================== */
@media (max-width: 1024px) {
    :root {
        --header-height: 70px;
        --section-padding: 80px 0;
    }

    .section-heading {
        font-size: 2rem;
    }

    /* Navigation - Hamburger */
    .main-nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 320px;
        height: 100vh;
        background: var(--color-white);
        border-left: 1px solid var(--color-border);
        flex-direction: column;
        padding: 100px 30px 30px;
        transition: var(--transition-slow);
        z-index: 1000;
        overflow-y: auto;
    }

    body.menu-open .main-nav {
        right: 0;
    }

    .nav-list {
        flex-direction: column;
        gap: 0;
        width: 100%;
    }

    .nav-link {
        padding: 14px 0;
        width: 100%;
        border-bottom: 1px solid var(--color-border);
        justify-content: space-between;
    }

    .nav-link::after {
        display: none;
    }

    .has-dropdown .dropdown {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        border: none;
        border-top: none;
        border-radius: 0;
        padding: 0;
        margin: 0;
        background: rgba(11, 29, 58, 0.04);
        box-shadow: none;
        min-width: 0;
        width: 100%;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.35s ease;
    }

    .has-dropdown.dropdown-open .dropdown {
        max-height: 600px;
    }

    .has-dropdown .dropdown li {
        list-style: none;
        width: 100%;
    }

    .has-dropdown .dropdown li a {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 12px 16px 12px 28px;
        font-size: 0.82rem;
        font-weight: 500;
        color: var(--color-text-secondary);
        border-bottom: 1px solid rgba(11, 29, 58, 0.06);
        line-height: 1.4;
        position: relative;
    }

    .has-dropdown .dropdown li:last-child a {
        border-bottom: none;
    }

    .has-dropdown .dropdown li a::before {
        content: '';
        display: inline-block;
        width: 6px;
        height: 6px;
        border-radius: 50%;
        background: var(--color-accent);
        flex-shrink: 0;
    }

    .has-dropdown .dropdown li a:hover {
        padding-left: 32px;
        background: rgba(184, 146, 46, 0.08);
        color: var(--color-accent);
    }

    .menu-toggle {
        display: flex;
    }

    .header-actions .btn {
        display: none;
    }

    /* Hero */
    .hero-title {
        font-size: 3rem;
    }

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

    .hero-swiper .swiper-button-prev,
    .hero-swiper .swiper-button-next {
        display: none;
    }

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

    .about-image {
        order: -1;
    }

    .image-placeholder {
        height: 350px;
    }

    /* Products */
    .products-grid,
    .products-grid-3 {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }

    /* Logo */
    .logo-img-congan {
        height: 50px;
        width: 50px;
    }

    .logo-img-namtrieu {
        height: 42px;
        width: 42px;
    }

    /* Subsidiaries */
    .subsidiaries-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }

    /* News */
    .news-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }

    .news-card:last-child {
        grid-column: span 2;
    }

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

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

/* ==================== TABLET PORTRAIT (max-width: 768px) ==================== */
@media (max-width: 768px) {
    :root {
        --section-padding: 60px 0;
    }

    .section-heading {
        font-size: 1.75rem;
    }

    .section-desc {
        font-size: 0.95rem;
    }

    .section-header {
        margin-bottom: 40px;
    }

    /* Top bar */
    .top-bar-left a:not(:first-child) {
        display: none;
    }

    /* Hero */
    .hero-title {
        font-size: 2.2rem;
    }

    .hero-label {
        font-size: 0.7rem;
        letter-spacing: 2px;
        padding: 6px 16px;
    }

    .hero-subtitle {
        font-size: 0.9rem;
    }

    .hero-buttons .btn {
        padding: 12px 24px;
        font-size: 0.8rem;
    }

    .scroll-down {
        display: none;
    }

    /* About */
    .about-features {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .feature-box {
        padding: 12px;
    }

    .feature-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .feature-info h4 {
        font-size: 0.8rem;
    }

    .feature-info p {
        font-size: 0.75rem;
    }

    /* Stats */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .stat-item {
        padding: 30px 16px;
    }

    .stat-item:nth-child(2)::after {
        display: none;
    }

    .stat-number {
        font-size: 2.5rem;
    }

    /* Products - keep 2 cols on tablet portrait so 6 cards = 3x2 (balanced) */
    .products-grid,
    .products-grid-3 {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    /* Language switcher */
    .lang-switcher {
        margin-right: 8px;
    }

    .product-image {
        height: 160px;
    }

    .product-content {
        padding: 20px 16px;
    }

    .product-title {
        font-size: 1rem;
    }

    .product-card .product-title {
        min-height: 2.6em;
    }

    .product-desc {
        font-size: 0.78rem;
    }

    .product-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
        right: 16px;
        top: -20px;
    }

    /* Subsidiaries */
    .subsidiaries-grid {
        grid-template-columns: 1fr;
    }

    .subsidiary-card-large {
        grid-column: auto;
    }

    /* News */
    .news-grid {
        grid-template-columns: 1fr;
    }

    .news-card:last-child {
        grid-column: auto;
    }

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

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

    .footer-bottom .container {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
}

/* ==================== MOBILE (max-width: 480px) ==================== */
@media (max-width: 480px) {
    :root {
        --section-padding: 50px 0;
        --header-height: 64px;
    }

    h2 {
        font-size: 1.5rem;
    }

    .section-heading {
        font-size: 1.5rem;
        letter-spacing: 0;
    }

    .section-label {
        font-size: 0.7rem;
        letter-spacing: 2px;
        padding-left: 36px;
    }

    .section-label::before {
        width: 28px;
    }

    /* Top bar */
    .top-bar {
        display: none;
    }

    /* Header */
    #header .container {
        padding: 0 16px;
    }

    .logo-icon {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }

    .logo-name {
        font-size: 1.1rem;
        display: block;
    }

    .logo-img-congan {
        height: 46px;
        width: 46px;
    }

    .logo-img-namtrieu {
        height: 38px;
        width: 38px;
    }

    .lang-switcher {
        display: none;
    }

    .search-btn {
        width: 36px;
        height: 36px;
        font-size: 0.8rem;
    }

    /* Mobile Nav */
    .main-nav {
        width: 100%;
        right: -100%;
    }

    /* Hero */
    #hero {
        min-height: 500px;
    }

    .hero-label {
        font-size: 0.6rem;
        letter-spacing: 1.5px;
    }

    .hero-title {
        font-size: 1.8rem;
        letter-spacing: 0;
    }

    .hero-subtitle {
        font-size: 0.85rem;
        margin-bottom: 28px;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }

    .hero-buttons .btn {
        width: 100%;
        max-width: 280px;
        justify-content: center;
    }

    /* About */
    .about-features {
        grid-template-columns: 1fr;
    }

    .image-placeholder {
        height: 250px;
    }

    .experience-badge {
        bottom: -10px;
        left: 10px;
        padding: 14px 20px;
    }

    .exp-number {
        font-size: 2rem;
    }

    .image-border-accent {
        top: 12px;
        right: -12px;
        bottom: -12px;
        left: 12px;
    }

    /* Stats */
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .stat-item {
        padding: 20px 10px;
    }

    .stat-number {
        font-size: 2rem;
    }

    .stat-label {
        font-size: 0.8rem;
    }

    .stat-icon {
        font-size: 1.5rem;
    }

    /* Products - keep 2 cols, tighter spacing */
    .products-grid,
    .products-grid-3 {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .product-image {
        height: 130px;
    }

    .product-content {
        padding: 16px 12px 14px;
    }

    .product-title {
        font-size: 0.85rem;
        line-height: 1.3;
        margin-bottom: 6px;
    }

    .product-card .product-title {
        min-height: 2.6em;
    }

    .product-desc {
        font-size: 0.7rem;
        line-height: 1.45;
    }

    .product-count {
        font-size: 0.7rem;
    }

    .product-icon {
        width: 34px;
        height: 34px;
        font-size: 0.85rem;
        right: 12px;
        top: -17px;
    }

    .product-overlay .btn {
        font-size: 0.65rem;
        padding: 6px 12px;
    }

    /* Subsidiaries */
    .subsidiary-card {
        padding: 24px;
    }

    /* News */
    .news-image {
        height: 160px;
    }

    .news-content {
        padding: 16px;
    }

    .news-title {
        font-size: 1rem;
    }

    /* Contact */
    .contact-info-card {
        padding: 24px;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 12px 14px;
    }

    /* Footer */
    .footer-main {
        padding: 50px 0 30px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .footer-social {
        justify-content: flex-start;
    }

    /* Back to top */
    .back-to-top {
        width: 40px;
        height: 40px;
        bottom: 20px;
        right: 20px;
        font-size: 0.85rem;
    }

    /* Search Modal */
    .search-form input {
        padding: 14px 16px;
        font-size: 0.95rem;
    }

    .search-form button {
        padding: 14px 18px;
    }
}

/* ==================== SPECIAL: Parallax fallback for iOS ==================== */
@supports (-webkit-touch-callout: none) {
    .stats-section {
        background-attachment: scroll;
    }
}

/* ==================== PRINT STYLES ==================== */
@media print {
    .top-bar,
    #header,
    .hero-swiper,
    .scroll-down,
    .back-to-top,
    .search-modal {
        display: none;
    }

    body {
        color: #000;
        background: #fff;
    }

    .section {
        padding: 20px 0;
    }
}
