/* ==========================================
   1. ตั้งค่าพื้นฐาน (รีเซ็ตขอบหน้าจอ)
   ========================================== */
* {
    box-sizing: border-box; 
}

html, body {
    margin: 0 !important;
    padding: 0;
    width: 100%;
    overflow-x: hidden;
}

body {
    font-family: 'Maitree', serif;
    text-align: center; 
    background-color: #F9F5EB;
    padding-top: 90px; 
    padding-bottom: 0; 
    color: #5D4037; 
}

.container { 
    width: 100%; 
    padding: 0 !important; 
    margin: 0 !important; 
}

/* ==========================================
   2. Header
   ========================================== */
header {
    position: fixed; top: 0; left: 0; width: 100%; z-index: 1000; 
    background-color: #171B0E; 
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1600 400' preserveAspectRatio='none'%3E%3Cdefs%3E%3ClinearGradient id='gold-line' x1='0%25' y1='0%25' x2='100%25' y2='0%25'%3E%3Cstop offset='0%25' stop-color='%238B6914' stop-opacity='0'/%3E%3Cstop offset='50%25' stop-color='%23D4AF37' stop-opacity='0.6'/%3E%3Cstop offset='100%25' stop-color='%238B6914' stop-opacity='0'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cg fill='none' stroke='url(%23gold-line)' stroke-width='0.8' opacity='0.8'%3E%3Cpath d='M0,200 C200,50 400,350 600,200 C800,50 1000,350 1200,200 C1400,50 1600,350 1800,200'/%3E%3Cpath d='M0,210 C210,60 410,360 610,210 C810,60 1010,360 1210,210 C1410,60 1610,360 1810,210'/%3E%3Cpath d='M0,190 C190,40 390,340 590,190 C790,40 990,340 1190,190 C1390,40 1590,340 1790,190'/%3E%3Cpath d='M0,220 C220,70 420,370 620,220 C820,70 1020,370 1220,220'/%3E%3Cpath d='M0,180 C180,30 380,330 580,180 C780,30 980,330 1180,180'/%3E%3Cpath d='M-200,100 Q200,500 600,100 T1400,100' opacity='0.3' stroke-width='1.5'/%3E%3Cpath d='M-180,110 Q220,510 620,110 T1420,110' opacity='0.2' stroke-width='1.5'/%3E%3C/g%3E%3C/svg%3E");
    background-size: cover; box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    border-bottom: 1px solid rgba(212, 175, 55, 0.4); padding: 8px 0;
}
.header-container { display: flex; justify-content: space-between; align-items: center; width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; box-sizing: border-box; }
.logo { height: 75px; flex: 0 0 auto; display: flex; align-items: center; }
.logo img { height: 100%; width: auto; object-fit: contain; }

.header-nav { flex: 1 1 auto; display: flex; justify-content: center; align-items: center; gap: 20px; }
.header-nav a { text-decoration: none; color: #EFEBE9; font-size: 0.95rem; font-weight: 500; transition: color 0.3s; text-shadow: 0 1px 2px rgba(0,0,0,0.5); padding: 0; }
.header-nav a:hover, .header-nav a.active { color: #D4AF37; }
.header-nav a::after { display: none; }
.nav-separator { color: #7d6b55; font-size: 0.95rem; opacity: 0.7; font-weight: 300; }

.contact-info { flex: 0 0 auto; display: flex; flex-direction: column; gap: 6px; width: auto; min-width: 140px; }
.btn-contact { border: none; border-radius: 4px; padding: 3px 12px; display: flex; align-items: center; justify-content: center; font-family: "Thonburi", sans-serif; font-size: 0.8rem; font-weight: 600; cursor: pointer; text-decoration: none; color: white; transition: all 0.2s; box-shadow: 0 2px 4px rgba(0,0,0,0.3); height: 30px; width: 100%; box-sizing: border-box; }
.btn-contact:hover { transform: translateY(-1px); box-shadow: 0 3px 6px rgba(0,0,0,0.4); }
.btn-contact img { width: 16px; height: 16px; margin-right: 6px; filter: drop-shadow(0 1px 1px rgba(0,0,0,0.2)); }
.btn-phone { background: linear-gradient(135deg, #A99C8E, #8D7B68); border: 1px solid #756350; }
.btn-line { background: linear-gradient(135deg, #00C300, #009900); border: 1px solid #008000; }

/* ==========================================
   รูปแบนเนอร์แบบเต็มจอ (Full Width)
   ========================================== */
.hero-image-container {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    display: block;
    line-height: 0;
}
.hero-image-container img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 0;
    box-shadow: none;
    object-fit: cover;
}

/* ==========================================
   3. แบนเนอร์ข้อความ
   ========================================== */
.promo-banner { 
    background-color: #FDFBF7; 
    color: #4E342E; 
    padding: 50px 40px; 
    margin: 60px auto; 
    font-size: 23px; 
    font-weight: 400; 
    line-height: 1.8; 
    width: 90%; 
    max-width: 900px;
    border-radius: 16px; 
    border: 1px solid rgba(212, 175, 55, 0.2);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
    position: relative; 
    text-align: center;
}

.promo-banner::before { 
    content: '❝'; 
    font-size: 4rem; 
    color: #D4AF37; 
    opacity: 0.15;
    position: absolute; 
    top: -20px; 
    left: 50%; 
    transform: translateX(-50%);
    font-family: serif; 
    line-height: 1;
}

h2, h3 { color: #4E342E; font-weight: 700; margin-bottom: 30px; position: relative; display: inline-block; }
h2::after, h3::after { content: ''; display: block; width: 60px; height: 3px; background-color: #D4AF37; margin: 10px auto 0; border-radius: 2px; }

.showcase-section { margin: 40px 0; }
.slider-frame { width: 100%; max-width: 1200px; margin: 0 auto; overflow: hidden; background-color: #fff; border-radius: 20px; box-shadow: 0 15px 40px rgba(0,0,0,0.15); border: 1px solid #eee; height: auto; line-height: 0; }

.slider-wrapper { 
    width: 500%; height: auto; display: flex; 
    animation: stepSlide 20s infinite; 
}

.slide-item { width: 20%; height: auto; padding: 0; display: block; }
.slide-item img { width: 100%; height: auto; display: block; border: none; object-fit: cover; }

@keyframes stepSlide {
    0%, 15%   { transform: translateX(0%); }
    20%, 35%  { transform: translateX(-20%); }
    40%, 55%  { transform: translateX(-40%); }
    60%, 75%  { transform: translateX(-60%); }
    80%, 95%  { transform: translateX(-80%); }
    100%      { transform: translateX(0%); }
}

/* ==========================================
   5. สินค้า (Product Grid)
   ========================================== */
.info-bar { display: flex; justify-content: center; gap: 50px; background-color: #fff; padding: 40px 20px; margin: 40px 0; box-shadow: 0 2px 10px rgba(0,0,0,0.02); }
.info-col { font-size: 1rem; color: #6D4C41; display: flex; align-items: center; gap: 10px; }
.info-col::before { content: '✦'; color: #D4AF37; font-size: 1.2rem; }

.product-section { padding: 20px; max-width: 1200px; margin: 0 auto; }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 30px; padding: 10px; }
.product-card { background-color: #ffffff; border: none; border-radius: 12px; box-shadow: 0 5px 15px rgba(0,0,0,0.05); overflow: hidden; height: 420px; display: flex; flex-direction: column; justify-content: space-between; transition: transform 0.3s, box-shadow 0.3s; cursor: pointer; }
.product-card:hover { transform: translateY(-8px); box-shadow: 0 15px 30px rgba(0,0,0,0.1); }
.product-img-real { width: 100%; height: 220px; object-fit: contain; border-bottom: 1px solid #f9f9f9; }
.product-card h4 { margin: 15px 0 5px 0; font-size: 1.2rem; color: #4E342E; font-weight: 400; }
.product-card .price { color: #D4AF37; font-size: 1.2rem; margin-bottom: 15px; font-weight: 400; }
.product-actions { padding: 0 20px 25px 20px; display: flex; gap: 10px; }
.btn-action { flex: 1; height: 40px; border: 1px solid #D4AF37; background: #fff; border-radius: 50px; font-family: "Thonburi", sans-serif; color: #D4AF37; font-weight: 500; transition: all 0.3s; font-size: 0.95rem; cursor: pointer; display:flex; align-items:center; justify-content:center; text-decoration:none; }
.btn-action:hover { background-color: #D4AF37; color: #fff; }

/* ==========================================
   6. วิธีการสั่งซื้อ
   ========================================== */
.howto-section-main { padding: 50px 20px; background-color: #fff; border-radius: 20px; margin: 40px auto; max-width: 900px; box-shadow: 0 10px 40px rgba(0,0,0,0.05); }
.howto-container { max-width: 800px; margin: 0 auto; }

.main-steps { padding: 0; margin: 0; width: 100%; }
.main-steps li { background-color: #FDFBF7; border: 1px solid #F0E6D2; margin-bottom: 15px; padding: 20px; border-radius: 10px; display: flex; align-items: center; box-shadow: 0 2px 5px rgba(0,0,0,0.05); list-style:none; }
.step-desc { flex: 1; text-align: left; line-height: 1.5; }
.step-badge { background-color: #D4AF37; color: #fff; width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; font-weight: bold; margin-right: 20px; flex-shrink: 0; }

.main-bank-info { margin-top: 40px; background-color: #fff; padding: 30px; border-radius: 15px; border: 2px dashed #D4AF37; }
.acc-number { font-size: 1.8rem; color: #06C755; font-weight: bold; margin: 10px 0; }

/* ==========================================
   7. Mobile Responsive
   ========================================== */
@media (max-width: 768px) {
    body { padding-top: 130px; padding-bottom: 100px; }
    
    .container { 
        padding-left: 0 !important; 
        padding-right: 0 !important; 
    }
    
    .header-container { flex-direction: column; gap: 5px; padding-bottom: 5px; }
    .logo { height: 55px; margin-top: 5px; }
    .header-nav { gap: 15px; width: 100%; border-top: 1px solid rgba(255,255,255,0.1); padding-top: 8px; margin-bottom: 5px; }
    .header-nav a { font-size: 0.95rem; }
    .nav-separator { font-size: 0.95rem; }
    .header-container .contact-info { display: none; }
    
    /* Sticky Footer */
    .contact-info#mobileStickyFooter {
        display: flex; position: fixed; bottom: 0; left: 0; width: 100%;
        background-color: #fff; flex-direction: row; 
        padding: 15px 15px 25px 15px; box-shadow: 0 -4px 20px rgba(0,0,0,0.15); 
        z-index: 2000; gap: 12px; box-sizing: border-box;
        transform: translateY(0); transition: transform 0.3s ease-in-out;
    }
    .contact-info#mobileStickyFooter.force-hide { transform: translateY(100%); }
    .btn-contact { flex: 1; border-radius: 8px; font-size: 1rem; height: 50px; padding: 0 10px; white-space: nowrap; }
    .btn-contact img { width: 26px; height: 26px; margin-right: 8px; }
    
    .hero-image-container {
        width: 100%;
        max-width: 100%;
        padding: 0;
        margin: 0;
    }
    .hero-image-container img {
        border-radius: 0;
    }
    
    .promo-banner {
        font-size: 1.2rem;
        padding: 40px 20px;
        margin: 40px auto;
        width: 95%;
    }
    .promo-banner::before {
        font-size: 3rem;
        top: -15px;
    }

    .info-bar {
        flex-direction: column; 
        align-items: center; 
        gap: 15px; 
        padding: 30px 15px; 
    }
    .info-col {
        width: 260px; 
        justify-content: flex-start; 
    }

    .slider-frame { height: auto; max-width: 95%; margin-top: 20px; }
    
    .product-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 5px; }
    
    .product-card { height: auto; min-height: 340px; padding-bottom: 10px; }
    .product-img-real { height: 160px; }
    .product-card h4 { font-size: 1rem; margin: 10px 5px; }
    .product-card .price { font-size: 1.1rem; margin-bottom: 10px; }
    .product-actions { flex-direction: column; gap: 8px; padding: 0 10px 10px 10px; }
    .btn-action { width: 100%; font-size: 0.9rem; height: 36px; }

    .modal-content {
        width: 90%; max-height: 85vh; 
        margin: auto; position: relative; top: 0; left: 0; transform: none !important; 
        display: flex; flex-direction: column; overflow: hidden;
    }
    .modal-body-scroll {
        overflow-y: auto; display: block; flex: 1;
        -webkit-overflow-scrolling: touch;
    }
    
    .zoom-hint { font-size: 0.75rem; margin-top: 2px; }
    .modal-right { padding: 15px; }
    .modal-right h2 { font-size: 1.2rem; margin-bottom: 5px; }
    .product-code { font-size: 0.9rem; color: #888; margin: 0; }
    .modal-price { font-size: 1.3rem; margin: 5px 0; color:#D4AF37; }
    .desc-title { font-weight: 600; margin-bottom: 5px; color: #5D4037; }
    .modal-desc { font-size: 0.95rem; line-height: 1.5; color: #555; }
    
    .modal-sticky-actions {
        position: sticky; bottom: -15px; background: #fff; padding: 10px 0; margin-top: 15px;
        border-top: 1px solid #eee; z-index: 5;
    }
    
    .site-footer { padding-bottom: 120px; }

    .social-links { 
        display: flex !important;
        flex-direction: column !important; 
        align-items: center !important; 
        gap: 20px !important; 
    }
    .footer-item { 
        display: flex !important;
        flex-direction: row !important; 
        align-items: center !important; 
        justify-content: flex-start !important; 
        width: 250px !important; 
        gap: 20px !important; 
        font-size: 1.1rem !important; 
    }
    .icon-bg { 
        width: 45px !important; 
        height: 45px !important; 
        margin-bottom: 0 !important; 
        padding: 10px !important; 
        flex-shrink: 0 !important; 
    }
}

/* ==========================================
   8. Modal & Lightbox
   ========================================== */
.modal { display: none; position: fixed; z-index: 2000; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.7); backdrop-filter: blur(5px); overflow: auto; padding-top: 50px; }
.modal-content { background-color: #fff; margin: auto; width: 90%; max-width: 850px; border-radius: 15px; position: relative; animation: slideDown 0.3s ease-out; }
.close-btn { position: absolute; top: 15px; right: 25px; font-size: 30px; cursor: pointer; z-index: 10; color: #888; }
.modal-body-scroll { display: flex; flex-wrap: wrap; width:100%; height:100%; }

.modal-left { position: relative; flex: 1; min-width: 300px; padding: 20px; display: flex; flex-direction: column; align-items: center; justify-content: center; background: #f9f9f9; }

.modal-right { flex: 1; padding: 30px; text-align: left; min-width: 300px; }
.modal-tabs { display: flex; border-bottom: 2px solid #eee; margin-bottom: 20px; }
.tab-btn { flex: 1; padding: 10px; border: none; background: none; font-size: 1rem; font-weight: 600; color: #aaa; cursor: pointer; border-bottom: 3px solid transparent; }
.tab-btn.active { color: #D4AF37; border-bottom: 3px solid #D4AF37; }
.modal-sticky-actions { margin-top: 20px; }
.zoom-hint { font-size:0.8rem; color:#888; margin-top:5px; }

.lightbox { display: none; position: fixed; z-index: 3000; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.9); cursor: zoom-out; }
.lightbox-content { margin: auto; display: block; width: auto; max-width: 90%; max-height: 90vh; margin-top: 5vh; animation: zoomIn 0.3s; cursor: default; }
.lightbox-close { position: absolute; top: 20px; right: 35px; color: #fff; font-size: 40px; cursor: pointer; }
@keyframes slideDown { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes zoomIn { from {transform:scale(0)} to {transform:scale(1)} }

/* ==========================================
   10. Footer
   ========================================== */
.site-footer { background-color: #171B0E; color: #EFEBE9; padding: 50px 20px 30px; margin-top: 60px; border-top: 4px solid #D4AF37; text-align: center; }
.footer-content h3 { color: #D4AF37; font-size: 1.5rem; margin-bottom: 30px; position: relative; display: inline-block; }
.footer-content h3::after { content: ''; display: block; width: 50px; height: 2px; background-color: #D4AF37; margin: 10px auto 0; }
.social-links { display: flex; justify-content: center; gap: 40px; flex-wrap: wrap; margin-bottom: 30px; }
.footer-item { display: flex; flex-direction: column; align-items: center; text-decoration: none; color: #EFEBE9; font-size: 1rem; transition: transform 0.3s, color 0.3s; }
.footer-item:hover { transform: translateY(-5px); color: #D4AF37; }
.icon-bg { width: 50px; height: 50px; margin-bottom: 10px; background-color: #fff; border-radius: 12px; padding: 10px; box-shadow: 0 4px 10px rgba(0,0,0,0.3); display: flex; align-items: center; justify-content: center; box-sizing: border-box; }
.icon-bg img { width: 100%; height: 100%; object-fit: contain; }
.footer-line { border: 0; height: 1px; background: rgba(212, 175, 55, 0.3); margin: 20px auto; max-width: 80%; }
.copyright { font-size: 0.9rem; opacity: 0.7; font-weight: 300; }

/* ==========================================
   11. ระบบสไลด์รูปภาพใน Modal 
   ========================================== */
.modal-track {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap; 
    width: 100%;
    transition: transform 0.3s ease-in-out; 
}

.modal-track img {
    flex: 0 0 100%; 
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: contain;
    display: block;
    cursor: zoom-in;
}

.slide-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background-color: rgba(0,0,0,0.4);
    color: #fff;
    display: none; 
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    user-select: none;
}
.prev-arrow { left: 10px; }
.next-arrow { right: 10px; }
.slide-arrow:hover { background-color: #D4AF37; }

.has-multiple-imgs .slide-arrow {
    display: flex;
}

@media (max-width: 768px) {
    .has-multiple-imgs .slide-arrow {
        display: none !important; 
    }
}

/* ==========================================
   12. โฆษณาเล็กมุมล่างขวา & Popup ขยายรูป (อัปเดตใหม่)
   ========================================== */
/* วิดเจ็ตโฆษณาเล็ก */
.small-ad-widget {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 80px;
    height: 80px; 
    z-index: 1500;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: slideUpAd 0.5s ease-out;
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2); 
    background-color: transparent; 
}

.small-ad-widget img {
    width: 100%;
    height: 100%;
    object-fit: contain; 
    border: none; 
    border-radius: 50%; 
    display: block;
    box-shadow: none; 
}

.small-ad-widget:hover {
    transform: scale(1.1) translateY(-5px); 
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.close-small-ad {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #4E342E;
    color: #fff;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 12px;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    z-index: 1501;
    transition: background 0.2s;
}
.close-small-ad:hover {
    background: #D4AF37; 
}

@keyframes slideUpAd {
    from { transform: translateY(100px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Popup รูปใหญ่ตรงกลาง */
.promo-popup {
    display: none;
    position: fixed;
    z-index: 4000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.85); 
    backdrop-filter: blur(5px);
}
.promo-content {
    position: relative;
    margin: auto;
    top: 50%;
    transform: translateY(-50%);
    width: 90%;
    max-width: 500px;
    animation: zoomIn 0.3s ease-out;
}
.promo-content img {
    width: 100%;
    height: auto;
    border-radius: 8px; 
    box-shadow: 0 15px 40px rgba(0,0,0,0.6); 
    border: none; 
    display: block;
}

.promo-close {
    position: absolute;
    top: -20px;
    right: -20px;
    background: #D4AF37; 
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 26px;
    font-weight: bold;
    cursor: pointer;
    z-index: 4001;
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
    transition: transform 0.2s, background 0.2s;
}
.promo-close:hover {
    transform: scale(1.1);
    background: #E5C158; 
}

@media (max-width: 768px) {
    .small-ad-widget {
        bottom: 95px; 
        right: 15px;
        width: 70px; 
        height: 70px;
    }
    .promo-close {
        top: -15px;
        right: -15px;
        width: 35px;
        height: 35px;
        font-size: 22px;
    }
}