/* =====================================================
   MAIRUIK - Responsive Styles
   Beijing Mairuikang Medical Equipment Co., Ltd.
   ===================================================== */

/* =====================================================
   EXTRA LARGE SCREENS (1400px and above)
   ===================================================== */
@media (min-width: 1400px) {
    :root {
        --container-max: 1320px;
        --fs-hero: 5rem;
    }
    
    .hero-title {
        font-size: 5rem;
    }
    
    .section {
        padding: var(--space-32) 0;
    }
    
    .container {
        max-width: 1320px;
    }
}

/* =====================================================
   LARGE DESKTOPS (1200px - 1399px)
   ===================================================== */
@media (min-width: 1200px) and (max-width: 1399px) {
    :root {
        --container-max: 1140px;
    }
    
    .hero-title {
        font-size: 4.5rem;
    }
    
    .footer-grid {
        grid-template-columns: 2fr 1fr 1fr 1fr;
    }
}

/* =====================================================
   DESKTOPS (992px - 1199px)
   ===================================================== */
@media (min-width: 992px) and (max-width: 1199px) {
    :root {
        --container-max: 960px;
        --fs-hero: 3.5rem;
    }
    
    .hero-title {
        font-size: 3.5rem;
    }
    
    .hero-stats {
        gap: var(--space-8);
    }
    
    .stat-number {
        font-size: var(--fs-4xl);
    }
    
    .about-grid {
        gap: var(--space-12);
    }
    
    .app-showcase {
        gap: var(--space-12);
    }
    
    .footer-grid {
        grid-template-columns: 2fr 1fr 1fr;
    }
    
    .footer-column:last-child {
        grid-column: span 3;
        margin-top: var(--space-8);
    }
    
    .nav-menu {
        gap: var(--space-6);
    }
    
    .section-title {
        font-size: var(--fs-4xl);
    }
    
    .card {
        padding: var(--space-6);
    }
}

/* =====================================================
   TABLETS (768px - 991px)
   ===================================================== */
@media (min-width: 768px) and (max-width: 991px) {
    :root {
        --container-max: 720px;
        --container-padding: 1.5rem;
        --fs-hero: 3rem;
    }
    
    .section {
        padding: var(--space-16) 0;
    }
    
    .hero {
        min-height: auto;
        padding: 120px 0 80px;
    }
    
    .hero-title {
        font-size: 3rem;
    }
    
    .hero-subtitle {
        font-size: var(--fs-xl);
    }
    
    .hero-stats {
        flex-wrap: wrap;
        gap: var(--space-6);
    }
    
    .stat-item {
        flex: 1 1 45%;
    }
    
    .stat-number {
        font-size: var(--fs-3xl);
    }
    
    .about-grid,
    .contact-grid,
    .app-showcase {
        grid-template-columns: 1fr;
        gap: var(--space-12);
    }
    
    .about-image {
        order: -1;
    }
    
    .section-title {
        font-size: var(--fs-4xl);
    }
    
    .section-description {
        font-size: var(--fs-base);
    }
    
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .values-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .team-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .news-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-8);
    }
    
    .footer-brand {
        grid-column: span 2;
    }
    
    .page-header {
        padding: 140px 0 80px;
    }
    
    .page-title {
        font-size: var(--fs-5xl);
    }
    
    .nav-menu {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background-color: var(--color-white);
        flex-direction: column;
        padding: var(--space-6);
        box-shadow: var(--shadow-lg);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all var(--transition-base);
        gap: var(--space-4);
        z-index: 999;
    }
    
    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    .nav-item {
        width: 100%;
    }
    
    .nav-link {
        width: 100%;
        justify-content: space-between;
    }
    
    .nav-dropdown {
        position: static;
        box-shadow: none;
        padding: var(--space-2);
        margin-top: var(--space-2);
        background-color: var(--color-gray-100);
    }
    
    .menu-toggle {
        display: flex;
    }
    
    .phone-mockup {
        width: 260px;
        height: 520px;
    }
    
    .services-tabs {
        gap: var(--space-2);
    }
    
    .service-tab {
        padding: var(--space-2) var(--space-4);
        font-size: var(--fs-sm);
    }
    
    .timeline::before {
        left: 30px;
    }
    
    .timeline-item {
        width: 100%;
        padding-left: 80px;
        padding-right: 0;
    }
    
    .timeline-item:nth-child(even) {
        margin-left: 0;
        padding-left: 80px;
    }
    
    .timeline-dot {
        left: 18px !important;
        right: auto !important;
    }
    
    .partners-grid {
        gap: var(--space-8);
    }
    
    .partner-logo {
        width: 120px;
        height: 70px;
    }
}

/* =====================================================
   MOBILE DEVICES (576px - 767px)
   ===================================================== */
@media (min-width: 576px) and (max-width: 767px) {
    :root {
        --container-max: 540px;
        --container-padding: 1rem;
        --fs-hero: 2.5rem;
        --fs-h1: 2.5rem;
        --fs-h2: 2rem;
        --fs-h3: 1.75rem;
    }
    
    .section {
        padding: var(--space-12) 0;
    }
    
    .hero {
        min-height: auto;
        padding: 100px 0 60px;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: var(--fs-lg);
    }
    
    .hero-buttons {
        flex-direction: column;
    }
    
    .hero-buttons .btn {
        width: 100%;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: var(--space-4);
    }
    
    .stat-item {
        text-align: center;
    }
    
    .stat-number {
        font-size: var(--fs-3xl);
    }
    
    .about-grid,
    .contact-grid,
    .app-showcase {
        grid-template-columns: 1fr;
        gap: var(--space-8);
    }
    
    .about-image {
        order: -1;
    }
    
    .section-header {
        margin-bottom: var(--space-12);
    }
    
    .section-title {
        font-size: var(--fs-3xl);
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .values-grid {
        grid-template-columns: 1fr;
    }
    
    .team-grid {
        grid-template-columns: 1fr;
    }
    
    .news-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        gap: var(--space-6);
    }
    
    .footer-brand {
        grid-column: span 1;
    }
    
    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-legal {
        flex-direction: column;
        gap: var(--space-3);
    }
    
    .page-header {
        padding: 120px 0 60px;
    }
    
    .page-title {
        font-size: var(--fs-4xl);
    }
    
    .page-subtitle {
        font-size: var(--fs-base);
    }
    
    .nav-menu {
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        background-color: var(--color-white);
        flex-direction: column;
        padding: var(--space-4);
        box-shadow: var(--shadow-lg);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all var(--transition-base);
        gap: var(--space-3);
        z-index: 999;
    }
    
    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    .nav-item {
        width: 100%;
    }
    
    .nav-link {
        width: 100%;
        justify-content: space-between;
        padding: var(--space-3);
    }
    
    .nav-dropdown {
        position: static;
        box-shadow: none;
        padding: var(--space-2);
        margin-top: var(--space-2);
        background-color: var(--color-gray-100);
    }
    
    .menu-toggle {
        display: flex;
    }
    
    .phone-mockup {
        width: 240px;
        height: 480px;
    }
    
    .services-tabs {
        flex-direction: column;
        align-items: stretch;
    }
    
    .service-tab {
        text-align: center;
    }
    
    .timeline {
        padding-left: var(--space-6);
    }
    
    .timeline::before {
        left: 15px;
    }
    
    .timeline-item {
        width: 100%;
        padding-left: 50px;
        padding-right: 0;
    }
    
    .timeline-item:nth-child(even) {
        margin-left: 0;
        padding-left: 50px;
    }
    
    .timeline-dot {
        left: 3px !important;
        right: auto !important;
        width: 24px;
        height: 24px;
    }
    
    .timeline-content {
        padding: var(--space-4);
    }
    
    .timeline-year {
        font-size: var(--fs-2xl);
    }
    
    .partners-grid {
        flex-direction: column;
        gap: var(--space-6);
    }
    
    .partner-logo {
        width: 140px;
        height: 70px;
    }
    
    .card {
        padding: var(--space-6);
    }
    
    .card-icon {
        width: 60px;
        height: 60px;
    }
    
    .card-icon svg {
        width: 30px;
        height: 30px;
    }
    
    .cta-title {
        font-size: var(--fs-3xl);
    }
    
    .cta-text {
        font-size: var(--fs-base);
    }
    
    .store-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .contact-item {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .form-group {
        margin-bottom: var(--space-4);
    }
    
    .btn-lg {
        padding: var(--space-4) var(--space-8);
        font-size: var(--fs-base);
    }
    
    .scroll-top {
        width: 45px;
        height: 45px;
        bottom: 20px;
        right: 20px;
    }
}

/* =====================================================
   SMALL MOBILE DEVICES (up to 575px)
   ===================================================== */
@media (max-width: 575px) {
    :root {
        --container-max: 100%;
        --container-padding: 0.75rem;
        --fs-hero: 2rem;
        --fs-h1: 2rem;
        --fs-h2: 1.75rem;
        --fs-h3: 1.5rem;
    }
    
    .section {
        padding: var(--space-10) 0;
    }
    
    .container {
        padding: 0 var(--space-4);
    }
    
    .hero {
        min-height: auto;
        padding: 90px 0 50px;
    }
    
    .hero-badge {
        font-size: var(--fs-xs);
        padding: var(--space-1) var(--space-3);
    }
    
    .hero-title {
        font-size: 2rem;
        margin-bottom: var(--space-4);
    }
    
    .hero-subtitle {
        font-size: var(--fs-base);
        margin-bottom: var(--space-6);
    }
    
    .hero-buttons {
        flex-direction: column;
        gap: var(--space-3);
    }
    
    .hero-buttons .btn {
        width: 100%;
        padding: var(--space-3) var(--space-6);
    }
    
    .hero-stats {
        flex-direction: column;
        gap: var(--space-4);
        margin-top: var(--space-10);
        padding-top: var(--space-6);
    }
    
    .stat-item {
        text-align: center;
    }
    
    .stat-number {
        font-size: var(--fs-3xl);
    }
    
    .stat-label {
        font-size: var(--fs-xs);
    }
    
    .about-grid,
    .contact-grid,
    .app-showcase {
        grid-template-columns: 1fr;
        gap: var(--space-6);
    }
    
    .about-image {
        order: -1;
    }
    
    .about-image::before {
        top: -10px;
        left: -10px;
        right: 10px;
        bottom: 10px;
    }
    
    .about-content {
        padding: var(--space-4);
    }
    
    .section-header {
        margin-bottom: var(--space-10);
    }
    
    .section-badge {
        font-size: var(--fs-xs);
        padding: var(--space-1) var(--space-3);
    }
    
    .section-title {
        font-size: var(--fs-3xl);
        margin-bottom: var(--space-4);
    }
    
    .section-description {
        font-size: var(--fs-sm);
    }
    
    .features-grid {
        grid-template-columns: 1fr;
        gap: var(--space-6);
    }
    
    .feature-card {
        padding: var(--space-8);
    }
    
    .feature-icon {
        width: 100px;
        height: 100px;
    }
    
    .feature-icon svg {
        width: 50px;
        height: 50px;
    }
    
    .values-grid {
        grid-template-columns: 1fr;
        gap: var(--space-6);
    }
    
    .value-card {
        padding: var(--space-6);
    }
    
    .value-icon {
        width: 80px;
        height: 80px;
    }
    
    .value-icon svg {
        width: 40px;
        height: 40px;
    }
    
    .team-grid {
        grid-template-columns: 1fr;
        gap: var(--space-6);
    }
    
    .team-card {
        padding: var(--space-6);
    }
    
    .team-avatar {
        width: 120px;
        height: 120px;
    }
    
    .team-avatar svg {
        width: 60px;
        height: 60px;
    }
    
    .news-grid {
        grid-template-columns: 1fr;
        gap: var(--space-6);
    }
    
    .news-card {
        margin-bottom: 0;
    }
    
    .news-image {
        height: 180px;
    }
    
    .news-content {
        padding: var(--space-4);
    }
    
    .news-title {
        font-size: var(--fs-lg);
    }
    
    .footer {
        padding: var(--space-12) 0 var(--space-4);
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        gap: var(--space-6);
    }
    
    .footer-brand {
        max-width: 100%;
    }
    
    .footer-logo svg {
        height: 40px;
    }
    
    .footer-description {
        font-size: var(--fs-sm);
    }
    
    .footer-social {
        justify-content: center;
    }
    
    .footer-column h4 {
        font-size: var(--fs-base);
        margin-bottom: var(--space-4);
    }
    
    .footer-links li {
        margin-bottom: var(--space-2);
    }
    
    .footer-links a {
        font-size: var(--fs-sm);
    }
    
    .footer-bottom {
        flex-direction: column;
        text-align: center;
        padding-top: var(--space-6);
        gap: var(--space-3);
    }
    
    .footer-copyright {
        font-size: var(--fs-xs);
    }
    
    .footer-legal {
        flex-direction: column;
        gap: var(--space-2);
    }
    
    .footer-legal a {
        font-size: var(--fs-xs);
    }
    
    .page-header {
        padding: 100px 0 50px;
    }
    
    .page-title {
        font-size: var(--fs-4xl);
    }
    
    .page-subtitle {
        font-size: var(--fs-sm);
    }
    
    .breadcrumb {
        font-size: var(--fs-xs);
    }
    
    .nav-menu {
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        background-color: var(--color-white);
        flex-direction: column;
        padding: var(--space-4);
        box-shadow: var(--shadow-lg);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all var(--transition-base);
        gap: var(--space-2);
        z-index: 999;
        max-height: calc(100vh - 60px);
        overflow-y: auto;
    }
    
    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    .nav-item {
        width: 100%;
    }
    
    .nav-link {
        width: 100%;
        justify-content: space-between;
        padding: var(--space-3);
        font-size: var(--fs-sm);
    }
    
    .nav-dropdown {
        position: static;
        box-shadow: none;
        padding: var(--space-2);
        margin-top: var(--space-2);
        background-color: var(--color-gray-100);
        font-size: var(--fs-sm);
    }
    
    .dropdown-item {
        padding: var(--space-2) var(--space-3);
    }
    
    .menu-toggle {
        display: flex;
    }
    
    .menu-toggle span {
        width: 24px;
        height: 2px;
    }
    
    .phone-mockup {
        width: 200px;
        height: 400px;
        border-radius: 30px;
        padding: 8px;
    }
    
    .phone-screen {
        border-radius: 22px;
    }
    
    .services-tabs {
        flex-direction: column;
        align-items: stretch;
        gap: var(--space-2);
    }
    
    .service-tab {
        padding: var(--space-3) var(--space-4);
        font-size: var(--fs-sm);
        text-align: center;
    }
    
    .timeline {
        padding-left: var(--space-4);
    }
    
    .timeline::before {
        left: 10px;
    }
    
    .timeline-item {
        width: 100%;
        padding-left: 40px;
        padding-right: 0;
        margin-bottom: var(--space-8);
    }
    
    .timeline-item:nth-child(even) {
        margin-left: 0;
        padding-left: 40px;
    }
    
    .timeline-dot {
        left: -2px !important;
        right: auto !important;
        width: 20px;
        height: 20px;
        border-width: 3px;
    }
    
    .timeline-content {
        padding: var(--space-4);
    }
    
    .timeline-year {
        font-size: var(--fs-xl);
    }
    
    .partners-grid {
        flex-direction: column;
        gap: var(--space-4);
    }
    
    .partner-logo {
        width: 120px;
        height: 60px;
    }
    
    .card {
        padding: var(--space-6);
    }
    
    .card-icon {
        width: 50px;
        height: 50px;
        margin-bottom: var(--space-4);
    }
    
    .card-icon svg {
        width: 25px;
        height: 25px;
    }
    
    .card-title {
        font-size: var(--fs-xl);
        margin-bottom: var(--space-3);
    }
    
    .card-text {
        font-size: var(--fs-sm);
        margin-bottom: var(--space-4);
    }
    
    .cta-section {
        padding: var(--space-16) 0;
    }
    
    .cta-title {
        font-size: var(--fs-2xl);
        margin-bottom: var(--space-4);
    }
    
    .cta-text {
        font-size: var(--fs-sm);
        margin-bottom: var(--space-6);
    }
    
    .store-buttons {
        flex-direction: column;
        align-items: center;
        gap: var(--space-3);
    }
    
    .store-button {
        width: 100%;
        max-width: 250px;
        justify-content: center;
    }
    
    .contact-grid {
        gap: var(--space-8);
    }
    
    .contact-info {
        padding: var(--space-4);
    }
    
    .contact-item {
        flex-direction: column;
        align-items: center;
        text-align: center;
        margin-bottom: var(--space-6);
    }
    
    .contact-icon {
        width: 50px;
        height: 50px;
        margin-bottom: var(--space-3);
    }
    
    .contact-icon svg {
        width: 24px;
        height: 24px;
    }
    
    .contact-details h4 {
        font-size: var(--fs-base);
    }
    
    .contact-details p {
        font-size: var(--fs-sm);
    }
    
    .contact-form {
        padding: var(--space-6);
    }
    
    .form-group {
        margin-bottom: var(--space-4);
    }
    
    .form-label {
        font-size: var(--fs-sm);
        margin-bottom: var(--space-2);
    }
    
    .form-input,
    .form-textarea,
    .form-select {
        padding: var(--space-3);
        font-size: var(--fs-sm);
    }
    
    .form-textarea {
        min-height: 120px;
    }
    
    .btn {
        padding: var(--space-3) var(--space-6);
        font-size: var(--fs-sm);
    }
    
    .btn-lg {
        padding: var(--space-4) var(--space-6);
        font-size: var(--fs-base);
    }
    
    .scroll-top {
        width: 40px;
        height: 40px;
        bottom: 15px;
        right: 15px;
    }
    
    .scroll-top svg {
        width: 20px;
        height: 20px;
    }
    
    .app-feature-item {
        padding: var(--space-4);
        margin-bottom: var(--space-3);
    }
    
    .feature-check {
        width: 24px;
        height: 24px;
    }
    
    .feature-check svg {
        width: 12px;
        height: 12px;
    }
}

/* =====================================================
   HIGH DPI / RETINA DISPLAYS
   ===================================================== */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .logo svg,
    .footer-logo svg,
    .feature-icon svg,
    .value-icon svg,
    .card-icon svg,
    .team-avatar svg {
        shape-rendering: geometricPrecision;
    }
}

/* =====================================================
   PRINT STYLES
   ===================================================== */
@media print {
    .header,
    .footer,
    .scroll-top,
    .menu-toggle,
    .hero-buttons,
    .cta-buttons,
    .store-buttons,
    .contact-form,
    .mobile-menu {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.5;
        color: #000;
        background: #fff;
    }
    
    .hero {
        min-height: auto;
        padding: 20pt 0;
        background: #fff;
        color: #000;
    }
    
    .hero-title {
        color: #000;
        font-size: 24pt;
    }
    
    .section {
        padding: 20pt 0;
    }
    
    .container {
        max-width: 100%;
        padding: 0;
    }
    
    a {
        color: #000;
        text-decoration: underline;
    }
    
    .card,
    .news-card,
    .team-card,
    .value-card {
        box-shadow: none;
        border: 1px solid #ddd;
        break-inside: avoid;
    }
    
    .page-header {
        background: #fff;
        color: #000;
        padding: 20pt 0;
    }
    
    .page-title {
        color: #000;
        font-size: 20pt;
    }
    
    @page {
        margin: 1cm;
    }
}

/* =====================================================
   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;
    }
    
    html {
        scroll-behavior: auto;
    }
    
    .scroll-animate,
    .scroll-animate-left,
    .scroll-animate-right,
    .scroll-animate-scale,
    .scroll-animate-fade {
        opacity: 1;
        transform: none;
    }
    
    .hero-animate {
        opacity: 1;
        transform: none;
    }
    
    .stagger-item {
        opacity: 1;
        transform: none;
    }
}

/* =====================================================
   DARK MODE SUPPORT (System Preference)
   ===================================================== */
@media (prefers-color-scheme: dark) {
    /* Can be enabled if needed */
}

/* =====================================================
   LANDSCAPE ORIENTATION (Tablets & Mobile)
   ===================================================== */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        min-height: auto;
        padding: 80px 0 40px;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-stats {
        flex-direction: row;
        gap: var(--space-4);
    }
    
    .page-header {
        padding: 80px 0 40px;
    }
}
