/* ===================================
   響應式設計樣式表
   宇達光學官網
   =================================== */

/* ===================================
   Tablet (768px - 1024px)
   =================================== */
@media (max-width: 1024px) {
    :root {
        --section-padding: 60px;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.3rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .product-showcase {
        gap: 40px;
    }

    .product-image img {
        max-width: 350px;
    }

    .nav-menu {
        gap: 20px;
    }

    .nav-link {
        font-size: 0.95rem;
    }
}

/* ===================================
   Mobile (<768px)
   =================================== */
@media (max-width: 767px) {
    :root {
        --section-padding: 40px;
        --content-padding: 20px;
    }

    /* Typography */
    h1 {
        font-size: 1.8rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    h3 {
        font-size: 1.2rem;
    }

    p {
        font-size: 0.95rem;
    }

    /* Container */
    .container {
        padding: 0 15px;
    }

    /* Navigation */
    .nav-container {
        padding: 12px 15px;
    }

    .nav-brand {
        font-size: 1rem;
    }

    .logo {
        height: 35px;
    }

    .nav-menu {
        position: fixed;
        top: 62px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 62px);
        background: var(--white);
        flex-direction: column;
        padding: 30px 20px;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
        transition: left 0.3s ease;
        gap: 0;
        overflow-y: auto;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-link {
        display: block;
        padding: 15px 0;
        font-size: 1.1rem;
        border-bottom: 1px solid var(--light-gray);
    }

    .nav-link.active::after {
        display: none;
    }

    .nav-link.active {
        background: var(--light-blue);
        padding-left: 10px;
        border-left: 4px solid var(--primary-blue);
    }

    .mobile-toggle {
        display: flex;
    }

    .lang-switch {
        font-size: 0.85rem;
        padding: 6px 12px;
    }

    /* Hero Section */
    .hero {
        min-height: 80vh;
        margin-top: 62px;
    }

    .hero-logo {
        width: 100px;
        margin-bottom: 20px;
    }

    .hero-title {
        font-size: 1.8rem;
        padding: 0 10px;
    }

    .hero-subtitle {
        font-size: 1.1rem;
        padding: 0 10px;
    }

    /* Section Titles */
    .section-title {
        font-size: 1.8rem;
        margin-bottom: 35px;
    }

    .section-title .title-sub {
        font-size: 1rem;
        margin-top: 8px;
    }

    .subsection-title {
        font-size: 1.4rem;
        margin-top: 40px;
        margin-bottom: 20px;
    }

    /* About Section */
    .info-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        margin-bottom: 30px;
    }

    .info-item {
        padding: 25px 20px;
    }

    .info-item h3 {
        font-size: 1rem;
    }

    .info-item p {
        font-size: 1.2rem;
    }

    .company-intro {
        padding: 25px 20px;
    }

    .company-intro p {
        font-size: 1rem;
    }

    .values-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .value-item {
        padding: 20px;
        font-size: 1rem;
    }

    .team-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .team-member {
        padding: 25px 20px;
    }

    .team-member h4 {
        font-size: 1.1rem;
    }

    .team-role {
        font-size: 0.95rem;
    }

    .team-desc {
        font-size: 0.9rem;
    }

    /* Products Overview */
    .product-categories {
        grid-template-columns: 1fr;
        gap: 25px;
    }

    .category-card {
        padding: 40px 25px;
    }

    .category-icon {
        font-size: 3rem;
    }

    .category-card h3 {
        font-size: 1.5rem;
    }

    .category-card p {
        font-size: 1rem;
    }

    /* Product Showcase */
    .product-showcase {
        grid-template-columns: 1fr;
        gap: 30px;
        margin-bottom: 50px;
    }

    .product-showcase.reverse {
        direction: ltr;
    }

    .product-image img {
        max-width: 300px;
    }

    .product-details h3 {
        font-size: 1.5rem;
        margin-bottom: 15px;
    }

    .product-details p {
        font-size: 1rem;
        margin-bottom: 20px;
    }

    .product-highlights li {
        padding: 8px 0;
        font-size: 0.95rem;
    }

    .customize-note {
        font-size: 1rem;
        padding: 20px 15px;
    }

    /* Specifications Table */
    .specs-table-wrapper {
        margin-bottom: 20px;
    }

    .specs-table {
        font-size: 0.8rem;
    }

    .specs-table th,
    .specs-table td {
        padding: 12px 8px;
    }

    .specs-table thead th {
        font-size: 0.9rem;
    }

    /* 針對手機優化表格顯示 */
    .specs-table th:first-child,
    .specs-table td:first-child {
        position: sticky;
        left: 0;
        background: var(--white);
        z-index: 1;
        box-shadow: 2px 0 4px rgba(0, 0, 0, 0.05);
    }

    .specs-table thead th:first-child {
        background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
    }

    .specs-note {
        font-size: 0.85rem;
        padding: 15px 10px;
    }

    /* Contact Section */
    .contact-info {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .contact-item {
        padding: 30px 20px;
    }

    .contact-icon {
        font-size: 2.5rem;
    }

    .contact-item h3 {
        font-size: 1.2rem;
        margin-bottom: 12px;
    }

    .contact-item p {
        font-size: 0.95rem;
    }

    /* Footer */
    .footer {
        padding: 25px 15px;
    }

    .footer p {
        font-size: 0.85rem;
        line-height: 1.6;
    }

    /* Animations - 減少移動距離以優化手機體驗 */
    .fade-in {
        transform: translateY(20px);
    }

    @keyframes fadeInUp {
        from {
            opacity: 0;
            transform: translateY(20px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    /* Section Scroll Margin */
    section {
        scroll-margin-top: 70px;
    }
}

/* ===================================
   Extra Small Mobile (<480px)
   =================================== */
@media (max-width: 479px) {
    .hero-title {
        font-size: 1.5rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .section-title {
        font-size: 1.6rem;
    }

    .product-image img {
        max-width: 250px;
    }

    .specs-table {
        font-size: 0.75rem;
    }

    .specs-table th,
    .specs-table td {
        padding: 10px 5px;
    }

    .lang-switch {
        font-size: 0.8rem;
        padding: 5px 10px;
    }

    .nav-brand {
        font-size: 0.9rem;
    }

    .logo {
        height: 30px;
    }
}

/* ===================================
   Large Desktop (>1440px)
   =================================== */
@media (min-width: 1441px) {
    .container {
        max-width: 1400px;
    }

    .hero-title {
        font-size: 3.5rem;
    }

    .hero-subtitle {
        font-size: 1.8rem;
    }

    .section-title {
        font-size: 3rem;
    }

    .product-image img {
        max-width: 450px;
    }
}

/* ===================================
   Print Styles
   =================================== */
@media print {

    .navbar,
    .mobile-toggle,
    .lang-switch,
    .nav-actions {
        display: none;
    }

    .hero {
        min-height: auto;
        padding: 40px 0;
        margin-top: 0;
    }

    .section {
        page-break-inside: avoid;
        padding: 30px 0;
    }

    .product-showcase,
    .team-member,
    .info-item {
        page-break-inside: avoid;
    }

    body {
        font-size: 12pt;
        line-height: 1.5;
    }

    a {
        text-decoration: underline;
        color: var(--dark-blue);
    }

    .specs-table {
        page-break-inside: auto;
    }

    .specs-table tr {
        page-break-inside: avoid;
        page-break-after: auto;
    }
}

/* ===================================
   Accessibility Enhancements
   =================================== */

/* 高對比模式支援 */
@media (prefers-contrast: high) {
    :root {
        --primary-blue: #0066CC;
        --secondary-blue: #0052A3;
        --dark-blue: #001A4D;
    }

    .nav-link.active::after {
        height: 4px;
    }

    .value-item,
    .category-card:hover {
        border: 2px solid var(--dark-blue);
    }
}

/* 減少動畫偏好 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }

    .fade-in {
        opacity: 1;
        transform: none;
    }
}

/* 深色模式支援(可選) */
@media (prefers-color-scheme: dark) {
    /* 如果未來需要深色模式,可在此添加樣式 */
    /* 目前保持淺色主題 */
}

/* ===================================
   Landscape Orientation (手機橫屏)
   =================================== */
@media (max-width: 767px) and (orientation: landscape) {
    .hero {
        min-height: 100vh;
        padding: 30px 0;
    }

    .hero-logo {
        width: 80px;
        margin-bottom: 15px;
    }

    .hero-title {
        font-size: 1.6rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .nav-menu {
        height: calc(100vh - 62px);
    }
}

/* ===================================
   Touch Device Optimizations
   =================================== */
@media (hover: none) and (pointer: coarse) {

    /* 增加觸控目標大小 */
    .nav-link,
    .lang-option,
    .mobile-toggle {
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .category-card,
    .contact-item a {
        min-height: 44px;
    }

    /* 移除 hover 效果,使用 active 狀態 */
    .info-item:hover,
    .team-member:hover,
    .contact-item:hover {
        transform: none;
    }

    .info-item:active,
    .team-member:active,
    .contact-item:active {
        transform: scale(0.98);
    }
}