/* ═══════════════════════════════════════════
   ChenXuan Robotics - Responsive Styles
   ═══════════════════════════════════════════ */

/* ── 1440px and below ── */
@media (max-width: 1440px) {
    :root { --container-max: 1200px; }
    .header-container {
        grid-template-columns: clamp(132px, 10vw, 160px) minmax(600px, 1fr) auto;
        padding: 0 24px;
        column-gap: clamp(26px, 2.4vw, 42px);
    }
    .site-logo { margin-right: 0; }
    .logo-text { font-size: 34px; letter-spacing: 2px; }
    .nav-menu { gap: clamp(22px, 2vw, 34px); }
    .nav-menu > .menu-item { margin-right: 0; }
    .nav-menu > .menu-item > a { font-size: 16px; }
    .header-right .language-switcher,
    .header-search-btn { margin-right: 10px; }
    .lang-btn { gap: 6px; font-size: 14px; }
    .lang-btn svg:first-child { width: 18px; height: 18px; }
    .lang-arrow { width: 10px; }
    .header-auth { padding: 0 8px; }
    .header-auth a { font-size: 13px; }
    .site-header--latin .header-container {
        grid-template-columns: clamp(160px, 13vw, 205px) minmax(0, 1fr) auto;
        column-gap: 16px;
    }
    .site-header--latin .logo-text { font-size: 30px; letter-spacing: 1px; }
    .site-header--latin .nav-menu {
        justify-content: space-between;
        gap: clamp(14px, 1.25vw, 22px);
    }
    .site-header--latin .nav-menu > .menu-item > a {
        font-size: 13px;
        gap: 5px;
    }
    .site-header--latin .nav-hot-badge {
        min-width: 31px;
        height: 17px;
        padding: 0 5px;
        font-size: 9px;
    }
    .site-header--latin .lang-btn {
        max-width: 92px;
        overflow: hidden;
        font-size: 13px;
    }
    .site-header--latin .lang-btn span {
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .mega-menu-panel--product-cards .mega-menu-inner {
        max-width: calc(100vw - 96px);
    }
    .mega-product-grid {
        row-gap: 16px;
        column-gap: 24px;
    }
    .mega-product-card {
        padding: 6px 8px 8px;
    }
    .mega-product-title {
        min-height: 24px;
        font-size: 16px;
    }
    .mega-product-brand {
        font-size: 15px;
    }
    .hero-title { font-size: 56px; }
    .section-title { font-size: 36px; }
    .footer-grid { gap: 30px; }
}

/* ── 1320px and below: keep long translated navs inside laptop widths ── */
@media (max-width: 1320px) {
    .header-auth { display: none; }
    .header-container {
        grid-template-columns: clamp(120px, 9vw, 144px) minmax(0, 1fr) auto;
        column-gap: 24px;
    }
    .nav-menu { gap: 20px; }
    .nav-menu > .menu-item { margin-right: 0; }
    .nav-menu > .menu-item > a { font-size: 16px; }
    .site-header--latin .header-container {
        grid-template-columns: 150px minmax(0, 1fr) auto;
        column-gap: 14px;
    }
    .site-header--latin .logo-text { font-size: 28px; }
    .site-header--latin .nav-menu { justify-content: space-between; gap: 12px; }
    .site-header--latin .nav-menu > .menu-item > a { font-size: 12.5px; }
}

/* ── 1200px and below ── */
@media (max-width: 1200px) {
    :root { --container-max: 960px; }
    .header-container {
        grid-template-columns: 120px minmax(0, 1fr) auto;
        column-gap: 20px;
    }
    .site-logo { margin-right: 0; }
    .nav-menu { gap: 18px; }
    .nav-menu > .menu-item { margin-right: 0; }
    .nav-menu > .menu-item > a { font-size: 15px; }
    .site-header--latin .nav-menu { justify-content: space-between; gap: 10px; }
    .site-header--latin .nav-menu > .menu-item > a { font-size: 12px; }
    .hero-title { font-size: 48px; }
    .footer-grid { grid-template-columns: 2fr repeat(3, 1fr); }
    .footer-col:nth-child(n+7) { display: none; }
    .mega-menu-inner { gap: 30px; }
    .mega-menu-panel--product-cards .mega-menu-inner {
        width: min(86vw, 960px);
        max-width: calc(100vw - 48px);
    }
    .mega-product-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
    .service-card-content h3 { font-size: 24px; }
}

/* ── 992px and below (Tablet) ── */
@media (max-width: 992px) {
    :root {
        --header-height: 64px;
        --container-padding: 20px;
    }

    /* Header */
    .header-container {
        display: flex;
        justify-content: space-between;
    }
    .main-nav { display: none; }
    .mobile-menu-toggle { display: flex; }
    .mobile-menu { display: block; }
    .header-right .header-search-btn,
    .header-right .language-switcher,
    .header-right .header-auth { display: none; }
    .site-header {
        background: #fff;
    }
    .site-header .logo-text {
        font-size: 28px;
    }

    /* Hero */
    .hero-section { min-height: 0; }
    .hero-slide-content { padding-top: var(--header-height); }
    .hero-slide-text { max-width: 100%; }
    .hero-slide-text h2 {
        font-size: 42px;
        line-height: 1.18;
        overflow-wrap: anywhere;
    }
    .hero-slide-text p { font-size: 17px; }
    .hero-title { font-size: 42px; }
    .hero-desc { font-size: 17px; }
    .hero-scroll-hint { display: none; }

    /* Product showcase */
    .showcase-slide-img { height: 50vw; max-height: 480px; }

    /* Products */
    .products-section { padding: 80px 0; }
    .product-family-grid { grid-template-columns: 1fr; gap: 20px; }
    .product-tabs { flex-wrap: wrap; }
    .product-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }

    /* Solutions */
    .solutions-section { padding: 80px 0; }
    .solution-card,
    .home-solutions-section .solution-card { height: 360px; }

    /* Service */
    .service-section { padding: 80px 0; }
    .service-grid { grid-template-columns: 1fr; }
    .service-card-large { min-height: 280px; }

    /* News */
    .news-section { padding: 80px 0; }
    .news-featured-grid { grid-template-columns: 1fr; gap: 24px; }
    .news-list-grid { grid-template-columns: 1fr; }

    /* Footer */
    .footer-grid { grid-template-columns: repeat(3, 1fr); }
    .footer-brand { grid-column: 1 / -1; }
    .footer-bottom-inner { flex-direction: column; gap: 12px; text-align: center; }
    .footer-legal { flex-wrap: wrap; justify-content: center; }

    /* Section headers */
    .section-title { font-size: 32px; }
    .section-header { margin-bottom: 40px; }

    /* Fixed sidebar */
    .fixed-sidebar { right: 12px; bottom: 80px; }
    .sidebar-btn { width: 44px; height: 44px; }
    .sidebar-btn:hover { width: 44px; height: 44px; }
    .sidebar-btn span { display: none; }

    /* Products page */
    .pls-sidebar { width: 220px; min-width: 220px; max-width: 220px; }
    .pls-grid { grid-template-columns: repeat(4, 1fr); padding: 32px 32px 60px; }
    .pls-banner { padding: 50px 32px 44px; }
    .pls-banner::after { left: 32px; }
    .pls-banner-title { font-size: 30px; }

    /* Download center */
    .dlc-sidebar { width: 200px; min-width: 200px; }
    .dlc-content { padding: 24px 28px 40px; }
    .dlc-list { grid-template-columns: 1fr; }
}

/* ── 768px and below (Small Tablet) ── */
@media (max-width: 768px) {
    .hero-slide-text h2 { font-size: 38px; }
    .hero-slide-text p { font-size: 16px; margin-bottom: 30px; }
    .hero-title { font-size: 36px; }
    .hero-desc { font-size: 16px; margin-bottom: 30px; }
    .hero-actions { flex-direction: column; }
    .hero-actions .btn { width: 100%; justify-content: center; }

    .product-family-text { padding: 24px 24px 0; }
    .product-family-name { font-size: 20px; }
    .product-family-thumbs { padding: 16px 24px; gap: 12px; }
    .product-tabs { gap: 6px; }
    .product-tab { padding: 10px 18px; font-size: 13px; }
    .product-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }

    .solution-card,
    .home-solutions-section .solution-card { height: 320px; }
    .solution-card-content,
    .home-solutions-section .solution-card-content { padding: 28px 24px; }
    .solution-title,
    .home-solutions-section .solution-title { font-size: 20px; }

    .service-card-content { padding: 28px; }
    .service-card-content h3 { font-size: 22px; }

    .news-card-title { font-size: 18px; }
    .news-list-content h4 { font-size: 14px; }

    .footer-grid { grid-template-columns: repeat(2, 1fr); gap: 24px; }

    .cookie-notice-inner { flex-direction: column; text-align: center; }

    /* Consult modal */
    .consult-modal { padding: 28px 20px; }
    .consult-form-row { grid-template-columns: 1fr; gap: 12px; }

    /* Products page */
    .pls-page { flex-direction: column !important; padding-top: var(--header-height); }
    .pls-sidebar {
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
        height: auto;
        position: relative;
        top: auto;
        margin-top: 0;
        border-right: none;
        border-bottom: 1px solid #eee;
        max-height: 50vh;
    }
    .pls-content { padding-top: 0; }
    .pls-grid { grid-template-columns: repeat(3, 1fr); padding: 20px; }
    .pls-banner { padding: 30px 20px; }
    .pls-banner::after { left: 20px; }
    .pls-banner-title { font-size: 24px; }

    /* Download center */
    .dlc-body { flex-direction: column; }
    .dlc-sidebar {
        width: 100% !important;
        min-width: 100% !important;
        height: auto;
        position: relative;
        top: auto;
        border-right: none;
        border-bottom: 1px solid #eee;
        max-height: 50vh;
    }
    .dlc-sidebar-inner { padding: 16px 0; }
    .dlc-tree-item { padding: 8px 20px; font-size: 14px; }
    .dlc-tree-parent { font-size: 15px; }
    .dlc-content { padding: 20px; }
    .dlc-group-title { font-size: 18px; }
    .dlc-list { grid-template-columns: 1fr; }
    .dlc-row { padding: 16px 12px; }
    .dlc-file-name { font-size: 14px; }
    .dlc-row-date { font-size: 14px; }
}

/* ── 576px and below (Mobile) ── */
@media (max-width: 576px) {
    :root { --container-padding: 16px; }

    .site-wrapper,
    .container,
    .hero-section,
    .hero-swiper,
    .hero-swiper .swiper-wrapper,
    .hero-swiper .swiper-slide,
    .products-section,
    .solutions-section,
    .service-section,
    .news-section {
        max-width: 100vw;
        overflow-x: hidden;
    }

    .hero-slide-artwork .hero-slide-bg,
    .hero-slide-artwork .hero-artwork-img {
        width: 100%;
        max-width: 100vw;
    }

    .hero-section { min-height: 0; }
    .hero-slide-content { padding-left: 16px; padding-right: 16px; }
    .hero-slide-text h2 { font-size: 32px; line-height: 1.22; }
    .hero-title-part { display: block; }
    .hero-slide-text p { font-size: 15px; }
    .hero-slide-actions { gap: 12px; }
    .hero-slide-actions .btn {
        min-width: 0;
        padding-left: 22px;
        padding-right: 22px;
    }
    .hero-title { font-size: 30px; }
    .hero-desc { font-size: 15px; }

    .section-title { font-size: 26px; }
    .section-header,
    .section-title,
    .section-desc {
        max-width: 100%;
        overflow-wrap: anywhere;
        word-break: break-word;
    }
    .section-title {
        white-space: normal !important;
        word-break: break-all;
        line-break: anywhere;
    }
    .section-desc { font-size: 15px; }
    .section-label { font-size: 11px; letter-spacing: 2px; }

    .products-section,
    .solutions-section,
    .service-section,
    .news-section { padding: 60px 0; }

    .showcase-slide-img { height: 60vw; max-height: 360px; }
    .product-family-text { padding: 20px 20px 0; }
    .product-family-name { font-size: 18px; }
    .product-family-desc { font-size: 14px; }
    .product-family-thumbs { padding: 12px 20px; gap: 10px; }
    .product-thumb-img { width: 44px; height: 44px; }
    .product-family-img { min-height: 160px; }
    .product-family-placeholder { min-height: 160px; }
    .product-tabs { overflow-x: auto; flex-wrap: nowrap; justify-content: flex-start; padding-bottom: 8px; -webkit-overflow-scrolling: touch; }
    .product-tab { flex-shrink: 0; }
    .product-grid { grid-template-columns: 1fr; }
    .product-card-info h3 { font-size: 16px; }

    .solution-card { height: 300px; }
    .solution-card-content { padding: 24px 20px; }
    .solution-title { font-size: 18px; }
    .solution-desc { font-size: 13px; }

    .service-card { min-height: 220px; }
    .service-card-content { padding: 24px 20px; }
    .service-card-content h3 { font-size: 20px; }
    .service-card-content p { font-size: 13px; }

    .news-card-body { padding: 20px; }
    .news-card-title { font-size: 16px; }


    .footer-main { padding: 40px 0; }
    .footer-grid { grid-template-columns: 1fr; gap: 30px; }
    .footer-col { border-bottom: 1px solid var(--color-border); padding-bottom: 20px; }
    .footer-col:last-child { border-bottom: none; }

    .footer-bottom { padding: 16px 0; }
    .footer-legal { gap: 12px; }

    /* Swiper navigation */
    .swiper-btn-prev, .swiper-btn-next { width: 36px; height: 36px; }
    .swiper-nav { padding: 0 4px; }

    /* Mobile menu */
    .mobile-menu-header { min-height: 76px; padding: 18px 20px; }
    .mobile-menu .logo-text { font-size: 24px; letter-spacing: 2px; }
    .mobile-menu-body { padding: 8px 20px 20px; }
    .mobile-nav-item > a { font-size: 15px; padding: 12px 0; }
    .mobile-menu-footer { padding: 14px 20px max(18px, env(safe-area-inset-bottom)); }
    .mobile-lang-switcher { margin-bottom: 10px; }
    .mobile-lang-list a { min-height: 32px; padding: 6px 10px; font-size: 12px; }
    .mobile-auth-links { gap: 10px; }
    .btn-login-mobile,
    .btn-register-mobile {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .btn-consult-mobile {
        width: 100%;
        flex: 0 0 100%;
        min-height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Fixed sidebar */
    .fixed-sidebar { right: 8px; bottom: 70px; }
    .sidebar-btn { width: 40px; height: 40px; }
    .sidebar-btn svg { width: 18px; height: 18px; }

    /* Cursor follower - disable on mobile */
    .cursor-follower { display: none; }

    /* Products page */
    .pls-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .pls-banner-title { font-size: 22px; }
    .pls-banner-desc { font-size: 13px; }

    /* Download center */
    .dlc-search-inner { margin: 0 16px; }
    .dlc-content { padding: 16px; }
    .dlc-group-title { font-size: 16px; }
    .dlc-row { flex-direction: column; gap: 6px; padding: 14px 8px; }
    .dlc-row-info { min-width: 0; align-items: flex-start; }
    .dlc-file-name { min-width: 0; overflow-wrap: anywhere; word-break: break-word; }
    .dlc-row-right { text-align: left; }
    .dlc-row-date { font-size: 13px; color: #999; }
    .dlc-file-name { font-size: 13px; }

    /* Awards */
    .awards-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
    .award-number { font-size: 36px; }
    .culture-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── 400px and below ── */
@media (max-width: 400px) {
    .hero-slide-text h2 { font-size: 30px; }
    .hero-slide-text p { font-size: 14px; }
    .hero-title { font-size: 26px; }
    .hero-desc { font-size: 14px; }
    .section-title { font-size: 22px; }
}

/* ── 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;
    }
    .hero-title-line { opacity: 1; }
    .scroll-wheel { animation: none; }
    .loader-bar-fill { animation: none; width: 100%; }
}

/* ── Print Styles ── */
@media print {
    .site-header, .fixed-sidebar, .cookie-notice,
    .hero-scroll-hint, .page-loader { display: none !important; }
    body { background: white; color: black; }
    .section-dark { background: white; }
    .section-title, .hero-title { color: black; }
}

/* Homepage restore responsive refinements */
@media (max-width: 991px) {
    .home-products-section,
    .home-solutions-section,
    .home-service-section,
    .home-news-section {
        padding: 72px 0;
    }

    .home-section-header {
        margin-bottom: 36px;
    }

    .product-family-grid,
    .service-grid,
    .news-featured-grid,
    .news-list-grid {
        grid-template-columns: 1fr;
        width: 100%;
        min-width: 0;
    }

    .product-family-card {
        min-height: auto;
        width: 100%;
        min-width: 0;
    }

    .product-family-text {
        min-height: 0;
        min-width: 0;
        padding: 28px 24px 20px;
    }

    .product-family-name,
    .product-family-desc {
        max-width: 100%;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .product-feature-list {
        gap: 8px;
        margin-top: 18px;
    }

    .product-feature-list span {
        padding: 8px 10px;
        font-size: 12px;
    }

    .product-family-img {
        min-height: 260px;
        height: 260px;
    }

    .home-solutions-section .solutions-carousel {
        padding-right: 20px;
        padding-left: 20px;
    }

    .solution-card,
    .home-solutions-section .solution-card {
        height: 360px;
    }

    .service-card,
    .service-card-large {
        min-height: 300px;
    }

    .sidebar-brand {
        width: 40px;
        min-height: 38px;
        padding: 6px 4px;
        font-size: 13px;
    }
}

@media (max-width: 575px) {
    .home-products-section,
    .home-solutions-section,
    .home-service-section,
    .home-news-section {
        padding: 56px 0;
    }

    .home-section-header .section-title {
        font-size: 26px;
        padding: 0 8px;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .home-section-header .section-desc {
        font-size: 15px;
    }

    .home-section-header .section-title span {
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .home-products-section .container {
        width: calc(100vw - 32px) !important;
        max-width: calc(100vw - 32px) !important;
        padding-right: 0 !important;
        padding-left: 0 !important;
        margin-right: auto;
        margin-left: auto;
        overflow: visible;
    }

    .home-products-section .product-family-grid {
        width: 100%;
        max-width: 100%;
        margin-right: 0;
        margin-left: 0;
    }

    .home-products-section .product-family-card,
    .home-products-section .product-family-text,
    .home-products-section .product-family-name,
    .home-products-section .product-family-desc {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box;
    }

    .home-products-section .product-family-desc {
        display: block;
        width: calc(100vw - 72px) !important;
        max-width: calc(100vw - 72px) !important;
        white-space: normal !important;
        overflow: visible;
        overflow-wrap: anywhere !important;
        word-break: break-all !important;
        line-break: anywhere;
    }

    .home-products-section .home-mobile-break {
        display: block;
    }

    .home-solutions-section .home-section-header {
        max-width: calc(100vw - 32px);
        padding-right: 0;
        padding-left: 0;
    }

    .home-solutions-section .section-title,
    .home-solutions-section .section-title span {
        max-width: 100%;
        white-space: normal !important;
        overflow-wrap: anywhere !important;
        word-break: break-all !important;
        line-break: anywhere;
    }

    .home-solutions-section .section-title {
        font-size: 24px;
        line-height: 1.32;
    }

    .product-family-text {
        padding: 24px 18px 18px !important;
    }

    .product-family-img {
        min-height: 220px;
        height: 220px;
    }

    .solution-card,
    .home-solutions-section .solution-card {
        height: 330px;
    }

    .solution-card-content,
    .home-solutions-section .solution-card-content {
        padding: 24px 20px;
    }

    .solution-desc,
    .home-solutions-section .solution-desc {
        max-width: 100%;
    }

    .service-card,
    .service-card-large {
        min-height: 270px;
    }

    .service-card-content {
        padding: 26px 20px;
    }
}
