/* ============================================
   RESPONSIVE STYLES
   ============================================ */

/* Large devices (desktops, less than 1200px) */
@media (max-width: 1199.98px) {
    .container {
        max-width: 960px;
    }
    
    .hero-title {
        font-size: 3rem;
    }
    
    .section-title {
        font-size: 2.25rem;
    }
    
    .product-card .product-actions {
        flex-direction: column;
    }
}

/* Medium devices (tablets, less than 992px) */
@media (max-width: 991.98px) {
    .container {
        max-width: 720px;
    }
    
    /* Header responsive */
    .site-header .header-inner {
        flex-wrap: wrap;
    }
    
    .main-navigation {
        order: 3;
        width: 100%;
        margin-top: 1rem;
    }
    
    .nav-menu {
        display: none;
        flex-direction: column;
        width: 100%;
    }
    
    .nav-menu.active {
        display: flex;
    }
    
    .menu-toggle {
        display: flex;
    }
    
    .header-actions {
        margin-left: auto;
    }
    
    /* Hero section */
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.125rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .hero-buttons .btn {
        width: 100%;
        max-width: 300px;
        margin-bottom: 1rem;
    }
    
    /* Trust indicators */
    .indicator-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* Products grid */
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Services */
    .service-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Footer */
    .footer-main .row > div {
        margin-bottom: 2rem;
    }
    
    /* Blog grid */
    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Small devices (landscape phones, less than 768px) */
@media (max-width: 767.98px) {
    .container {
        max-width: 540px;
    }
    
    /* Typography */
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.75rem;
    }
    
    h3 {
        font-size: 1.5rem;
    }
    
    /* Hero section */
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-content {
        padding: 2rem 0;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .stat-number {
        font-size: 2.5rem;
    }
    
    /* Trust indicators */
    .indicator-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .indicator-item {
        padding: 1rem;
    }
    
    .indicator-number {
        font-size: 2rem;
    }
    
    /* Products grid */
    .products-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .product-card {
        max-width: 400px;
        margin: 0 auto;
    }
    
    /* Services */
    .service-cards {
        grid-template-columns: 1fr;
    }
    
    .service-card {
        padding: 1.5rem;
    }
    
    /* Technology grid */
    .tech-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .tech-item {
        padding: 1rem;
    }
    
    /* Testimonials */
    .testimonial-item {
        padding: 1.5rem;
    }
    
    .testimonial-author {
        flex-direction: column;
        text-align: center;
    }
    
    .testimonial-avatar {
        margin-bottom: 1rem;
    }
    
    /* Blog grid */
    .blog-grid {
        grid-template-columns: 1fr;
    }
    
    /* Newsletter */
    .newsletter-form-wrapper {
        margin-top: 2rem;
    }
    
    /* Footer */
    .footer-bottom .row > div {
        text-align: center;
        margin-bottom: 1rem;
    }
    
    .footer-links .separator {
        display: none;
    }
    
    .footer-links a {
        display: block;
        margin: 0.5rem 0;
    }
    
    /* About page */
    .team-section .row > div {
        margin-bottom: 2rem;
    }
    
    /* Contact page */
    .contact-form-wrapper {
        margin-top: 2rem;
    }
    
    /* Case studies */
    .case-card {
        margin-bottom: 1.5rem;
    }
}

/* 统一所有 Hero 的高度 */
.about-hero,
.case-hero,
.contact-hero {
    min-height: 600px;
    display: flex;
    align-items: center;
}

/* 响应式调整 - 平板 */
@media (max-width: 991.98px) {
    .about-hero,
    .case-hero,
    .contact-hero {
        min-height: 500px;
    }
    
    .hero-title {
        font-size: 3rem !important;
    }
    
    .hero-subtitle {
        font-size: 1.25rem !important;
    }
}

/* 响应式调整 - 手机 */
@media (max-width: 767.98px) {
    .about-hero,
    .case-hero,
    .contact-hero {
        min-height: auto;
        padding: 3rem 0;
    }
    
    .contact-summary {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
    
    .summary-item {
        width: 100%;
        max-width: 280px;
    }
}

/* Extra small devices (portrait phones, less than 576px) */
@media (max-width: 575.98px) {
    .container {
        padding: 0 1rem;
    }
    
    /* Typography */
    .hero-title {
        font-size: 1.75rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    /* Header */
    .header-top {
        display: none;
    }
    
    .site-branding img {
        max-height: 40px;
    }
    
    /* Hero section */
    .hero-title br {
        display: none;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .hero-buttons .btn {
        padding: 0.75rem 1rem;
    }
    
    /* Trust indicators */
    .indicator-grid {
        grid-template-columns: 1fr;
    }
    
    .cert-logos {
        flex-direction: column;
        align-items: center;
    }
    
    .cert-logo {
        margin-bottom: 1rem;
    }
    
    /* Product filter */
    .filter-buttons {
        flex-direction: column;
    }
    
    .filter-buttons .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    /* Technology grid */
    .tech-grid {
        grid-template-columns: 1fr;
    }
    
    /* Testimonials */
    .testimonial-content {
        font-size: 1rem;
    }
    
    .logos-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* CTA section */
    .cta-title {
        font-size: 1.75rem;
    }
    
    .cta-buttons {
        flex-direction: column;
    }
    
    .cta-buttons .btn {
        width: 100%;
        max-width: 300px;
    }
    
    .cta-section .contact-methods {
        flex-direction: column;
        align-items: center;
    }
    
    .cta-section .contact-method {
        width: 100%;
        max-width: 250px;
    }
    
    /* Newsletter */
    .newsletter-form {
        padding: 0;
    }
    
    /* Footer */
    .footer-main .row > div {
        text-align: center;
    }
    
    .contact-info {
        text-align: center;
    }
    
    .contact-item {
        justify-content: center;
    }
    
    /* Modal */
    .modal-dialog {
        margin: 0.5rem;
    }
    
    .modal-content {
        padding: 1rem;
    }
}

/* Specific responsive fixes for navigation */
@media (max-width: 991.98px) {
    .menu-toggle {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 30px;
        height: 24px;
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 0;
        z-index: 10;
    }
    
    .menu-toggle-bar {
        width: 100%;
        height: 3px;
        background: var(--primary-color);
        border-radius: 3px;
        transition: all 0.3s ease;
    }
    
    .menu-toggle.active .menu-toggle-bar:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .menu-toggle.active .menu-toggle-bar:nth-child(2) {
        opacity: 0;
    }
    
    .menu-toggle.active .menu-toggle-bar:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }
    
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 400px;
        height: 100vh;
        background: var(--white);
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
        padding: 80px 2rem 2rem;
        transition: right 0.3s ease;
        z-index: 9;
        overflow-y: auto;
    }
    
    .nav-menu.active {
        right: 0;
    }
    
    .nav-menu li {
        margin: 0;
        border-bottom: 1px solid var(--border-light);
    }
    
    .nav-menu a {
        display: block;
        padding: 1rem 0;
        color: var(--text-dark);
    }
    
    .nav-menu .sub-menu {
        position: static;
        box-shadow: none;
        background: var(--light-gray);
        padding-left: 1rem;
        display: none;
    }
    
    .nav-menu .menu-item-has-children > a::after {
        content: '›';
        float: right;
        transform: rotate(90deg);
    }
    
    .nav-menu .menu-item-has-children.active > a::after {
        transform: rotate(-90deg);
    }
    
    .nav-menu .menu-item-has-children.active > .sub-menu {
        display: block;
    }
}

/* Print styles */
@media print {
    .site-header,
    .site-footer,
    .hero-video-bg,
    .scroll-down,
    .btn,
    .social-links,
    .testimonial-slider .nav,
    .back-to-top {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.5;
        color: #000;
        background: #fff;
    }
    
    .container {
        max-width: 100%;
        padding: 0;
    }
    
    a {
        color: #000;
        text-decoration: none;
    }
    
    a[href]::after {
        content: " (" attr(href) ")";
    }
    
    img {
        max-width: 100% !important;
        height: auto !important;
    }
    
    .page-break {
        page-break-before: always;
    }
}

/* High resolution screens */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* High-res images and icons */
    .logo img,
    .cert-logo img,
    .client-logo img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --body-bg: #121212;
        --text-primary: #ffffff;
        --text-secondary: #b0b0b0;
        --card-bg: #1e1e1e;
        --border-color: #333333;
    }
    
    body {
        background-color: var(--body-bg);
        color: var(--text-primary);
    }
    
    .product-card,
    .service-card,
    .blog-card,
    .tech-item,
    .testimonial-item {
        background-color: var(--card-bg);
        border-color: var(--border-color);
    }
    
    .btn-light {
        color: var(--text-dark);
    }
}

/* 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;
    }
    
    .fade-in-up,
    .fade-in-left,
    .fade-in-right {
        opacity: 1;
        transform: none;
    }
    
    .scroll-down {
        animation: none;
    }
}

/* Touch devices */
@media (hover: none) and (pointer: coarse) {
    .quick-view-btn {
        opacity: 1;
        transform: translateY(0);
    }
    
    .product-card:hover {
        transform: none;
    }
    
    .service-card:hover,
    .blog-card:hover,
    .tech-item:hover {
        transform: none;
    }
    
    /* Larger touch targets */
    .btn,
    .nav-menu a,
    .filter-buttons .btn,
    .product-actions .btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Prevent zoom on input focus */
    input,
    select,
    textarea {
        font-size: 16px;
    }
}