/* Global Styles */
:root {
    --primary-color: #EC6100;
    --secondary-color: #333;
    --accent-color: #e74c3c;
    --light-gray: #f4f4f4;
    --white: #ffffff;
    --text-color: #333;
    --bg-color: #f9f9f9;
    --shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Noto Sans TC', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Header */
header {
    background: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-top {
    background: var(--secondary-color);
    color: var(--white);
    padding: 0.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}

.header-top a {
    color: var(--white);
}

.header-top a:hover {
    color: var(--light-gray);
}

.header-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo img {
    height: 50px;
}

.logo-text h1 {
    font-size: 1.5rem;
    color: var(--primary-color);
    line-height: 1.2;
}

.logo-text span {
    font-size: 0.9rem;
    color: var(--secondary-color);
}

/* Navigation */
.nav-menu {
    display: flex;
    gap: 2rem;
}

.nav-link {
    font-weight: 500;
    color: var(--secondary-color);
    padding: 0.5rem 0;
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: var(--transition);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.menu-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--secondary-color);
}

/* Hero Section */
.hero {
    background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url('pic/Cata-option-06c.jpg') no-repeat center center/cover;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--white);
    margin-bottom: 2rem;
    position: relative;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    padding: 0 1rem;
}

.hero h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

.btn {
    display: inline-block;
    padding: 0.8rem 2rem;
    background: var(--primary-color);
    color: var(--white);
    border-radius: 5px;
    font-weight: bold;
}

.btn:hover {
    background: #C85000;
}

/* Features Section */
.features {
    padding: 3rem 2rem;
    background: var(--white);
}

.features-grid {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.feature-card {
    text-align: center;
    padding: 2rem;
    border-radius: 10px;
    background: var(--bg-color);
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
}

.feature-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.feature-card h3 {
    margin-bottom: 1rem;
    color: var(--secondary-color);
}

/* Product Showcase (Homepage) */
.products {
    padding: 3rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    text-align: center;
    font-size: 2rem;
    margin: 0 auto 2rem auto;
    color: var(--secondary-color);
    position: relative;
    padding-bottom: 1rem;
    display: table;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--primary-color);
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.product-card {
    background: var(--white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.product-image {
    height: 200px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-info {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-info h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.product-info p {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 1rem;
}

/* News Section */
.news {
    padding: 3rem 2rem;
    background: var(--light-gray);
}

.news-container {
    max-width: 800px;
    margin: 0 auto;
}

.news-item {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary-color);
}

.news-date {
    font-size: 0.85rem;
    color: #888;
    display: block;
    margin-bottom: 0.5rem;
}

.news-title {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: var(--secondary-color);
}

.news-item a {
    color: var(--primary-color);
    font-weight: 500;
    margin-left: 0.5rem;
}

.news-item a:hover {
    text-decoration: underline;
}

/* Footer */
footer {
    background: var(--secondary-color);
    color: var(--white);
    padding: 3rem 2rem 1rem;
    margin-top: 3rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
    display: inline-block;
}

.footer-bottom {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #555;
    font-size: 0.9rem;
}

/* Catalogue Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    display: flex;
    gap: 2rem;
}

.sidebar {
    flex: 0 0 250px;
    background: var(--white);
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: var(--shadow);
    height: fit-content;
}

.sidebar-title {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
}

.sidebar-nav ul {
    list-style: none;
}

.sidebar-nav li {
    margin-bottom: 0.5rem;
}

.sidebar-nav a {
    display: block;
    padding: 0.5rem;
    color: var(--secondary-color);
    border-radius: 5px;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background-color: var(--light-gray);
    color: var(--primary-color);
}

.sidebar-nav ul ul {
    padding-left: 1rem;
    margin-top: 0.5rem;
    font-size: 0.9rem;
}

.main-content {
    flex: 1;
    background: var(--white);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.page-title {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    color: var(--secondary-color);
    border-bottom: 1px solid var(--light-gray);
    padding-bottom: 1rem;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 2rem;
    min-width: 600px;
}

.table-responsive table td img {
    max-width: 120px;
    width: auto;
    height: auto;
}

th,
td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--light-gray);
}

th {
    background-color: var(--bg-color);
    font-weight: bold;
    color: var(--secondary-color);
}

tr:hover {
    background-color: #f5f5f5;
}

/* Badges & Labels */
.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
    color: white;
}

.badge-new {
    background-color: #e74c3c;
}

.badge-success {
    background-color: #2ecc71;
}

.badge-secondary {
    background-color: #6c757d;
}

/* Product List in Catalogue */
.catalogue-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.catalogue-item {
    border: 1px solid var(--light-gray);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    transition: var(--transition);
}

.catalogue-item:hover {
    box-shadow: var(--shadow);
    border-color: var(--primary-color);
}

.catalogue-item img {
    max-height: 150px;
    margin: 0 auto 1rem;
}

.catalogue-item h4 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

/* Mobile Generated Cells & Container - Hidden on Desktop */
.mobile-generated,
.mobile-card-container {
    display: none;
}

/* Responsive */
@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }

    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--white);
        flex-direction: column;
        padding: 1rem;
        box-shadow: var(--shadow);
        z-index: 999;
    }

    .nav-menu.active {
        display: flex;
    }

    .header-main {
        padding: 1rem;
    }

    .hero h2 {
        font-size: 2rem;
    }

    .container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
    }

    /* Hide the original table completely */
    .table-responsive table {
        display: none !important;
    }

    /* Style the new mobile card container */
    .mobile-card-container {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 1.5rem;
        padding: 1rem 0;
    }

    .mobile-card {
        background: #fff;
        border-radius: 12px;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        overflow: hidden;
        display: flex;
        flex-direction: column;
        transition: transform 0.2s;
        border: 1px solid #eee;
    }

    .mobile-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
    }

    /* Header: Product Name */
    .mobile-card-header {
        background: #f8f9fa;
        padding: 1rem;
        border-bottom: 1px solid #eee;
        text-align: center;
        font-weight: bold;
        font-size: 1.1rem;
        color: #333;
    }

    .mobile-card-header a {
        color: #333;
        text-decoration: none;
    }

    /* Body: Image */
    .mobile-card-body {
        padding: 0.5rem;
        /* Reduced padding */
        text-align: center;
        background: #fff;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .mobile-card-body img {
        width: 100%;
        height: 180px;
        /* Fixed height */
        object-fit: contain;
        /* Ensure image fits */
        max-width: 100% !important;
        /* Override inline styles */
    }

    /* Footer: Variants Grid */
    .mobile-card-variants {
        padding: 0.5rem;
        background: #fff;
        border-top: 1px solid #eee;
        display: block;
        /* Ensure visibility */
    }

    .variant-grid {
        width: 100%;
        font-size: 0.85rem;
    }

    .variant-header {
        background: #f8f9fa;
        padding: 0.4rem;
        text-align: center;
        font-weight: 600;
        color: #555;
    }

    .variant-cell {
        background: #fff;
        padding: 0.4rem;
        text-align: center;
        color: #666;
    }

    /* Search Bar Styles */
}

/* Search Bar Styles */
.search-container {
    margin-bottom: 2rem;
    max-width: 400px;
    /* Reduced specific width for elegance */
    position: relative;
    /* Ensure absolute dropdown positions correctly relative to this */
    margin-left: auto;
    /* Center alignment helpers if needed, though usually handled by parent flex/grid */
    margin-right: auto;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input-wrapper i {
    position: absolute;
    left: 15px;
    color: #999;
    font-size: 0.9rem;
}

#product-search {
    width: 100%;
    padding: 10px 15px 10px 40px;
    /* Slimmer padding */
    font-size: 0.95rem;
    /* Slightly smaller font */
    border: 1px solid #ddd;
    /* Thinner border */
    border-radius: 50px;
    transition: all 0.3s ease;
    outline: none;
    background: #fdfdfd;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02);
    /* Very subtle depth */
}

#product-search:focus {
    border-color: var(--primary-color);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(236, 97, 0, 0.15);
}

@media (max-width: 768px) {
    .search-container {
        margin-bottom: 1.5rem;
    }
}

/* Search Results Dropdown - Refined Compact Style (Global) */
.search-results-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    max-height: 350px;
    overflow-y: auto;
    margin-top: 5px;
    text-align: left;
    /* Reset text align for hero context */
}

.search-section-title {
    padding: 8px 12px;
    background: #f4f4f4;
    color: #777;
    font-size: 0.8rem;
    font-weight: 700;
    border-bottom: 1px solid #eee;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.search-result-item {
    display: flex;
    align-items: center;
    padding: 6px 12px;
    border-bottom: 1px solid #f0f0f0;
    color: #333;
    transition: background 0.2s;
    text-decoration: none;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: #fff8f0;
    /* Very light orange tint */
}

.result-img {
    width: 36px;
    height: 36px;
    margin-right: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 4px;
    padding: 1px;
}

/* Product Page Specific Styles (SY-DPCA-C-2) */

/* Product Hero */
.product-hero {
    background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url('pic/DPCA CASE PHOTO.jpg') no-repeat center center/cover;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--white);
    position: relative;
    margin-bottom: 0;
}

.product-hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    line-height: 1.2;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.product-hero .hero-slogan {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    font-weight: 300;
    opacity: 0.9;
}

.btn-lg {
    padding: 0.6rem 1.2rem;
    font-size: 1rem;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(236, 97, 0, 0.4);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.btn-lg:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(236, 97, 0, 0.6);
}

/* Features Section (Alternating) */
.pro-features {
    padding: 5rem 2rem;
    background: #fff;
    overflow: hidden;
}

.container-fluid {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.feature-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 5rem;
    gap: 4rem;
}

.feature-row:last-child {
    margin-bottom: 0;
}

.feature-row.reverse {
    flex-direction: row-reverse;
}

.feature-img {
    flex: 1;
    max-width: 50%;
    position: relative;
}

.feature-img img {
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: transform 0.5s ease;
}

.feature-row:hover .feature-img img {
    transform: scale(1.02);
}

.feature-text {
    flex: 1;
    max-width: 50%;
    padding: 2rem;
}

.feature-icon-box {
    width: 60px;
    height: 60px;
    background: rgba(236, 97, 0, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
}

.feature-text h3 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--secondary-color);
    position: relative;
}

.feature-text h3 small {
    display: block;
    font-size: 1rem;
    color: #888;
    font-weight: 400;
    margin-top: 5px;
}

.feature-text p {
    font-size: 1.1rem;
    color: #666;
    line-height: 1.8;
}

/* Download Section */
.downloads-section {
    padding: 5rem 2rem;
    background: #f8f9fa;
    text-align: center;
}

.downloads-section .section-title {
    margin-bottom: 3rem;
}

.downloads-section .section-title small {
    display: block;
    font-size: 1.2rem;
    color: #888;
    margin-top: 10px;
    font-weight: normal;
}

.download-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .downloads-section {
        padding: 3rem 0;
    }


    .download-grid {
        display: flex;
        overflow-x: auto;
        gap: 1rem;
        padding: 0 1.5rem 1.5rem;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        /* Hide scrollbar for cleaner look if desired, but keep functionality */
        scrollbar-width: none;

        /* Fix for flex item overflow */
        width: 100%;
        min-width: 0;
    }

    .download-grid::-webkit-scrollbar {
        display: none;
    }

    .download-card {
        flex: 0 0 85%;
        max-width: 350px;
        scroll-snap-align: center;
        margin: 0;
    }
}

.download-card {
    background: var(--white);
    padding: 3rem 2rem;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.download-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
    border-color: rgba(236, 97, 0, 0.2);
}

.download-card i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.download-card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.download-card p {
    color: #888;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.download-card .desc {
    display: block;
    color: #555;
    margin-bottom: 2rem;
    font-size: 1rem;
    min-height: 48px;
    /* Alignment fix */
}

.dl-btn {
    display: inline-block;
    padding: 0.8rem 2rem;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    border-radius: 30px;
    font-weight: bold;
    transition: all 0.3s;
}

.dl-btn:hover {
    background: var(--primary-color);
    color: var(--white);
}

/* Mobile Responsiveness for Product Page */
@media (max-width: 768px) {
    .product-hero h1 {
        font-size: 2rem;
    }

    .feature-row,
    .feature-row.reverse {
        flex-direction: column;
        gap: 2rem;
        text-align: center;
        margin-bottom: 4rem;
    }

    .feature-img,
    .feature-text {
        max-width: 100%;
        padding: 0;
    }

    .feature-icon-box {
        margin: 0 auto 1.5rem;
    }
}


.result-img img {
    max-width: 100%;
    max-height: 100%;
}

.result-info {
    flex: 1;
    /* Flex row for compact look if desired, or keep column for clarity. Keeping column but tighter. */
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: left;
    /* Ensure text aligns left even if container is centered */
}

.result-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--primary-color);
    margin-bottom: 0;
    line-height: 1.2;
}

.result-model {
    font-size: 0.75rem;
    color: #999;
    line-height: 1.2;
}

.search-message {
    padding: 15px;
    text-align: center;
    color: #888;
    font-size: 0.9rem;
}