:root {
    --primary-red: #c00000;
    --dark-red: #8a0000;
    --white: #ffffff;
    --light-bg: #f9f9f9;
    --text-dark: #333333;
    --gold: #ffb703;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Prompt', sans-serif; }
body { color: var(--text-dark); line-height: 1.6; overflow-x: hidden; scroll-behavior: smooth; }
.container { width: 90%; max-width: 1200px; margin: 0 auto; }
.text-red { color: var(--primary-red); }
.text-left { text-align: left; }
.text-center { text-align: center; }
.font-bold { font-weight: bold; }
.section-padding { padding: 80px 0; }
.bg-light { background-color: var(--light-bg); }
.w-100 { width: 100%; }

/* Preloader */
#preloader {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: var(--white); display: flex; flex-direction: column;
    align-items: center; justify-content: center; z-index: 10000;
    transition: opacity 0.5s ease;
}
.sun-spinner { font-size: 5rem; animation: spin 3s linear infinite; }
@keyframes spin { 100% { transform: rotate(360deg); } }

/* Buttons & Effects */
.btn-primary, .btn-secondary {
    display: inline-block; padding: 12px 25px; border-radius: 5px; text-align: center;
    text-decoration: none; font-weight: 600; transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
    border: none; cursor: pointer; font-size: 1rem; position: relative; overflow: hidden;
}
.btn-primary { background-color: var(--primary-red); color: var(--white); }
.btn-primary:hover { background-color: var(--dark-red); transform: translateY(-3px); box-shadow: 0 8px 15px rgba(192,0,0,0.4); }
.btn-secondary { color: var(--primary-red); border: 2px solid var(--primary-red); background: transparent; }
.btn-secondary:hover { background: var(--primary-red); color: var(--white); transform: translateY(-3px); }
.glow-btn:hover { box-shadow: 0 0 20px rgba(192,0,0,0.6); }
.hover-float { transition: transform 0.3s ease, box-shadow 0.3s ease; }
.hover-float:hover { transform: translateY(-5px); box-shadow: 0 15px 30px rgba(0,0,0,0.1); }

/* === Navbar === */
header {
    position: fixed; top: 0; width: 100%; background-color: var(--white);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1); z-index: 1000; transition: 0.3s;
}

.nav-container { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; }
.logo-wrapper { display: flex; align-items: center; gap: 15px; text-decoration: none; z-index: 1002; }

.nav-logo { 
    height: 70px; 
    transform: scale(0.8); 
    transform-origin: left center;
    object-fit: contain; 
    mix-blend-mode: multiply; 
    transition: 0.3s; 
    margin: -15px 0; 
}
.logo-text { font-size: 1.8rem; font-weight: 700; color: var(--primary-red); display: none; }

.nav-links { 
    list-style: none; 
    display: flex; 
    gap: 8px; 
    align-items: center; 
}

.nav-links li a {
    text-decoration: none; 
    color: var(--text-dark); 
    font-weight: 600;
    position: relative; 
    padding: 6px 10px; 
    border-radius: 8px;
    transition: color 0.3s ease, transform 0.3s ease; 
    display: inline-block; 
    z-index: 1;
    font-size: 14px; 
    white-space: nowrap; 
}

.lang-switcher { display: flex; gap: 5px; align-items: center; font-weight: bold; color: #ccc; }
.lang-btn { background: none; border: none; font-size: 0.95rem; cursor: pointer; color: var(--text-dark); font-family: 'Prompt'; transition: 0.3s; }
.lang-btn.active { color: var(--primary-red); text-decoration: underline; font-weight: 700; }
.lang-btn:hover { color: var(--primary-red); }

.mobile-only-btn { display: none; }
.hamburger { display: none; cursor: pointer; flex-direction: column; gap: 6px; z-index: 1002; }
.hamburger .bar { width: 30px; height: 3px; background-color: var(--text-dark); transition: all 0.4s ease-in-out; border-radius: 3px; }

/* === Promo Hero Slider === */
.promo-hero { position: relative; height: clamp(500px, 80vh, 850px); margin-top: 70px; overflow: hidden; }
.promo-slider-container { width: 100%; height: 100%; position: relative; }
.promo-track { position: relative; width: 100%; height: 100%; }
.promo-slide { 
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center; text-align: center; color: var(--white); 
    opacity: 0; transition: opacity 1s ease-in-out; z-index: 0; overflow: hidden; padding: 20px;
}
.promo-slide.active-slide { opacity: 1; z-index: 1; }
.promo-bg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; transition: transform 6s linear; }
.promo-slide.active-slide .promo-bg { transform: scale(1.1); }
.promo-slide::before { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.45); z-index: -1; }

.glass-effect {
    background: rgba(255, 255, 255, 0.15); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3); padding: 40px; border-radius: 20px; box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    max-width: 800px; width: 100%;
}

.promo-content h2 { font-size: clamp(1.8rem, 4vw, 3.5rem); margin-bottom: 20px; text-shadow: 2px 2px 5px rgba(0,0,0,0.5); line-height: 1.3; }
.promo-content p { font-size: clamp(1rem, 2vw, 1.25rem); margin-bottom: 30px; text-shadow: 1px 1px 3px rgba(0,0,0,0.5); }
.promo-btn {
    position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,0.3);
    color: var(--white); border: none; width: 45px; height: 45px; border-radius: 50%; font-size: 1.3rem; cursor: pointer; z-index: 10; transition: 0.3s; backdrop-filter: blur(5px);
    display: flex; align-items: center; justify-content: center;
}
.promo-btn:hover { background: var(--primary-red); box-shadow: 0 0 15px rgba(192,0,0,0.5); }
#promoPrevBtn { left: 15px; }
#promoNextBtn { right: 15px; }
.slider-dots { position: absolute; bottom: 25px; left: 50%; transform: translateX(-50%); display: flex; gap: 10px; z-index: 10; }
.dot { width: 12px; height: 12px; border-radius: 50%; background: rgba(255,255,255,0.5); cursor: pointer; transition: 0.3s; }
.dot.active { background: var(--primary-red); transform: scale(1.3); }

/* === Marquee (แถบตัวหนังสือเลื่อน) === */
.marquee-container {
    background: linear-gradient(135deg, var(--dark-red), var(--primary-red)); /*[cite: 34] */
    color: var(--white); /*[cite: 34] */
    padding: 12px 0; /*[cite: 34] */
    overflow: hidden; /*[cite: 34] */
    white-space: nowrap; /*[cite: 34] */
    position: relative; /*[cite: 34] */
    display: flex; /*[cite: 34] */
    align-items: center; /*[cite: 34] */
    box-shadow: 0 4px 10px rgba(0,0,0,0.1); /*[cite: 34] */
}

.marquee-content {
    display: flex;
    gap: 30px; /* ระยะห่างระหว่างชุดข้อความ */
    padding-right: 30px;
    /* เปลี่ยนจาก 25s เป็น 40s เพื่อลดความเร็วลง[cite: 34] */
    animation: marquee-scroll 40s linear infinite; 
    font-size: 1.2rem; /*[cite: 34] */
    font-weight: 600; /*[cite: 34] */
    flex-shrink: 0;
}

@keyframes marquee-scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

/* === Promotion Page Styles === */
.promo-features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 15px; margin-bottom: 35px; }
.feature-box { background: #fff; padding: 15px; border-radius: 10px; box-shadow: 0 4px 10px rgba(0,0,0,0.05); display: flex; align-items: center; gap: 10px; font-weight: 600; border: 1px solid #eee; transition: 0.3s; }
.feature-box:hover { border-color: var(--primary-red); transform: translateY(-3px); box-shadow: 0 6px 15px rgba(192,0,0,0.1); }
.feature-icon { font-size: 1.5rem; }
.promo-table-wrapper { overflow-x: auto; background: #fff; border-radius: 15px; box-shadow: 0 5px 25px rgba(0,0,0,0.08); margin: 0 auto; max-width: 900px; }
.promo-table { width: 100%; border-collapse: collapse; text-align: center; }
.promo-table th, .promo-table td { padding: 15px; border-bottom: 1px solid #eee; }
.promo-table th { background: var(--dark-red); color: white; font-size: 1.1rem; }
.promo-table .highlight-th { background: var(--primary-red); }
.promo-table tbody tr:hover { background: #fdf5f5; }
.promo-table .price-highlight { color: var(--primary-red); font-weight: bold; font-size: 1.2rem; }

/* === Calculator === */
.section-title { font-size: clamp(1.8rem, 3.5vw, 2.5rem); margin-bottom: 20px; position: relative; display: inline-block; }
.section-title::after { content: ''; display: block; width: 50px; height: 4px; background: var(--primary-red); margin: 10px auto 0; border-radius: 2px; }
.calc-wrapper { display: flex; flex-wrap: wrap; gap: 30px; justify-content: space-between; align-items: stretch; }
.calc-form, .calc-result { background: var(--white); padding: 35px; border-radius: 15px; box-shadow: 0 5px 25px rgba(0,0,0,0.05); flex: 1; min-width: 290px; display: flex; flex-direction: column; justify-content: space-between; }
.form-group { margin-bottom: 20px; text-align: left; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 600; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 12px; border: 1px solid #ccc; border-radius: 8px; font-size: 1rem; transition: 0.3s; background: #fcfcfc; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: var(--primary-red); box-shadow: 0 0 8px rgba(192,0,0,0.2); background: #fff; }
.calc-result h3 { text-align: center; margin-bottom: 25px; border-bottom: 2px solid var(--light-bg); padding-bottom: 10px; color: var(--text-dark); }
.result-box { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; padding: 15px; background: var(--light-bg); border-radius: 8px; border-left: 5px solid var(--primary-red); transition: 0.3s; }
.result-box:hover { transform: translateX(5px); background: #f0f0f0; }
.result-box h4 { font-size: 1.3rem; }

/* === Solar Panel HIGHLIGHT Card & Image Effects === */
.solar-highlight-card { position: relative; background: linear-gradient(145deg, #ffffff, #fff8f8); border: 3px solid var(--primary-red); border-radius: 20px; padding: 35px 30px; box-shadow: 0 10px 30px rgba(192, 0, 0, 0.15); margin-bottom: 50px; cursor: pointer; transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1); overflow: hidden; }
.solar-highlight-card:hover { transform: translateY(-8px); box-shadow: 0 20px 45px rgba(192, 0, 0, 0.25); border-color: #e60000; }
.highlight-badge { position: absolute; top: 0; right: 0; background: linear-gradient(135deg, #ff9800, var(--primary-red)); color: white; padding: 8px 25px; font-size: 0.95rem; font-weight: bold; border-bottom-left-radius: 15px; box-shadow: 0 4px 10px rgba(0,0,0,0.2); }
.solar-highlight-wrapper { display: flex; flex-wrap: wrap; align-items: center; gap: 30px; }
.solar-img-box { flex: 1; min-width: 240px; height: 240px; display: flex; align-items: center; justify-content: center; border-radius: 12px; background: #ffffff; padding: 10px; }
.solar-info-box { flex: 2; min-width: 280px; }
.solar-info-box h3 { font-size: clamp(1.4rem, 2.5vw, 1.8rem); color: var(--text-dark); margin-bottom: 8px; }
.highlight-warranty { font-weight: bold; font-size: 1.1rem; margin-bottom: 15px; }
.solar-feature-list { list-style: none; margin-bottom: 20px; line-height: 1.8; color: #444; }
.solar-feature-list li { position: relative; padding-left: 22px; margin-bottom: 8px; }
.solar-feature-list li::before { content: '✔'; position: absolute; left: 0; color: var(--primary-red); font-weight: bold; }

/* Financial Section Styling */
.financial-services { margin-top: 40px; margin-bottom: 50px; background: linear-gradient(135deg, #3f1a18, #c00000); padding: 40px 25px; border-radius: 20px; color: white; box-shadow: 0 10px 30px rgba(192, 0, 0, 0.25); }
.financial-services h3 { font-size: clamp(1.5rem, 3vw, 2rem); margin-bottom: 15px; }
.fin-desc { font-size: 1.05rem; margin-bottom: 35px; max-width: 850px; margin-left: auto; margin-right: auto; line-height: 1.6; opacity: 0.95; }
.fin-grid { display: flex; flex-wrap: wrap; gap: 25px; justify-content: center; }
.fin-card { flex: 1; min-width: 250px; max-width: 360px; background: white; border-radius: 15px; padding: 18px; text-align: center; color: #333; box-shadow: 0 8px 20px rgba(0,0,0,0.15); transition: transform 0.4s ease; }
.fin-card:hover { transform: translateY(-8px); }
.fin-img-wrapper { width: 100%; border-radius: 10px; overflow: hidden; margin-bottom: 15px; }
.fin-img-wrapper img { width: 100%; height: auto; display: block; }

/* === Wire Section Banner === */
.wire-banner { background: linear-gradient(135deg, #1e293b, #c00000); padding: 25px 20px; border-radius: 15px; color: var(--white); text-align: center; margin-top: 40px; margin-bottom: 25px; box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2); }
.wire-banner-title { font-size: clamp(1.2rem, 2.5vw, 1.8rem); font-weight: 700; text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.4); }

/* === Image Hover Effects === */
.img-hover-effect { transition: transform 0.5s ease, filter 0.5s ease; }
.product-card:hover .img-hover-effect, .fin-card:hover .img-hover-effect, .qr-code-img:hover, .promo-image-placeholder img:hover { transform: scale(1.05); filter: brightness(1.05); }

.section-sub-heading { margin-top: 50px; margin-bottom: 20px; border-left: 5px solid var(--primary-red); padding-left: 15px; font-size: clamp(1.3rem, 2.5vw, 1.6rem); }
.products-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 25px; }
.product-card { background: var(--white); border-radius: 15px; padding: 20px; box-shadow: 0 5px 15px rgba(0,0,0,0.05); transition: all 0.4s ease; border: 1px solid #eee; overflow: hidden; cursor: pointer; }
.product-card:hover { transform: translateY(-8px); box-shadow: 0 15px 30px rgba(0,0,0,0.12); border-color: #ddd; }
.product-img-wrapper { height: 180px; width: 100%; overflow: hidden; margin-bottom: 15px; border-radius: 10px; background: #fcfcfc; display: flex; align-items: center; justify-content: center;}
.product-img { width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; }

.btn-detail-link { display: inline-block; margin-top: 12px; font-size: 0.9rem; color: var(--primary-red); font-weight: 600; transition: 0.3s ease; }
.product-card:hover .btn-detail-link { transform: translateX(3px); text-decoration: underline; }

/* ========================================================
   Portfolio Grid (Masonry / Alternating Sizes & Watermark)
======================================================== */
.portfolio-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); 
    grid-auto-rows: 200px;
    grid-auto-flow: dense;
    gap: 20px; 
    margin-top: 30px; 
}
.portfolio-item { 
    position: relative; 
    border-radius: 15px; 
    overflow: hidden; 
    background: #eaeaea; 
    cursor: pointer; 
    transition: transform 0.4s ease, box-shadow 0.4s ease; 
    box-shadow: 0 5px 15px rgba(0,0,0,0.05); 
}
.portfolio-item:hover { 
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 15px 30px rgba(192,0,0,0.25); 
    z-index: 2;
}
.portfolio-img { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
    transition: transform 0.6s ease;
}
.portfolio-item:hover .portfolio-img {
    transform: scale(1.1);
}

.portfolio-item.large { grid-column: span 2; grid-row: span 2; }
.portfolio-item.wide { grid-column: span 2; grid-row: span 1; }
.portfolio-item.tall { grid-column: span 1; grid-row: span 2; }

/* ลายน้ำ (Watermark) */
.portfolio-item::after {
    content: 'NT POWERTECH';
    position: absolute;
    bottom: 12px;
    right: 15px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.3rem;
    font-weight: 700;
    pointer-events: none;
    z-index: 10;
    text-shadow: 2px 2px 5px rgba(0,0,0,0.9);
    font-family: 'Prompt', sans-serif;
    opacity: 0.8;
}

@media (max-width: 768px) {
    .portfolio-item.large, .portfolio-item.wide, .portfolio-item.tall {
        grid-column: span 1;
        grid-row: span 1;
    }
    .portfolio-grid { grid-auto-rows: 250px; }
}

/* Contact / About Us */
.contact-wrapper { display: flex; flex-wrap: wrap; gap: 30px; margin-top: 30px; }
.contact-info, .contact-form-box { flex: 1; min-width: 290px; background: var(--white); padding: 35px; border-radius: 15px; box-shadow: 0 5px 25px rgba(0,0,0,0.05); }
.contact-info p, .contact-methods p { margin-bottom: 12px; font-size: 1.05rem; }
.map-container { width: 100%; height: 250px; border-radius: 10px; overflow: hidden; border: 1px solid #ddd; margin-top: 15px; }
.line-qr-box { margin-top: 25px; text-align: center; background: #f9f9f9; padding: 20px; border-radius: 15px; border: 1px dashed #ccc; }
.qr-code-img { width: 150px; height: 150px; border: 1px solid #ddd; padding: 10px; border-radius: 10px; background: #fff; margin-top: 10px; cursor: pointer; }

/* Popups & Overlays Responsive Design */
.popup-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.7); backdrop-filter: blur(5px); display: none; align-items: center; justify-content: center; z-index: 9999; padding: 15px; }
/* ปรับขนาดกล่องป๊อปอัปให้กว้างขึ้น */
.popup-content { background: var(--white); padding: 30px; border-radius: 20px; width: 100%; max-width: 700px; max-height: 90vh; overflow-y: auto; -webkit-overflow-scrolling: touch; text-align: center; position: relative; box-shadow: 0 20px 40px rgba(0,0,0,0.3); }
/* ปรับขนาดรูปภาพในป๊อปอัปให้ใหญ่ขึ้น */
.popup-img { max-width: 100%; height: auto; border-radius: 10px; margin: 15px 0; max-height: 450px; object-fit: contain; }
.close-btn { position: absolute; top: 12px; right: 18px; font-size: 2rem; cursor: pointer; color: #888; transition: 0.3s; line-height: 1; }
.close-btn:hover { color: var(--primary-red); transform: rotate(90deg); }

.floating-buttons { position: fixed; bottom: 25px; right: 25px; display: flex; flex-direction: column; gap: 12px; z-index: 999; }
.float-btn { width: 55px; height: 55px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.6rem; color: white; text-decoration: none; box-shadow: 0 4px 15px rgba(0,0,0,0.2); transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.float-btn:hover { transform: scale(1.15) translateY(-5px); box-shadow: 0 8px 25px rgba(0,0,0,0.3); }
.float-fb { background-color: #1877F2; font-weight: bold; }
.float-line { background-color: #00B900; }
.float-phone { background-color: #007bff00; }

footer { background-color: var(--dark-red); color: var(--white); padding: 40px 0 20px; border-top: 5px solid var(--primary-red); }
.copyright { margin-top: 20px; font-size: 0.9rem; opacity: 0.8; }

/* Animations */
.fade-in { opacity: 0; transition: opacity 1s ease-out; }
.fade-in.visible { opacity: 1; }
.slide-up { opacity: 0; transform: translateY(40px); transition: opacity 0.8s ease-out, transform 0.8s cubic-bezier(0.25, 1, 0.5, 1); }
.slide-up.visible { opacity: 1; transform: translateY(0); }

/* FAQ Accordion */
.faq-container { width: 100%; max-width: 850px; margin: 30px auto 0; }
.faq-item { background: var(--white); border-radius: 10px; margin-bottom: 15px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); overflow: hidden; border: 1px solid #eee; }
.faq-question { padding: 18px 22px; font-size: 1.05rem; font-weight: 600; cursor: pointer; display: flex; justify-content: space-between; align-items: center; transition: 0.3s background, 0.3s; }
.faq-icon { font-size: 1.5rem; color: var(--primary-red); transition: transform 0.3s; }
.faq-answer { padding: 0 22px; max-height: 0; overflow: hidden; transition: max-height 0.4s ease, padding 0.4s ease; color: #555; background: #fafafa; }
.faq-item.active .faq-question { background-color: var(--light-bg); color: var(--primary-red); }
.faq-item.active .faq-icon { transform: rotate(45deg); }
.faq-item.active .faq-answer { max-height: 300px; padding: 18px 22px; }

/* === ระบบแสดงผลบนมือถือ === */
@media (max-width: 768px) {
    .nav-container { justify-content: space-between; }
    
    .hamburger { display: flex; position: absolute; right: 15px; top: 24px; z-index: 1010; }
    
    .hamburger.active .bar:nth-child(1) { transform: translateY(9px) rotate(45deg); }
    .hamburger.active .bar:nth-child(2) { opacity: 0; }
    .hamburger.active .bar:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }
    
    .nav-links {
        position: fixed; top: 10px; right: 10px; background: var(--white);
        flex-direction: column; gap: 5px; padding: 45px 15px 15px 15px;
        border-radius: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.2);
        width: fit-content; min-width: 160px; transform: translateX(150%);
        transition: transform 0.3s ease-in-out; align-items: flex-end; z-index: 1005;
    }
    
    .nav-links.active { transform: translateX(0); }
    .nav-links li { width: 100%; text-align: right; }
    .nav-links li a { padding: 5px 0; font-size: 0.95rem; display: block; }
    
    .desktop-btn { display: none; }
    .mobile-only-btn { display: block; margin-top: 8px; }
    
    .lang-switcher { justify-content: flex-end; margin-bottom: 5px; gap: 3px; font-size: 0.85rem;}
    
    .logo-text { font-size: 1.5rem; display: block;}
    .nav-logo { transform: scale(0.65); margin: -10px -15px -10px -5px;}
}