/* [IMPROVEMENT] Google Fonts: Noto Sans (Global), KR, JP, SC */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@300;400;700&family=Noto+Sans+JP:wght@300;400;700&family=Noto+Sans+SC:wght@300;400;700&family=Noto+Sans:wght@300;400;600;700&display=swap');

:root {
    --primary: #1E4A87;
    --primary-hover: #163866;
    --accent: #EAAA00;
    --bg-color: #ffffff;
    --text-main: #111;
    --text-sub: #444;
    --section-bg: #f9f9f9;
    --border: #e1e1e1;
    --font-stack: 'Noto Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    
    /* Dark Mode Variables */
    --dm-bg: #1A1D24;
    --dm-text: #EAEAEA;
    --dm-section: #232730;
    --dm-border: #394150;

    /* Z-Index Hierarchy */
    --z-back: -1;
    --z-normal: 1;
    --z-sticky-btn: 100;   /* Scroll To Top, Scroll Indicator */
    --z-header: 1000;      /* Fixed Header */
    --z-dropdown: 1010;    /* Language Selector */
    --z-modal: 2000;       /* Cookie Popup */
    --z-overlay: 3000;     /* Lightbox */
}

/* Language-specific Fonts */
html[lang="ko-KR"] body { font-family: 'Noto Sans KR', var(--font-stack); }
html[lang="ja-JP"] body { font-family: 'Noto Sans JP', var(--font-stack); }
html[lang="zh-CN"] body { font-family: 'Noto Sans SC', var(--font-stack); }

body.dark-mode {
    --bg-color: var(--dm-bg);
    --text-main: var(--dm-text);
    --text-sub: #B0B8C4;
    --section-bg: var(--dm-section);
    --border: var(--dm-border);
}

body.no-scroll { overflow-y: hidden; }

* { box-sizing: border-box; }
body { margin: 0; font-family: var(--font-stack); background: var(--bg-color); color: var(--text-main); transition: 0.3s; line-height: 1.6; }
a { text-decoration: none; color: inherit; transition: 0.2s; }
button { font-family: inherit; cursor: pointer; }
img { max-width: 100%; display: block; }

/* Header & Nav */
header {
    position: fixed; top: 0; width: 100%; 
    z-index: var(--z-header); 
    background: rgba(255, 255, 255, 0.9); backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border); padding: 15px 0;
}
body.dark-mode header { background: rgba(26, 29, 36, 0.9); }

.header-inner { display: flex; justify-content: space-between; align-items: center; max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.header-logo { width: 120px; }

.main-nav { display: flex; gap: 40px; font-weight: 600; font-size: 1rem; }
.main-nav a:hover { color: var(--primary); }
.main-nav .highlight-link { color: var(--accent); }

.header-controls { display: flex; gap: 15px; align-items: center; }
#lang-selector-button, #dark-mode-toggle { background: none; border: none; font-size: 1.1rem; color: var(--text-sub); display: flex; align-items: center; gap: 8px; cursor: pointer; }

#current-lang-flag { 
    width: 24px; height: 24px; 
    object-fit: cover; border-radius: 50%; 
    border: 1px solid rgba(0,0,0,0.1); display: block;
}

/* Language Selector */
#lang-options { 
    display: none; position: absolute; background: var(--bg-color); border: 1px solid var(--border); 
    top: 100%; right: 0; padding: 15px; border-radius: 8px; box-shadow: 0 5px 15px rgba(0,0,0,0.1); 
    max-height: 400px; overflow-y: auto; width: 220px; 
    z-index: var(--z-dropdown); 
}
#lang-options.visible { display: grid; grid-template-columns: 1fr; gap: 8px; }

@media (min-width: 768px) {
    #lang-options { width: 480px; } 
    #lang-options.visible { grid-template-columns: repeat(3, 1fr); }
}

#lang-options a { display: flex; align-items: center; gap: 10px; padding: 8px; font-size: 0.9rem; border-radius: 5px; }
#lang-options a:hover { background: var(--section-bg); }
.lang-flag { width: 20px; height: 20px; object-fit: cover; border-radius: 50%; border: 1px solid rgba(0,0,0,0.1); }

/* Mobile Sub Navigation (Sticky Relay) */
.mobile-sub-nav {
    display: none; /* Desktop default: Hidden */
    background: rgba(255, 255, 255, 0.95);
    border-bottom: 1px solid var(--border);
    border-top: 1px solid rgba(0,0,0,0.05);
    padding: 12px 10px;
    width: 100%;
    
    /* Sticky Positioning */
    position: -webkit-sticky; 
    position: sticky;
    top: 60px; /* Sticks right under the main header */
    
    z-index: 990; 
    justify-content: center;
    backdrop-filter: blur(5px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);

    /* [MODIFIED] Auto-wrap behavior for narrow screens */
    flex-wrap: wrap;       
    white-space: normal;   
    overflow-x: visible;   
    gap: 15px;
}

.mobile-sub-nav::-webkit-scrollbar { display: none; }
.dark-mode .mobile-sub-nav { background: rgba(26, 29, 36, 0.95); border-top: 1px solid rgba(255,255,255,0.05); }
.mobile-sub-nav a { font-size: 0.95rem; font-weight: 600; color: var(--text-sub); display: inline-block; }
.mobile-sub-nav a.highlight-link { color: var(--accent); }

/* Hero Section */
.hero, .gallery-hero { position: relative; height: 80vh; min-height: 600px; display: flex; align-items: center; justify-content: center; text-align: center; color: #fff; overflow: hidden; }
.hero-media, .hero-video { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.hero-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.4); z-index: 1; }
.hero-content, .container { position: relative; z-index: 2; max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.hero h2, #gallery-title { font-size: 3rem; margin-bottom: 20px; font-weight: 700; text-shadow: 0 2px 10px rgba(0,0,0,0.5); }
.hero p, .gallery-summary { font-size: 1.2rem; margin-bottom: 40px; max-width: 700px; margin-inline: auto; text-shadow: 0 1px 5px rgba(0,0,0,0.5); }
.gallery-summary { font-weight: 300; opacity: 0.9; margin-top: -10px; }

/* Hero Floating Shop Button */
.hero-shop-btn {
    position: absolute;
    bottom: 40px;
    right: 40px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.6);
    color: #fff;
    padding: 12px 28px;
    border-radius: 30px;
    font-weight: 600;
    z-index: 10;
    transition: all 0.3s ease;
    text-transform: uppercase;
    font-size: 0.9rem;
    cursor: pointer;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.hero-shop-btn:hover {
    background: #fff;
    color: var(--primary);
    transform: translateY(-3px);
}

/* Buttons */
.cta-button { padding: 15px 35px; background: var(--primary); color: #fff; border-radius: 30px; font-weight: 600; display: inline-block; }
.cta-button:hover { background: var(--primary-hover); transform: translateY(-3px); }

/* Sections */
.products-section { padding: 120px 0; background: var(--section-bg); text-align: center; }
#outdoor-mobility { background: var(--bg-color); } 

.section-title { font-size: 2.8rem; margin-bottom: 15px; font-weight: 700; text-align: center; color: var(--text-main); }
.section-subtitle { margin-bottom: 60px; color: var(--text-sub); font-size: 1.15rem; text-align: center; }

/* Product Grid (Index) */
.product-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; text-align: center; }
.product-grid.single-item { grid-template-columns: minmax(300px, 500px); justify-content: center; }

.product-item { 
    display: flex; flex-direction: column; 
    background: var(--bg-color); border-radius: 15px; overflow: hidden; 
    box-shadow: 0 5px 20px rgba(0,0,0,0.05); transition: 0.3s; 
    cursor: pointer; border: 1px solid var(--border); text-decoration: none; color: inherit; 
}
.product-item:hover { transform: translateY(-10px); box-shadow: 0 10px 30px rgba(0,0,0,0.1); }

.img-wrapper { height: 300px; padding: 0; background: #fff; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.img-wrapper img { width: 100%; height: 100%; object-fit: contain; }

/* [MODIFIED] Specific adjustment for In-Home Care to fill space */
#in-home-care .img-wrapper img {
    object-fit: cover;
    object-position: center;
}

#outdoor-mobility .img-wrapper { padding: 0; }
#outdoor-mobility .img-wrapper img { object-fit: cover; object-position: center bottom; transition: transform 0.3s ease; }

.product-info { padding: 30px; text-align: center; flex-grow: 1; display: flex; flex-direction: column; align-items: center; }
.product-info h3 { font-size: 1.4rem; margin-bottom: 10px; font-weight: 600; }
.product-info p { color: var(--text-sub); margin-bottom: 20px; font-size: 0.95rem; }

.feature-tags { margin-top: auto; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.feature-tags span { display: inline-block; padding: 6px 12px; background: rgba(30, 74, 135, 0.08); color: var(--primary); border-radius: 20px; font-size: 0.8rem; font-weight: 500; }

/* Features & Safety */
.features-section, .safety-section { padding: 100px 0; background: var(--bg-color); }
.safety-section { background: var(--section-bg); }
.features-grid, .safety-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 40px; text-align: center; margin-top: 40px; }
.icon { font-size: 2.5rem; color: var(--primary); margin-bottom: 20px; }
.feature-card h4, .safety-item h4 { font-size: 1.3rem; margin-bottom: 10px; font-weight: 600; }
.feature-card p, .safety-item p { color: var(--text-sub); line-height: 1.6; }

/* Testimonials */
.testimonials-section { padding: 100px 0; background: var(--bg-color); }
.testimonials-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; }
.testimonial-card { background: var(--section-bg); padding: 30px; border-radius: 15px; box-shadow: 0 5px 15px rgba(0,0,0,0.05); border: 1px solid var(--border); text-align: center; display: flex; flex-direction: column; justify-content: space-between; }
.testimonial-card.highlight { border: 2px solid var(--primary); background: rgba(30, 74, 135, 0.02); }
.review-text { font-style: italic; font-size: 1.1rem; margin-bottom: 20px; }
.reviewer { font-weight: bold; color: var(--text-sub); }

/* Final CTA */
.final-cta { padding: 120px 0; text-align: center; background: url('../img/final-cta.webp') center/cover; position: relative; color: #fff; }
.final-cta::before { content: ''; position: absolute; inset: 0; background: rgba(0,0,0,0.6); }

/* Gallery Common Styles */
.gallery-content { padding: 50px 20px; }
.mode-tabs { display: flex; justify-content: center; gap: 10px; margin: 40px 0; }
.tab-btn { padding: 10px 30px; border-radius: 20px; border: 1px solid var(--border); background: var(--bg-color); color: var(--text-sub); font-weight: 600; }
.tab-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.color-selection-area { text-align: center; margin-bottom: 40px; }
.filter-bar { display: flex; justify-content: center; gap: 15px; margin-top: 15px; }
.color-swatch { width: 35px; height: 35px; border-radius: 50%; cursor: pointer; border: 2px solid transparent; box-shadow: 0 0 5px rgba(0,0,0,0.2); }
.color-swatch.active { transform: scale(1.2); border-color: var(--text-main); }

/* Gallery Viewer Styles */
.gallery-viewer {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.main-stage {
    width: 100%;
    aspect-ratio: 1 / 1; 
    background: #f9f9f9;
    border-radius: 15px;
    overflow: hidden;
    position: relative;
    cursor: zoom-in;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* [MODIFIED] Gallery main image fill settings */
.main-stage img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.3s ease;
}

.main-stage:hover img {
    transform: scale(1.05); /* Zoom effect on hover */
}

.zoom-hint {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background: rgba(0,0,0,0.5);
    color: #fff;
    padding: 8px;
    border-radius: 50%;
    font-size: 0.9rem;
    opacity: 0;
    transition: 0.3s;
    pointer-events: none;
}

.main-stage:hover .zoom-hint {
    opacity: 1;
}

/* Thumbnail Strip */
.thumb-strip {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 10px;
    scroll-behavior: smooth;
    justify-content: flex-start;
}

.thumb-strip::-webkit-scrollbar {
    height: 6px;
}
.thumb-strip::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.thumb-item {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    border-radius: 10px;
    border: 2px solid transparent;
    cursor: pointer;
    overflow: hidden;
    opacity: 0.6;
    transition: all 0.2s;
    background: #f9f9f9;
}

.thumb-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumb-item:hover { opacity: 1; }

.thumb-item.active {
    border-color: var(--primary);
    opacity: 1;
    transform: translateY(-3px);
}

/* Cross Selling */
.cross-selling { padding: 80px 0; background: var(--bg-color); border-top: 1px solid var(--border); text-align: center; }
.cross-sell-grid { display: flex; justify-content: center; gap: 40px; margin-top: 40px; flex-wrap: wrap; }
.cross-item img { 
    width: 150px; height: 150px; 
    object-fit: contain; background: var(--section-bg); 
    border-radius: 50%; padding: 20px; 
    margin: 0 auto 15px; 
}
.cross-item {cursor: pointer; }
.cross-item:hover { transform: translateY(-5px); }
.cross-item h4 { text-align: center; margin-top: 10px; font-weight: 600; color: var(--text-main); }

/* Footer */
footer { background: #12141A; color: #888; padding: 60px 0; text-align: center; font-size: 0.9rem; }
.social-links a { color: #fff; font-size: 1.5rem; margin: 0 10px; }
.footer-row { margin: 20px 0; }
.footer-links a { margin: 0 5px; color: #aaa; }
.sep { color: #555; }
.business-info-ko { margin-top: 20px; font-size: 0.8rem; opacity: 0.7; display: none; }
html:lang(ko-KR) .business-info-ko { display: block; }

/* Scroll Indicator */
.scroll-indicator {
    position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%);
    color: var(--primary); font-size: 2em; opacity: 0.8; 
    z-index: var(--z-sticky-btn);
    animation: bounce 2s infinite; cursor: default;
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateX(-50%) translateY(0); }
    40% { transform: translateX(-50%) translateY(-10px); }
    60% { transform: translateX(-50%) translateY(-5px); }
}
.scroll-indicator.hidden { opacity: 0; visibility: hidden; }

/* Scroll Top Button */
#scrollToTopBtn { 
    position: fixed; bottom: 20px; right: 20px; 
    background-color: var(--primary); color: #fff;
    border: none; border-radius: 50%; width: 45px; height: 45px; 
    font-size: 1.2em; cursor: pointer; opacity: 0; visibility: hidden;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out, background-color 0.3s ease, transform 0.2s ease;
    z-index: var(--z-sticky-btn); 
    box-shadow: 0 4px 10px rgba(0,0,0,0.15); 
    display: flex; justify-content: center; align-items: center;
}
#scrollToTopBtn:hover { background-color: var(--primary-hover); transform: scale(1.1); }
#scrollToTopBtn.visible { opacity: 1; visibility: visible; }

/* Cookie Popup */
.cookie-popup { 
    position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); 
    background: var(--bg-color); padding: 30px; border-radius: 12px; 
    box-shadow: 0 10px 40px rgba(0,0,0,0.2); 
    z-index: var(--z-modal); 
    width: 90%; max-width: 500px; border: 1px solid var(--border); text-align: center; 
}
.cookie-content h3 { margin-top: 0; margin-bottom: 10px; font-size: 1.2rem; }
.cookie-content p { font-size: 0.9rem; color: var(--text-sub); margin-bottom: 20px; line-height: 1.6; }
.cookie-content a { color: var(--primary) !important; text-decoration: underline !important; font-weight: 500; }
.cookie-btns { margin-top: 20px; display: flex; gap: 10px; justify-content: center; }
.btn-accept, .btn-decline { padding: 12px 25px; border-radius: 8px; border: none; font-weight: bold; cursor: pointer; transition: 0.2s; flex: 1; }
.btn-accept { background: var(--primary); color: #fff; }
.btn-accept:hover { background: var(--primary-hover); }
.btn-decline { background: #f0f0f0; color: #333; }
.btn-decline:hover { background: #e0e0e0; }
.hidden { display: none !important; }

/* Lightbox */
.lightbox { 
    position: fixed; inset: 0; background: rgba(0,0,0,0.9); 
    z-index: var(--z-overlay); 
    display: none; align-items: center; justify-content: center; 
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 90%; max-height: 90vh; box-shadow: 0 0 20px rgba(0,0,0,0.5); }
.close-lightbox { position: absolute; top: 20px; right: 30px; color: #fff; font-size: 3rem; cursor: pointer; transition: 0.2s; }
.close-lightbox:hover { transform: scale(1.1); }

/* Lightbox Arrows */
.lb-arrow {
    position: absolute; top: 50%; transform: translateY(-50%);
    color: rgba(255,255,255,0.7); font-size: 2.5rem; 
    cursor: pointer; padding: 20px; z-index: 3100; user-select: none;
    transition: all 0.2s;
}
.lb-arrow:hover { color: #fff; transform: translateY(-50%) scale(1.1); }
#lb-prev { left: 10px; }
#lb-next { right: 10px; }

/* RTL Support */
html[dir="rtl"] { direction: rtl; text-align: right; }
html[dir="rtl"] .product-info, html[dir="rtl"] .testimonial-card, html[dir="rtl"] .section-title, html[dir="rtl"] .section-subtitle, html[dir="rtl"] .final-cta, html[dir="rtl"] .hero-content, html[dir="rtl"] .cross-item h4 { text-align: center; }

/* Responsive */
@media (max-width: 768px) {
    .main-nav { display: none; }
    /* Mobile Sub Nav is handled by the main definition + display:flex here */
    .mobile-sub-nav { display: flex; }
    .hero h2 { font-size: 2rem; }
    .header-inner { padding: 0 15px; }
    
    /* [MODIFIED] Added testimonials-grid to auto-stack on mobile */
    .product-grid, .features-grid, .safety-grid, .testimonials-grid { grid-template-columns: 1fr; }
    
    .product-grid.single-item { grid-template-columns: 1fr; }
    #lang-options { width: 220px; }
    #lang-options.visible { grid-template-columns: 1fr; }

    #outdoor-mobility .img-wrapper img {
        transform: scale(1.25);
        transform-origin: bottom center;
    }
    
    .hero-shop-btn { 
        bottom: 25px; right: 50%; 
        transform: translateX(50%); 
        width: max-content;
        padding: 10px 25px;
    }
    .hero-shop-btn:hover { transform: translateX(50%) translateY(-3px); }
    
    .lb-arrow { padding: 10px; font-size: 2rem; }

    .section-title {
        font-size: 1.8rem; 
        line-height: 1.3;
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
        padding: 0 10px;
    }
    .section-subtitle {
        font-size: 1rem;
        padding: 0 15px;
    }

    .header-logo {
        width: 25px; 
    }
}

/* [ADDED] Dark mode image background fix */
body.dark-mode .img-wrapper {
    background: var(--dm-section); 
    border-color: var(--dm-border);
}