/**
 * ALLIN NEW MATERIAL - Main Stylesheet
 * Color Scheme based on brand identity
 */

/* ============================
   CSS Variables & Reset
   ============================ */
:root {
    /* 主要色調 - 專業沉穩的深藍色 */
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;

    /* 次要色調 - 深邃專業的藍灰色 */
    --secondary-color: #1e3a5f;
    --secondary-dark: #152840;
    --secondary-light: #2a4d7c;

    /* 強調色 - 柔和的琥珀金（僅用於小範圍點綴） */
    --accent-color: #059669;
    --accent-orange: #d97706;
    --success-color: #10b981;
    --danger-color: #dc3545;
    --warning-color: #f59e0b;

    /* 文字顏色 */
    --text-dark: #1f2937;
    --text-light: #6b7280;
    --text-muted: #9ca3af;

    /* 背景色 */
    --bg-white: #ffffff;
    --bg-light: #f9fafb;
    --bg-dark: #1e3a5f;

    /* 邊框與陰影 */
    --border-color: #e5e7eb;
    --shadow: 0 2px 15px rgba(37, 99, 235, 0.08);
    --shadow-lg: 0 10px 40px rgba(37, 99, 235, 0.15);

    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --transition: all 0.3s ease;

    --container-width: 1200px;
    --header-height: 90px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-white);
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

img {
    max-width: 100%;
    height: auto;
}

ul,
ol {
    list-style: none;
}

/* ============================
   Layout
   ============================ */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

.main-content {
    min-height: calc(100vh - 200px);
}

/* ============================
   Top Bar
   ============================ */
.top-bar {
    background: var(--secondary-color);
    color: white;
    padding: 8px 0;
    font-size: 14px;
}

.top-bar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.top-bar-left {
    display: flex;
    gap: 20px;
}

.top-contact {
    display: flex;
    align-items: center;
    gap: 6px;
    color: rgba(255, 255, 255, 0.9);
}

.top-contact:hover {
    color: var(--primary-color);
}

.top-contact svg {
    flex-shrink: 0;
}

.language-selector {
    position: relative;
    cursor: pointer;
}

.language-selector>span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.language-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: 4px;
    box-shadow: var(--shadow-lg);
    min-width: 150px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--transition);
    z-index: 1000;
}

.language-selector:hover .language-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.language-dropdown a {
    display: block;
    padding: 10px 15px;
    color: var(--text-dark);
    border-bottom: 1px solid var(--border-color);
}

.language-dropdown a:last-child {
    border-bottom: none;
}

.language-dropdown a:hover,
.language-dropdown a.active {
    background: var(--primary-color);
    color: white;
}

/* ============================
   Main Header
   ============================ */
.main-header {
    background: white;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.main-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
}

.logo {
    display: flex;
    align-items: center;
}

.logo-text {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-color);
    letter-spacing: 2px;
}

/* Navigation */
.main-nav {
    display: flex;
}

.nav-menu {
    display: flex;
    gap: 30px;
}

.nav-menu>li {
    position: relative;
}

.nav-menu>li>a {
    display: block;
    padding: 10px 0;
    font-weight: 500;
    color: var(--text-dark);
}

.nav-menu>li>a:hover,
.nav-menu>li.active>a {
    color: var(--primary-color);
}

/* Submenu */
.has-submenu .submenu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    min-width: 200px;
    box-shadow: var(--shadow-lg);
    border-radius: 4px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--transition);
}

.has-submenu:hover .submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.submenu a {
    display: block;
    padding: 12px 20px;
    color: var(--text-dark);
    border-bottom: 1px solid var(--border-color);
}

.submenu a:hover {
    background: var(--primary-color);
    color: white;
}

/* Mega Menu */
.mega-menu-content {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: white;
    min-width: 600px;
    box-shadow: var(--shadow-lg);
    border-radius: 4px;
    padding: 25px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.mega-menu:hover .mega-menu-content {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.mega-menu-column h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary-color);
}

.mega-menu-column h4 a:hover {
    color: var(--primary-dark);
}

.mega-menu-column ul {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.mega-menu-column ul a {
    font-size: 13px;
    color: var(--text-light);
    display: block;
    padding: 4px 0;
}

.mega-menu-column ul a:hover {
    color: var(--primary-color);
    padding-left: 5px;
}

/* Header CTA */
.header-cta {
    background: var(--primary-color);
    color: white;
    padding: 12px 25px;
    border-radius: 4px;
    font-weight: 600;
    transition: var(--transition);
}

.header-cta:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

/* Mobile Menu */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.mobile-menu-btn span {
    width: 25px;
    height: 3px;
    background: var(--text-dark);
    border-radius: 2px;
    transition: var(--transition);
}

/* ============================
   Hero Section
   ============================ */
.hero {
    background: linear-gradient(135deg, var(--secondary-color) 0%, #1a2a3a 100%);
    color: white;
    padding: 80px 0;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 50%;
    height: 100%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="40" fill="none" stroke="%2300a0e9" stroke-width="0.5" opacity="0.2"/></svg>');
    background-size: 100px;
    opacity: 0.5;
}

.hero-content {
    position: relative;
    max-width: 600px;
}

.hero h1 {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 20px;
    line-height: 1.2;
}

.hero p {
    font-size: 18px;
    opacity: 0.9;
    margin-bottom: 30px;
}

.hero .btn {
    display: inline-block;
    padding: 15px 35px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 4px;
    transition: var(--transition);
}

/* ============================
   Buttons
   ============================ */
.btn {
    display: inline-block;
    padding: 12px 25px;
    font-weight: 600;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background: #1a2a3a;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
}

/* ============================
   Section Titles
   ============================ */
.section-title {
    text-align: center;
    margin-bottom: 50px;
}

.section-title h2 {
    font-size: 36px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 15px;
}

.section-title p {
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto;
}

/* ============================
   Product Cards
   ============================ */
.products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.product-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.product-card-image {
    height: 200px;
    background: var(--bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 15px;
}

.product-card-image img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.product-card-body {
    padding: 20px;
}

.product-card h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-dark);
}

.product-card p {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card .btn {
    width: 100%;
}

/* ============================
   Category Cards
   ============================ */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.category-card {
    background: white;
    border-radius: 8px;
    padding: 30px 20px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 2px solid transparent;
}

.category-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-5px);
}

.category-card-icon {
    width: 60px;
    height: 60px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
}

.category-card-icon svg {
    width: 30px;
    height: 30px;
    fill: white;
}

.category-card h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
}

/* ============================
   Stats Section
   ============================ */
.stats-section {
    background: var(--primary-color);
    color: white;
    padding: 60px 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    text-align: center;
}

.stat-item h3 {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 10px;
}

.stat-item p {
    font-size: 16px;
    opacity: 0.9;
}

/* ============================
   Applications Grid
   ============================ */
.applications-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 15px;
}

.application-card {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 1;
}

.application-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.application-card:hover img {
    transform: scale(1.1);
}

.application-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    padding: 20px 15px;
    color: white;
}

.application-card h4 {
    font-size: 14px;
    font-weight: 600;
}

/* ============================
   News Section
   ============================ */
.news-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.news-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.news-card-image {
    height: 200px;
    overflow: hidden;
}

.news-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.news-card:hover .news-card-image img {
    transform: scale(1.05);
}

.news-card-body {
    padding: 20px;
}

.news-card-date {
    font-size: 13px;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.news-card h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
    line-height: 1.4;
}

.news-card p {
    font-size: 14px;
    color: var(--text-light);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ============================
   Product Detail Page
   ============================ */
.product-detail {
    padding: 60px 0;
}

.product-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 50px;
}

.product-image {
    background: var(--bg-light);
    border-radius: 8px;
    padding: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-info h1 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text-dark);
}

.product-description {
    font-size: 16px;
    color: var(--text-light);
    margin-bottom: 30px;
    line-height: 1.8;
}

.product-specs-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
}

.product-specs-table th,
.product-specs-table td {
    padding: 12px 15px;
    text-align: left;
    border: 1px solid var(--border-color);
}

.product-specs-table th {
    background: var(--primary-color);
    color: white;
    font-weight: 600;
}

.product-specs-table tr:nth-child(even) {
    background: var(--bg-light);
}

.product-section {
    margin-bottom: 30px;
}

.product-section h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
}

/* ============================
   Pages (About, Contact)
   ============================ */
.page-header {
    background: linear-gradient(135deg, var(--secondary-color), #1a2a3a);
    color: white;
    padding: 60px 0;
    text-align: center;
}

.page-header h1 {
    font-size: 42px;
    font-weight: 700;
    margin-bottom: 15px;
}

.breadcrumb {
    display: flex;
    justify-content: center;
    gap: 10px;
    font-size: 14px;
    opacity: 0.8;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.page-content {
    padding: 60px 0;
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-light);
}

.about-content p {
    margin-bottom: 20px;
}

/* Contact Page */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
}

.contact-info-item {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
}

.contact-info-icon {
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.contact-info-icon svg {
    fill: white;
    width: 24px;
    height: 24px;
}

.contact-info-text h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 5px;
}

.contact-info-text p,
.contact-info-text a {
    color: var(--text-light);
}

.contact-form {
    background: var(--bg-light);
    padding: 40px;
    border-radius: 8px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 15px;
    font-family: inherit;
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 160, 233, 0.1);
}

.form-group textarea {
    min-height: 150px;
    resize: vertical;
}

/* ============================
   Footer
   ============================ */
.main-footer {
    background: var(--secondary-color);
    color: white;
    padding: 60px 0 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1.5fr;
    gap: 40px;
    padding-bottom: 40px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
}

.footer-desc {
    opacity: 0.8;
    line-height: 1.7;
    margin-bottom: 20px;
}

.footer-contact p {
    margin-bottom: 5px;
    opacity: 0.8;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-links a {
    opacity: 0.8;
    transition: var(--transition);
}

.footer-links a:hover {
    opacity: 1;
    color: var(--primary-color);
    padding-left: 5px;
}

.footer-form input,
.footer-form textarea {
    width: 100%;
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    margin-bottom: 10px;
    font-family: inherit;
}

.footer-form textarea {
    min-height: 80px;
    resize: vertical;
}

.footer-form .btn {
    width: 100%;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    opacity: 0.8;
    font-size: 14px;
}

.footer-bottom-links {
    display: flex;
    gap: 20px;
}

.footer-bottom-links a:hover {
    color: var(--primary-color);
}

/* ============================
   Floating Buttons
   ============================ */
.floating-buttons {
    position: fixed;
    right: 20px;
    bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 99;
}

.float-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
}

.float-btn:hover {
    transform: scale(1.1);
}

.float-btn.whatsapp {
    background: #25d366;
}

.float-btn.phone {
    background: var(--primary-color);
}

/* ============================
   Responsive Design
   ============================ */
@media (max-width: 1200px) {
    .mega-menu-content {
        grid-template-columns: repeat(3, 1fr);
        min-width: 500px;
    }

    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 992px) {
    .header-cta {
        display: none;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .main-nav {
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        background: white;
        padding: 20px;
        box-shadow: var(--shadow-lg);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: var(--transition);
    }

    .main-nav.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .nav-menu {
        flex-direction: column;
        gap: 0;
    }

    .nav-menu>li>a {
        padding: 15px 0;
        border-bottom: 1px solid var(--border-color);
    }

    .mega-menu-content,
    .submenu {
        position: static;
        transform: none;
        box-shadow: none;
        min-width: auto;
        opacity: 1;
        visibility: visible;
        display: none;
        padding: 15px;
        background: var(--bg-light);
    }

    .has-submenu.active .submenu,
    .mega-menu.active .mega-menu-content {
        display: block;
    }

    .mega-menu-content {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero h1 {
        font-size: 36px;
    }

    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .applications-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .news-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .product-detail-grid {
        grid-template-columns: 1fr;
    }

    .contact-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .top-bar-left {
        flex-direction: column;
        gap: 5px;
    }

    .hero {
        padding: 50px 0;
    }

    .hero h1 {
        font-size: 28px;
    }

    .section-title h2 {
        font-size: 28px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .stat-item h3 {
        font-size: 36px;
    }

    .applications-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .news-grid {
        grid-template-columns: 1fr;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .page-header h1 {
        font-size: 32px;
    }
}

@media (max-width: 480px) {
    :root {
        --header-height: 60px;
    }

    .logo-text {
        font-size: 22px;
    }

    .categories-grid {
        grid-template-columns: 1fr;
    }

    .mega-menu-content {
        grid-template-columns: 1fr;
    }
}

/* RTL Support for Arabic */
[dir="rtl"] {
    text-align: right;
}

[dir="rtl"] .top-bar-left,
[dir="rtl"] .nav-menu,
[dir="rtl"] .breadcrumb {
    flex-direction: row-reverse;
}

[dir="rtl"] .language-dropdown {
    left: 0;
    right: auto;
}

[dir="rtl"] .mega-menu-content {
    left: auto;
    right: 50%;
    transform: translateX(50%) translateY(10px);
}

/* ============================
   Logo Styles
   ============================ */
.logo-img {
    height: 70px;
    width: auto;
    display: block;
}

/* ============================
   手機版語言選擇器
   ============================ */
.mobile-lang-selector {
    display: none;
    position: relative;
}

.mobile-lang-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 13px;
    color: var(--text-dark);
    cursor: pointer;
    transition: var(--transition);
}

.mobile-lang-btn:hover,
.mobile-lang-btn:focus {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.mobile-lang-btn svg {
    flex-shrink: 0;
}

.mobile-lang-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    min-width: 140px;
    margin-top: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition);
    z-index: 1000;
    overflow: hidden;
}

.mobile-lang-selector.active .mobile-lang-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.mobile-lang-dropdown a {
    display: block;
    padding: 10px 15px;
    color: var(--text-dark);
    font-size: 14px;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

.mobile-lang-dropdown a:last-child {
    border-bottom: none;
}

.mobile-lang-dropdown a:hover,
.mobile-lang-dropdown a.active {
    background: var(--primary-color);
    color: white;
}

/* ============================
   手機版優化 (992px 以下)
   ============================ */
@media (max-width: 992px) {

    /* 隱藏桌面版頂部欄 */
    .top-bar {
        display: none;
    }

    /* 顯示手機版語言選擇器 */
    .mobile-lang-selector {
        display: block;
    }

    /* Header 佈局優化 */
    .main-header .container {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 12px 15px;
    }

    /* Logo 調整間距 */
    .logo {
        flex: 0 0 auto;
    }

    .logo-img {
        height: 50px;
    }

    /* 語言選擇器+漢堡選單區域 */
    .mobile-lang-selector {
        margin-left: auto;
        margin-right: 15px;
    }

    /* 隱藏桌面版導覽和 CTA */
    .header-cta {
        display: none;
    }

    /* 顯示手機選單按鈕 */
    .mobile-menu-btn {
        display: flex;
        flex-direction: column;
        gap: 5px;
        background: none;
        border: none;
        cursor: pointer;
        padding: 8px;
        border-radius: 4px;
        transition: var(--transition);
    }

    .mobile-menu-btn:hover {
        background: var(--bg-light);
    }

    .mobile-menu-btn span {
        width: 24px;
        height: 2px;
        background: var(--text-dark);
        border-radius: 2px;
        transition: var(--transition);
    }

    /* 手機版導航選單 */
    .main-nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 85%;
        max-width: 320px;
        height: 100vh;
        background: white;
        box-shadow: -5px 0 20px rgba(0, 0, 0, 0.15);
        transition: right 0.3s ease;
        z-index: 1001;
        overflow-y: auto;
        padding: 0;
    }

    .main-nav.active {
        right: 0;
    }

    .nav-menu {
        flex-direction: column;
        gap: 0;
        padding: 60px 0 20px;
    }

    .nav-menu>li {
        border-bottom: 1px solid var(--border-color);
    }

    .nav-menu>li>a {
        display: block;
        padding: 15px 20px;
        font-size: 16px;
        font-weight: 500;
    }

    /* 子選單樣式 */
    .has-submenu .submenu,
    .mega-menu .mega-menu-content {
        position: static;
        transform: none;
        box-shadow: none;
        min-width: auto;
        opacity: 1;
        visibility: visible;
        display: none;
        padding: 0 0 10px 20px;
        background: var(--bg-light);
    }

    .has-submenu.active .submenu,
    .mega-menu.active .mega-menu-content {
        display: block;
    }

    .mega-menu-content {
        grid-template-columns: 1fr;
        padding: 15px 20px;
    }

    .mega-menu-column {
        margin-bottom: 15px;
    }

    .mega-menu-column h4 {
        font-size: 15px;
        margin-bottom: 8px;
    }

    .mega-menu-column ul a {
        padding: 8px 0;
        font-size: 14px;
    }

    /* 關閉選單按鈕 */
    .main-nav::before {
        content: '✕';
        position: absolute;
        top: 15px;
        right: 20px;
        font-size: 24px;
        cursor: pointer;
        color: var(--text-dark);
        width: 36px;
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: var(--bg-light);
        border-radius: 50%;
    }

    /* 遮罩層 */
    .nav-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        opacity: 0;
        visibility: hidden;
        transition: var(--transition);
        z-index: 1000;
    }

    .nav-overlay.active {
        opacity: 1;
        visibility: visible;
    }
}

/* ============================
   更小屏幕優化 (768px 以下)
   ============================ */
@media (max-width: 768px) {
    .hero {
        padding: 40px 0;
    }

    .hero h1 {
        font-size: 24px;
        line-height: 1.3;
    }

    .hero p {
        font-size: 14px;
        margin-bottom: 25px;
    }

    /* Hero 按鈕統一大小 */
    .hero-content {
        text-align: center;
    }

    .hero .btn {
        display: inline-block;
        width: calc(50% - 8px);
        max-width: 180px;
        padding: 14px 16px;
        font-size: 14px;
        text-align: center;
        margin: 0 4px;
        box-sizing: border-box;
    }

    .hero .btn-outline {
        margin-left: 4px !important;
    }

    .section-title h2 {
        font-size: 24px;
    }

    .section-title p {
        font-size: 14px;
    }

    /* 分類卡片 */
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .category-card {
        padding: 20px 15px;
    }

    .category-card-icon {
        width: 50px;
        height: 50px;
    }

    .category-card h3 {
        font-size: 14px;
    }

    /* 統計區塊 */
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }

    .stat-item h3 {
        font-size: 24px;
    }

    .stat-item p {
        font-size: 12px;
    }

    /* 應用領域 */
    .applications-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    /* 新聞卡片 */
    .news-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    /* Footer */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .page-header h1 {
        font-size: 28px;
    }

    /* 產品列表 */
    .products-grid {
        grid-template-columns: 1fr;
    }

    /* 聯絡頁面 */
    .contact-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================
   超小屏幕優化 (480px 以下)
   ============================ */
@media (max-width: 480px) {

    /* Logo 更小 */
    .logo-img {
        height: 40px;
    }

    /* 語言按鈕 - 保持文字可見 */
    .mobile-lang-btn {
        padding: 6px 10px;
        font-size: 12px;
        gap: 4px;
    }

    .mobile-lang-btn svg {
        width: 16px;
        height: 16px;
    }

    .mobile-menu-btn span {
        width: 20px;
    }

    /* Hero 區塊 */
    .hero {
        padding: 30px 0;
    }

    .hero h1 {
        font-size: 20px;
    }

    /* 分類 1 列 */
    .categories-grid {
        grid-template-columns: 1fr;
    }

    /* 統計區塊 */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .stat-item {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 15px 20px;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 8px;
    }

    .stat-item h3 {
        font-size: 28px;
        margin-bottom: 0;
    }

    .stat-item p {
        font-size: 14px;
        text-align: right;
    }

    .mega-menu-content {
        grid-template-columns: 1fr;
    }

    /* 應用領域 1 列 */
    .applications-grid {
        grid-template-columns: 1fr;
    }

    .application-card {
        aspect-ratio: 16/9;
    }
}

[dir="rtl"] .mega-menu:hover .mega-menu-content {
    transform: translateX(50%) translateY(0);
}

[dir="rtl"] .floating-buttons {
    right: auto;
    left: 20px;
}

[dir="rtl"] .footer-links a:hover,
[dir="rtl"] .mega-menu-column ul a:hover {
    padding-left: 0;
    padding-right: 5px;
}

/* ============================
   Yolatech Custom Overrides
   ============================ */

/* Products Breadcrumb */
.products-breadcrumb {
    background: #f5f5f5;
    padding: 15px 0;
    margin-bottom: 25px;
    border-bottom: 1px solid #eaeaea;
}
.products-breadcrumb .container {
    display: flex;
    align-items: center;
    font-size: 14px;
}
.products-breadcrumb a {
    color: var(--text-light);
}
.products-breadcrumb a:hover {
    color: var(--primary-color);
}
.products-breadcrumb span {
    color: var(--text-muted);
    margin: 0 10px;
}

/* Sidebar Customizations */
.products-sidebar .sidebar-box {
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--border-color);
}
.products-sidebar .sidebar-title {
    background: var(--secondary-color);
    color: white;
    padding: 18px 25px;
    margin: 0;
    border-bottom: none;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 1px;
}
.accordion-nav {
    padding: 10px 0;
}
.accordion-header > a {
    padding: 12px 25px;
    font-size: 15px;
}
.accordion-item {
    border-bottom: 1px solid #f0f0f0;
}
.accordion-item.active {
    background-color: transparent;
}
.accordion-item.active > .accordion-header {
    background-color: #f4f7fa;
    border-left: 4px solid var(--secondary-color);
}
.accordion-item.active > .accordion-header > a,
.accordion-item.active > .accordion-header .accordion-toggle {
    color: var(--secondary-color);
    font-weight: 600;
}
.accordion-item.active > .accordion-header > a:hover {
    color: var(--secondary-color);
}

/* Redesign: Contact Box */
.products-sidebar .contact-box {
    background-color: #f9fbfd !important;
    border: 1px solid #e1ecf8 !important;
    padding: 25px 20px !important;
    margin-top: 30px !important;
}
.products-sidebar .contact-box h4 {
    color: var(--secondary-color) !important;
    font-size: 18px !important;
    font-weight: 600;
    margin-bottom: 12px;
}
.products-sidebar .contact-box p {
    color: var(--text-light) !important;
    font-size: 14px;
    margin-bottom: 20px;
    line-height: 1.5;
}
.products-sidebar .contact-box .btn {
    background-color: transparent !important;
    color: var(--secondary-color) !important;
    border: 1px solid var(--secondary-color) !important;
    width: 100%;
    margin-bottom: 20px;
    box-shadow: none !important;
}
.products-sidebar .contact-box .btn:hover {
    background-color: var(--secondary-color) !important;
    color: white !important;
}
.products-sidebar .contact-box .contact-info p {
    color: var(--secondary-color) !important;
    font-size: 14px;
    margin-bottom: 5px;
}
.products-sidebar .contact-box .contact-info p strong {
    color: var(--text-dark);
}

/* Product Cards */
.product-card {
    text-align: center;
    border: 1px solid var(--border-color);
    box-shadow: none;
    padding-bottom: 20px;
}
.product-card:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transform: translateY(-3px);
}
.product-card-body {
    padding: 15px 20px;
}
.product-card h3 {
    font-size: 16px;
    color: var(--text-dark);
    margin-bottom: 15px;
}
.product-card .btn {
    width: auto;
    display: inline-flex;
    align-items: center;
    padding: 10px 20px;
    font-size: 14px;
    border-radius: 25px;
}
.product-card .btn svg {
    margin-left: 8px;
}

/* Detail Page Layout & Tabs */
.product-detail-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 40px;
}
.product-content-wrapper {
    background: white;
}
.product-top-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 40px;
}
.product-image-container {
    border: 1px solid var(--border-color);
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-light);
}
.product-main-info h1 {
    font-size: 28px;
    color: var(--secondary-color);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 15px;
    margin-bottom: 25px;
}

/* Custom Tabs */
.nav-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 30px;
}
.nav-tab {
    padding: 15px 30px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-light);
    cursor: pointer;
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-bottom: none;
    margin-right: 5px;
    border-radius: 4px 4px 0 0;
    transition: all 0.2s;
}
.nav-tab.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}
.tab-pane {
    display: none;
    animation: fadeIn 0.4s;
}
.tab-pane.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 992px) {
    .product-detail-layout {
        grid-template-columns: 1fr;
    }
    .product-top-row {
        grid-template-columns: 1fr;
    }
}

/* Redesign: Blue Ribbon Headers */
.product-section {
    margin-bottom: 30px;
}
.product-section h3 {
    background-color: #174e92;
    color: white !important;
    display: inline-flex;
    align-items: center;
    padding: 8px 15px;
    font-size: 16px;
    font-style: italic; /* According to screenshot it has somewhat italic/slanted or bold font */
    font-weight: 600;
    position: relative;
    margin-bottom: 15px;
    margin-top: 20px;
    padding-right: 30px;
    border-bottom: none;
    line-height: 20px;
    text-transform: capitalize;
}
.product-section h3::after {
    content: "";
    position: absolute;
    right: -18px;
    top: 0;
    border-top: 18px solid transparent;
    border-left: 18px solid #174e92;
    border-bottom: 18px solid transparent;
}

/* Image Thumbnails Gallery */
.product-image-container {
    flex-direction: column;
    padding: 0;
    background: transparent;
    border: none;
}
.main-image-display {
    width: 100%;
    margin-bottom: 15px;
    border: 1px solid var(--border-color);
    padding: 10px;
    background: white;
    text-align: center;
}
.main-image-display img {
    max-height: 350px;
    object-fit: contain;
}
.thumbnail-row {
    display: flex;
    gap: 10px;
    overflow-x: auto;
}
.thumbnail-box {
    width: 80px;
    height: 80px;
    border: 1px solid var(--border-color);
    padding: 5px;
    cursor: pointer;
    background: white;
    opacity: 0.6;
    transition: opacity 0.2s, border-color 0.2s;
}
.thumbnail-box img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.thumbnail-box:hover, .thumbnail-box.active {
    opacity: 1;
    border-color: var(--primary-color);
}
