/* Main Website Styles */
:root {
    --primary-color: #0078d7;
    --secondary-color: #005a9e;
    --accent-color: #ff6600;
    --light-gray: #f5f5f5;
    --dark-gray: #333;
    --text-color: #444;
    --white: #fff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Noto Sans TC", "Noto Sans SC", "Roboto", sans-serif;
    -webkit-tap-highlight-color: transparent;
}

/* Allow text content selection, but keep buttons and navigation non-selectable */
body,
p,
h1,
h2,
h3,
h4,
h5,
h6,
article,
section,
div {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

/* Keep buttons and navigation non-selectable */
button,
.btn,
.nav-links a,
.cookie-banner {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

body {
    color: var(--text-color);
    line-height: 1.6;
    padding-bottom: 0;
    /* Default padding */
}

/* When banner is active, add footer margin */
body.cookie-banner-active footer {
    margin-bottom: 60px;
}

a {
    text-decoration: none;
    color: var(--primary-color);
}

ul {
    list-style: none;
}

.container {
    max-width: 1300px;
    width: 100%;
    margin: 0 auto;
    padding: 0 20px;
}

/* Main Navigation */
.main-nav {
    background-color: var(--white);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

.logo img {
    height: 40px;
}

.nav-links {
    display: flex;
}

.nav-links li {
    position: relative;
    margin-left: 30px;
}

.nav-links a {
    color: var(--dark-gray);
    font-weight: 500;
    padding: 10px 0;
    display: block;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--primary-color);
}

/* Dropdown Menu */
.dropdown {
    position: absolute;
    background-color: var(--white);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    width: 200px;
    border-radius: 4px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    top: 100%;
    left: 0;
    z-index: 1;
}

.nav-links li:hover .dropdown {
    opacity: 1;
    visibility: visible;
}

.dropdown li {
    margin: 0;
}

.dropdown a {
    padding: 10px 15px;
    border-bottom: 1px solid #eee;
}

/* Hero Section */
.hero {
    background: var(--white);
    color: var(--text-color);
    padding: 0;
    text-align: center;
    overflow: hidden;
}

.hero .container {
    padding: 0;
    max-width: 100%;
}

.hero iframe {
    display: block;
    width: 100%;
    height: 580px;
    border: none;
    margin: 0;
}

.btn {
    display: inline-block;
    background-color: var(--accent-color);
    color: var(--white);
    padding: 12px 25px;
    border-radius: 4px;
    font-weight: 500;
    transition: background-color 0.3s;
}

.btn:hover {
    background-color: #e55c00;
}

/* Products Section */
.products {
    padding: 80px 0;
}

.section-title {
    text-align: center;
    margin-bottom: 50px;
}

.section-title h2 {
    font-size: 2rem;
    color: var(--dark-gray);
    margin-bottom: 15px;
}

.section-title p {
    color: #777;
    max-width: 700px;
    margin: 0 auto;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.product-card {
    background-color: var(--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
}

.product-card:hover {
    transform: translateY(-10px);
}

.product-img {
    height: 200px;
    background-color: var(--light-gray);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.product-img img {
    max-width: 80%;
    max-height: 80%;
}

.product-info {
    padding: 20px;
}

.product-info h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: var(--dark-gray);
}

.product-info p {
    color: #777;
    margin-bottom: 15px;
}

.product-actions {
    display: flex;
    justify-content: space-between;
}

/* News Section */
.news {
    padding: 30px 0 0px 0;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 100px;
}

.news-card {
    background-color: var(--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s;
}

.news-card:hover {
    transform: translateY(-10px);
}

.news-img {
    height: 200px;
    background-color: var(--light-gray);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.news-img img {
    max-width: 80%;
    max-height: 80%;
}

.news-info {
    padding: 50px;
}

.news-info h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: var(--dark-gray);
}

.news-info p {
    color: #777;
    margin-bottom: 15px;
}

.news-actions {
    display: flex;
    justify-content: space-between;
}

.btn-outline {
    border: 1px solid var(--primary-color);
    background-color: transparent;
    color: var(--primary-color);
}

.btn-outline:hover {
    background-color: var(--primary-color);
    color: var(--white);
}

/* Features Section */
.features {
    background-color: var(--light-gray);
    padding: 50px 0 50px 0;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}

.feature-item {
    text-align: center;
    padding: 30px;
}

.feature-item img {
    filter: invert(31%) sepia(100%) saturate(1352%) hue-rotate(195deg) brightness(96%) contrast(101%);
    height: 50px;
    margin-bottom: 20px;
}

.feature-item h3 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: var(--dark-gray);
}

/* Subscribe Section */
.subscribe {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 60px 0;
    text-align: center;
}

.subscribe h2 {
    font-size: 1.8rem;
    margin-bottom: 20px;
}

.subscribe p {
    max-width: 600px;
    margin: 0 auto 30px;
}

.subscribe-form {
    max-width: 500px;
    margin: 0 auto;
    display: flex;
}

.subscribe-form input {
    flex: 1;
    padding: 12px 15px;
    border: none;
    border-radius: 4px 0 0 4px;
    font-size: 1rem;
}

.subscribe-form button {
    background-color: var(--accent-color);
    color: var(--white);
    border: none;
    padding: 0 25px;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    font-weight: 500;
}

/* Footer */
footer {
    background-color: var(--dark-gray);
    color: #aaa;
    padding: 60px 0 20px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

/* Footer Columns */
.footer-col h3 {
    color: var(--white);
    margin-top: 20px;
    margin-bottom: 8px;
    font-size: 1.2rem;
    line-height: 1.6;
}

.footer-col h3:first-child {
    margin-top: 0;
}

.footer-col ul {
    margin-bottom: 15px;
}

.footer-col ul li {
    margin-bottom: 10px;
}

.footer-col a {
    color: #aaa;
    transition: color 0.3s;
}

.footer-col a:hover {
    color: var(--white);
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-links a {
    display: inline-block;
    width: 36px;
    height: 36px;
    background-color: #444;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s;
}

.social-links a img {
    width: 16px;
    height: 16px;
    filter: brightness(0) invert(1);
}

.social-links a:hover {
    background-color: var(--primary-color);
}

.copyright {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #444;
}

/* Product Iframe */
.product-iframe {
    width: 100%;
    height: calc(100vh - 150px);
    border: none;
    display: block;
}

#product-container {
    width: 100%;
    padding: 20px 0;
    background-color: var(--white);
}

/* Language Select */
.language-select {
    margin-left: 20px;
    position: relative;
}

.language-select select {
    padding: 5px 10px;
    border-radius: 4px;
    border: 1px solid #ddd;
    background-color: var(--white);
    font-size: 14px;
    cursor: pointer;
}

/* Screen reader only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
    }

    .nav-links {
        margin-top: 15px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .nav-links li {
        margin: 5px 10px;
    }

    .dropdown {
        position: static;
        width: 100%;
        box-shadow: none;
        opacity: 1;
        visibility: visible;
        display: none;
    }

    .nav-links li:hover .dropdown {
        display: block;
    }

    .hero iframe {
        height: 400px;
    }

    .subscribe-form {
        flex-direction: column;
    }

    .subscribe-form input {
        border-radius: 4px;
        margin-bottom: 10px;
    }

    .subscribe-form button {
        border-radius: 4px;
        padding: 12px;
    }
}

/* Cookie Banner Styles */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #000;
    border-top: 1px solid #333;
    color: var(--white);
    padding: 15px 0;
    z-index: 9999;
    display: none;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
}

.cookie-banner.show {
    display: block;
}

.cookie-banner .container {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 20px;
}

.cookie-banner p {
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    border-radius: 4px;
    padding: 8px 12px;
    margin: 0 0 8px 0;
    font-size: 14px;
    line-height: 1.5;
    flex: 1;
    padding-right: 20px;
}

.cookie-banner p strong {
    background: rgba(0, 0, 0, 0.8);
    display: inline;
    padding: 0 4px;
    border-radius: 4px;
    font-size: 21px;
    margin-bottom: 8px;
}

.cookie-banner .buttons {
    display: flex;
    gap: 12px;
    flex-shrink: 0;
    margin-top: 38px;
}

.cookie-banner button {
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.3s;
    min-width: 80px;
}

.cookie-banner button:hover {
    background-color: var(--secondary-color);
}

.cookie-banner button.secondary {
    background-color: transparent;
    border: 1px solid var(--white);
    color: var(--white);
}

.cookie-banner button.secondary:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--white);
}

@media (max-width: 768px) {
    .cookie-banner .container {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }

    .cookie-banner p {
        padding-right: 0;
        margin-bottom: 10px;
    }

    .cookie-banner .buttons {
        width: 100%;
        justify-content: center;
    }

    .cookie-banner button {
        flex: 1;
        max-width: 150px;
    }
}

.cookie-banner a {
    color: #0078d7;
    font-weight: bold;
    text-decoration: underline;
    transition: color 0.2s;
}

.cookie-banner a:hover {
    color: #ffcc00;
}