﻿/**
 * dir assets\css\dynamic-footer.css
 * file dynamic-footer.css
 * The css displaying footer.
 * Update: Optimized Mobile Footer Layout (Accordion, Socials & Sticky Bar spacing)
*/
/* ==========================================================================
   DYNAMIC FOOTER & APP DOCK STYLES
   ========================================================================== */

/* --- 1. GLOBAL FOOTER RESET & BASE --- */
.site-footer { 
    background-color: #ffffff; 
    padding-top: 70px; 
    width: 100%; 
    border-top: 1px solid var(--border-light);
    font-size: 15px; 
    color: var(--text-gray);
}
.site-footer ul { list-style: none !important; padding-left: 0 !important; margin: 0 !important; }
.site-footer li { margin-bottom: 10px; line-height: 1.6; }
.site-footer a { text-decoration: none !important; color: inherit; transition: all 0.3s ease; }

/* --- 2. DESKTOP LAYOUT (PC & Laptop) --- */
@media (min-width: 992px) {
    .site-footer .container-fluid { max-width: 1320px; margin: 0 auto; }
    .footer-col-20 { flex: 0 0 20%; max-width: 20%; }
    .footer-col-25 { flex: 0 0 25%; max-width: 25%; }
    .footer-col-30 { flex: 0 0 30%; max-width: 30%; }

    .footer-heading { 
        font-size: 18px; font-weight: 700; color: var(--text-dark); 
        text-transform: uppercase; margin-bottom: 25px; position: relative; letter-spacing: 0.5px;
    }
    .footer-heading::after {
        content: ''; display: block; width: 35px; height: 3px;
        background-color: var(--primary-color); margin-top: 10px; border-radius: 2px;
    }

    .footer-links a { display: inline-block; color: var(--text-gray); }
    .footer-links a:hover { color: var(--primary-color); padding-left: 5px; }

    .social-icons { display: flex; gap: 12px; margin-top: 20px; }
    .social-btn { 
        width: 42px; height: 42px; display: flex; align-items: center; justify-content: center; 
        background: #fff; border-radius: 50%; border: 1px solid var(--border-color); color: var(--text-gray); transition: 0.3s;
    }
    .social-btn:hover { background-color: var(--primary-color); border-color: var(--primary-color); color: #fff; transform: translateY(-3px); box-shadow: 0 5px 15px rgba(4, 163, 156, 0.3); }

    .contact-item { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 15px; color: var(--text-gray); }
    .contact-item i.huge { color: var(--primary-color); font-size: 20px; margin-top: 2px; flex-shrink: 0; }
    .contact-item a:hover { text-decoration: underline !important; color: var(--primary-color); }
}

/* --- 3. MOBILE FOOTER LAYOUT (โทรศัพท์ & แท็บเล็ต) --- */
@media (max-width: 991px) { 
    .site-footer { 
        padding-top: 40px; 
        /* เว้นที่ว่างด้านล่างเผื่อแถบ Sticky Bar จะได้ไม่บัง Copyright */
        padding-bottom: 80px; 
    }
    
    .mobile-footer-wrapper {
        padding: 0 10px;
    }

    .mobile-logo img {
        max-height: 50px;
        width: auto;
        margin-bottom: 20px;
    }

    /* ระบบ Accordion เมนูหด/กาง */
    .footer-accordion-item {
        border-bottom: 1px solid var(--border-light);
    }
    .footer-accordion-header {
        font-size: 16px;
        font-weight: 700;
        color: var(--text-dark);
        padding: 15px 0;
        cursor: pointer;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    /* ใส่ลูกศรชี้ลง */
    .footer-accordion-header::after {
        content: '\25BC'; /* Unicode ลูกศรชี้ลง */
        font-size: 12px;
        transition: transform 0.3s ease;
        color: var(--primary-color);
    }
    .footer-accordion-content {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease-out;
    }
    /* เมื่อคลาส .active ทำงาน (กางออก) */
    .footer-accordion-item.active .footer-accordion-content {
        max-height: 500px; /* ยืดความสูงออก (เผื่อพื้นที่ไว้เยอะๆ) */
    }
    .footer-accordion-item.active .footer-accordion-header::after {
        transform: rotate(180deg); /* หมุนลูกศรชี้ขึ้น */
    }

    .mobile-contact-area {
        padding-top: 25px;
    }
    .contact-item { 
        display: flex; align-items: flex-start; gap: 10px; margin-bottom: 12px; color: var(--text-gray); font-size: 15px;
    }
    .contact-item i.huge { color: var(--primary-color); font-size: 18px; margin-top: 3px; flex-shrink: 0; }

    /* ปุ่ม Social สำหรับมือถือ */
    .mobile-social-icons { 
        display: flex; gap: 10px; margin-top: 20px; padding-bottom: 10px; 
    }
    .mobile-social-icons .social-btn {
        width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; 
        background: #f8f9fa; border-radius: 50%; color: var(--primary-color); font-size: 18px;
    }

    /* จัด Copyright บนมือถือให้อยู่ตรงกลาง */
    .copyright-area .row {
        flex-direction: column;
        text-align: center !important;
        gap: 10px;
    }
    .copyright-area .col-6 {
        width: 100% !important;
        text-align: center !important;
    }
}

/* --- 4. COPYRIGHT BAR --- */
.copyright-area { border-top: 1px solid var(--border-light); padding: 20px 0; margin-top: 40px; background-color: #fff; font-size: 14px; color: var(--text-muted); }

/* --- 5. MOBILE STICKY BAR (App Dock) --- */
.mobile-sticky-bar { position: fixed; bottom: 0; left: 0; width: 100%; height: 65px; background: #fff; box-shadow: 0 -4px 20px rgba(0,0,0,0.1); z-index: 999; border-top: 1px solid var(--border-light); }
.sticky-item { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--text-muted); text-decoration: none; position: relative;}
.sticky-item.active { color: var(--primary-color); }
.ps-left { width: 35%; display: flex; }
.ps-right { width: 65%; }
.ps-btn-icon { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--text-gray); border-right: 1px solid var(--border-light); position: relative; }
.sticky-cart-count { position: absolute; top: 5px; right: 20%; background: var(--color-danger); color: #fff; font-size: 10px; font-weight: bold; width: 18px; height: 18px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }

.ps-buy-btn { width: 100%; height: 100%; border: none; background: linear-gradient(90deg, var(--primary-color) 0%, var(--primary-hover) 100%); color: #fff; font-size: 18px; font-weight: 800; text-transform: uppercase; display: flex; align-items: center; justify-content: center; gap: 8px; }
.ps-buy-btn.status-soldout { background: var(--border-color) !important; color: var(--text-muted) !important; pointer-events: none; }
.ps-buy-btn.status-preorder { background: linear-gradient(90deg, #f39c12 0%, #d35400 100%) !important; }

/* --- 6. BOTTOM SHEET (Mobile Product Purchase Panel) --- */
.bottom-sheet-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); z-index: 9998; opacity: 0; visibility: hidden; transition: 0.3s; backdrop-filter: blur(2px); }
.bottom-sheet-panel { position: fixed; bottom: -120%; left: 0; width: 100%; background: #fff; z-index: 9999; border-radius: 24px 24px 0 0; transition: bottom 0.3s cubic-bezier(0.2, 0.8, 0.2, 1); display: flex; flex-direction: column; max-height: 85vh; box-shadow: 0 -10px 40px rgba(0,0,0,0.2); }
.bottom-sheet-open .bottom-sheet-overlay { opacity: 1; visibility: visible; }
.bottom-sheet-open .bottom-sheet-panel { bottom: 0; }

.sheet-header { padding: 15px 20px; border-bottom: 1px solid var(--bg-gray); display: flex; gap: 15px; align-items: center; }
.sheet-thumb { width: 70px; height: 70px; border-radius: 12px; object-fit: cover; border: 1px solid var(--border-light); transition: all 0.3s ease; }
.sheet-info { flex: 1; }
.sheet-title { font-size: 14px; margin: 0 0 5px; color: var(--text-dark); font-weight: 500; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sheet-price { font-size: 18px; font-weight: 700; color: var(--primary-color); }
.sheet-close { font-size: 24px; color: #ccc; padding: 5px; cursor: pointer; }

.sheet-body { padding: 20px; overflow-y: auto; flex: 1; padding-bottom: 30px; }
.sheet-footer { padding: 15px 20px; border-top: 1px solid var(--border-light); background: #fff; display: flex; justify-content: space-between; align-items: center; gap: 15px; position: sticky; bottom: 0; z-index: 10; padding-bottom: max(20px, env(safe-area-inset-bottom)); }
.sheet-total-label { font-size: 12px; color: var(--text-muted); }
.sheet-total-price { font-size: 22px; font-weight: 800; color: var(--primary-color); line-height: 1; }

.sheet-confirm-btn { background-color: var(--secondary-color) !important; color: #ffffff !important; border: none !important; padding: 0 30px !important; height: 50px !important; border-radius: 12px !important; font-size: 16px !important; font-weight: 700 !important; flex: 1 !important; box-shadow: 0 4px 15px rgba(38, 81, 117, 0.3) !important; cursor: pointer !important; transition: all 0.2s ease !important; outline: none !important; }
.sheet-confirm-btn:hover { background-color: var(--secondary-hover) !important; transform: translateY(-2px); box-shadow: 0 6px 20px rgba(38, 81, 117, 0.4) !important; }

/* Custom Quantity in Sheet */
.bottom-sheet-panel .quantity { display: flex !important; flex-direction: row !important; align-items: center !important; justify-content: space-between !important; width: 120px !important; height: 44px !important; border: 1px solid var(--border-color) !important; border-radius: 50px !important; background: #fff !important; margin: 0 !important; padding: 0 !important; overflow: hidden !important; }
.bottom-sheet-panel .quantity label { display: none !important; }
.bottom-sheet-panel .qty-btn { width: 35px !important; height: 100% !important; border: none !important; background: transparent !important; font-size: 20px !important; color: var(--text-gray) !important; cursor: pointer !important; display: flex !important; align-items: center !important; justify-content: center !important; padding: 0 !important; margin: 0 !important; }
.bottom-sheet-panel input.qty { width: 50px !important; height: 100% !important; border: none !important; background: transparent !important; text-align: center !important; font-size: 16px !important; font-weight: 700 !important; color: var(--text-dark) !important; padding: 0 !important; margin: 0 !important; -moz-appearance: textfield !important; appearance: textfield !important; }
.bottom-sheet-panel input.qty::-webkit-inner-spin-button { -webkit-appearance: none; appearance: none; margin: 0; }

@media (max-width: 991px) {
    .single-product .product form.cart { display: none !important; }
    .bottom-sheet-panel form.cart { display: block !important; }
    .bottom-sheet-panel button[type="submit"] { display: none !important; }
}

/* --- 7. FIX FORCED FULL WIDTH FOOTER (Hello Elementor Override) --- */
@media (min-width: 1200px) {
    footer#site-footer.site-footer, .site-footer:not(.dynamic-footer) {
        max-width: 100% !important; width: 100% !important; padding: 5em 1em 0em 1em !important;
    }
    .site-footer .container-fluid {
        width: 100% !important; max-width: 1400px !important; margin: 0 auto !important;
        padding-left: 20px !important; padding-right: 20px !important;
    }
}



/* --- Gustabe Toast Notification --- */

/* ตัวคลุม (Wrapper) - จัดตำแหน่งให้ลอยอยู่ด้านล่าง */
.gustabe-toast-wrapper {
    position: fixed;
    bottom: 30px; /* ลอยจากขอบล่าง 30px */
    left: 50%;
    transform: translateX(-50%); /* จัดกึ่งกลางจอ */
    z-index: 99999; /* อยู่บนสุดเสมอ */
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 90%;
    max-width: 400px; /* ไม่กว้างเกินไปบนจอคอม */
    pointer-events: none; /* เพื่อให้คลิกทะลุได้ถ้าไม่มีข้อความ */
}

/* ตัวกล่องข้อความ (Item) */
.gustabe-toast-item {
    background: rgba(30, 30, 30, 0.95); /* สีดำโปร่งแสงสไตล์ Apple/Android */
    backdrop-filter: blur(10px); /* เอฟเฟกต์เบลอ */
    color: #fff;
    padding: 12px 20px;
    border-radius: 50px; /* ทรงแคปซูลมนๆ */
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: 'Noto Sans Thai', sans-serif;
    font-size: 14px;
    font-weight: 500;
    pointer-events: auto; /* ให้กดปุ่มปิดได้ */
    
    /* Animation ตอนเด้งขึ้นมา */
    animation: slideUpFade 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* ไอคอน */
.gustabe-toast-item .toast-icon {
    color: #00e676; /* สีเขียวสว่าง */
    font-size: 20px;
    display: flex;
    align-items: center;
}

/* เนื้อหาข้อความ */
.gustabe-toast-item .toast-content {
    flex: 1;
    line-height: 1.4;
}
.gustabe-toast-item a { 
    color: #81c784 !important; /* เปลี่ยนสี Link ในนั้นให้เด่น */
    text-decoration: underline;
}

/* ปุ่มปิด (X) */
.gustabe-toast-item .toast-close {
    background: none;
    border: none;
    color: #aaa;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    margin-left: 5px;
}
.gustabe-toast-item .toast-close:hover { color: #fff; }

/* Animation: เด้งขึ้น */
@keyframes slideUpFade {
    from { opacity: 0; transform: translateY(20px) scale(0.9); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Animation: จางหาย (ใช้คู่กับ JS) */
.gustabe-toast-item.fade-out {
    animation: fadeOutDrop 0.5s ease forwards;
}
@keyframes fadeOutDrop {
    to { opacity: 0; transform: translateY(20px); }
}

/* ซ่อนกล่องแจ้งเตือนเดิมของ WooCommerce (เผื่อมันเด้งซ้อน) */
.woocommerce-message:not(.gustabe-toast-item), 
.woocommerce-info:not(.gustabe-toast-item),
.woocommerce-error:not(.gustabe-toast-item) {
    display: none; 
}


/* =========================================
   GUSTABE WOOCOMMERCE NOTICES (Alert Boxes)
   (ย้ายมา Global เพื่อให้ใช้ได้กับทุกหน้า เช่น Checkout, Cart)
   ========================================= */
.gustabe-notice-box {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 16px 20px;
    border-radius: 12px;
    margin-bottom: 25px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    animation: gustabeSlideInDown 0.4s ease;
    width: 100%;
}
/* 🌟 ป้องกันไอคอนเบี้ยว/ยืด เวลาข้อความยาวๆ */
.gustabe-notice-box .notice-icon {
    flex-shrink: 0;
    width: 24px;
}
.gustabe-notice-box .notice-icon i {
    font-size: 24px;
    margin-top: 2px;
    display: block;
}
/* 🌟 ป้องกันข้อความยาวจนล้นกล่อง */
.gustabe-notice-box .notice-content {
    flex: 1;
    min-width: 0;
}

/* --- กล่อง Error (สีแดง) --- */
.gustabe-notice-box.is-error {
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}
.gustabe-notice-box.is-error .notice-icon i {
    color: #ef4444; 
}
.gustabe-notice-box ul.woocommerce-error {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
}
.gustabe-notice-box ul.woocommerce-error li {
    margin-bottom: 5px !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    color: #991b1b !important; 
    font-size: 14px;
    font-weight: 500;
    line-height: 1.6;
}
.gustabe-notice-box ul.woocommerce-error li:last-child {
    margin-bottom: 0 !important;
}
.gustabe-notice-box ul.woocommerce-error li::before,
.gustabe-notice-box ul.woocommerce-error li .icon {
    display: none !important;
}
/* 🌟 แก้บั๊กสีลิงก์ (เช่น ลิงก์ยอมรับข้อตกลง) ให้อ่านง่าย */
.gustabe-notice-box ul.woocommerce-error li a {
    color: #b91c1c !important;
    font-weight: 700;
    text-decoration: underline !important;
    transition: 0.2s;
}
.gustabe-notice-box ul.woocommerce-error li a:hover {
    color: #ef4444 !important;
}

/* --- กล่อง Info (สีฟ้า) --- */
.gustabe-notice-box.is-info {
    background-color: #eff6ff; 
    border: 1px solid #bfdbfe;
    color: #1e3a8a;
}
.gustabe-notice-box.is-info .notice-icon i {
    color: #3b82f6; 
}
.gustabe-notice-box.woocommerce-info {
    border-top: 1px solid #bfdbfe !important; 
}
.gustabe-notice-box.woocommerce-info::before {
    display: none !important; 
}
.gustabe-notice-box.is-info .notice-content {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.6;
    color: #1e3a8a;
    width: 100%;
}
.gustabe-notice-box.is-info .notice-content .button {
    background: #3b82f6;
    color: #fff;
    border-radius: 50px;
    padding: 6px 16px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    float: right; 
    margin-left: 15px;
    margin-top: -3px;
    border: none;
    transition: 0.3s;
}
.gustabe-notice-box.is-info .notice-content .button:hover {
    background: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(59, 130, 246, 0.3);
}

@keyframes gustabeSlideInDown {
    from { transform: translateY(-10px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* --- Toast (กล่องสีเขียวมุมจอ) --- */
.gustabe-toast-wrapper {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 25px;
    width: 100%;
}
.gustabe-toast-item {
    display: flex;
    align-items: center; 
    gap: 15px;
    padding: 16px 20px;
    border-radius: 12px;
    background-color: #f0fdf4; 
    border: 1px solid #bbf7d0;
    color: #166534;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    animation: gustabeSlideInDown 0.4s ease;
    position: relative;
    width: 100%;
}
.gustabe-toast-item.woocommerce-message {
    border-top: 1px solid #bbf7d0 !important; 
}
.gustabe-toast-item.woocommerce-message::before {
    display: none !important; 
}
.gustabe-toast-item .toast-icon i {
    font-size: 24px;
    color: #22c55e; 
    display: flex;
}
.gustabe-toast-item .toast-content {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.6;
}
.gustabe-toast-item .toast-content .button {
    background: #22c55e;
    color: #fff;
    border-radius: 50px;
    padding: 6px 16px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    float: right;
    margin-left: 15px;
    border: none;
    transition: 0.3s;
}
.gustabe-toast-item .toast-content .button:hover {
    background: #16a34a;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(34, 197, 94, 0.3);
}
.toast-close {
    background: transparent;
    border: none;
    color: #166534;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    padding: 0 5px;
    margin-left: auto;
    opacity: 0.5;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.toast-close:hover {
    opacity: 1;
    transform: scale(1.2); 
}


/* =========================================
   แก้ปัญหากล่องแจ้งเตือน (Notice) ดันโครงสร้าง Grid พังหน้า Checkout
   ========================================= */
.gustabe-checkout-grid .woocommerce-NoticeGroup-checkout {
    grid-column: 1 / -1 !important; /* บังคับให้กล่องแจ้งเตือนกินพื้นที่เต็มความกว้างทั้ง 2 คอลัมน์ */
    width: 100%;
    margin-bottom: 20px;
}

/* =========================================
   🌟 คาถาสะกดมาร: บังคับให้ข้อความ Error โชว์ 100%
   (แก้ปัญหา HTML มี แต่หน้าเว็บดันไม่แสดง)
   ========================================= */

/* 1. บังคับให้กล่อง ul ยืดตัวออก (เผื่อโดนธีมแม่สั่ง height: 0) */
.woocommerce-NoticeGroup .gustabe-notice-box ul.woocommerce-error,
.gustabe-notice-box ul.woocommerce-error {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
    width: 100% !important;
}

/* 2. บังคับให้บรรทัด li แสดงผล (เผื่อโดนสั่ง display: none) */
.woocommerce-NoticeGroup .gustabe-notice-box ul.woocommerce-error li,
.gustabe-notice-box ul.woocommerce-error li {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    font-size: 14px !important;
    line-height: 1.6 !important;
    color: #991b1b !important;
    text-align: left !important;
}

/* 3. บังคับให้ลิงก์ a (คำว่า "โปรดอ่านและยอมรับ...") โชว์ตัวหนังสือออกมา! */
.woocommerce-NoticeGroup .gustabe-notice-box ul.woocommerce-error li a,
.gustabe-notice-box ul.woocommerce-error li a {
    display: inline !important;
    visibility: visible !important;
    opacity: 1 !important;
    font-size: 14px !important;
    color: #b91c1c !important;
    font-weight: 700 !important;
    text-decoration: underline !important;
    background: transparent !important;
    padding: 0 !important;
}

.woocommerce-NoticeGroup .gustabe-notice-box ul.woocommerce-error li a:hover,
.gustabe-notice-box ul.woocommerce-error li a:hover {
    color: #ef4444 !important;
}

/* =========================================
   🔥 คาถาปราบมาร V.2 (ล็อกขนาดไอคอน & ซ่อนไอคอน Woo ออริจินัล)
   ========================================= */

/* 1. ประหารไอคอนเดิมของ Woo ที่ฝังอยู่ใน <ul> ให้สิ้นซาก! */
.gustabe-notice-box ul.woocommerce-error::before,
.gustabe-notice-box ul.woocommerce-info::before,
.gustabe-notice-box ul.woocommerce-message::before,
.woocommerce-NoticeGroup ul.woocommerce-error::before {
    display: none !important;
    content: none !important;
    background: none !important;
}

/* 2. ล็อคคอกล่องไอคอนของเรา ห้ามยืดเกิน 24px เด็ดขาด! (แก้บั๊กกล่องกว้าง 666px) */
.gustabe-notice-box .notice-icon {
    flex-shrink: 0 !important;
    width: 24px !important;
    min-width: 24px !important; /* ล็อคขั้นต่ำ */
    max-width: 24px !important; /* ล็อคขั้นสูง */
    display: flex !important;
    align-items: flex-start !important;
    justify-content: center !important;
}

/* 3. ล็อคกล่องข้อความให้ใช้พื้นที่ที่เหลืออย่างสงบเจียมตัว */
.gustabe-notice-box .notice-content {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    width: 100% !important;
    overflow: hidden !important;
}
