/**
 * ====================================================
 * 📁 css/lightbox.css (v1.0)
 * Lightbox สินค้า — ใช้ร่วมทุกหน้า
 * HTML:  lightbox-glass (slide.php, mirror.php ฯลฯ)
 * JS:    js/lightbox.js
 * ====================================================
 * ┌─────────────────────────────────────────────┐
 * │  ▉ Brand – Model               [×]         │ header
 * ├──────────────┬──────────────────────────────┤
 * │              │  รายละเอียดสินค้า             │
 * │    [image]   │  description text ...         │
 * │              │                              │
 * │  ฿ 25,000   │  ✅ คุณสมบัติหลัก             │
 * │              │  ✓ feature 1                 │
 * │              │  ✓ feature 2                 │
 * └──────────────┴──────────────────────────────┘
 * ====================================================
 */


/* ===========================================
   [1] OVERLAY
   =========================================== */
.lightbox-glass {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox-glass.active {
    display: flex;
    opacity: 1;
}


/* ===========================================
   [2] CONTAINER (Card)
   =========================================== */
.lightbox-container-glass {
    background: #ffffff;
    border-radius: 14px;
    width: 100%;
    max-width: 900px;
    max-height: 88vh;
    overflow: hidden;
    box-shadow:
        0 25px 80px rgba(0, 0, 0, 0.35),
        0 0 0 1px rgba(255, 255, 255, 0.08);
    animation: lbSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes lbSlideUp {
    from { transform: translateY(24px) scale(0.97); opacity: 0; }
    to   { transform: translateY(0) scale(1); opacity: 1; }
}


/* ===========================================
   [3] HEADER — ชื่อสินค้า
   =========================================== */
.lightbox-header-glass {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 22px;
    background: #75f2f5;
    border-bottom: 3px solid #00b894;
}

.lightbox-title-glass {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.35;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-right: 12px;
}

.lightbox-close-glass {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 2.2rem;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    transition: color 0.2s, transform 0.2s;
    flex-shrink: 0;
    min-width: 36px;
    text-align: center;
}

.lightbox-close-glass:hover {
    color: #ff7675;
    transform: scale(1.2);
    opacity: 1;
}


/* ===========================================
   [4] CONTENT — 2 คอลัมน์
   =========================================== */
.lightbox-content-glass {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 0;
    max-height: calc(88vh - 60px);
    overflow-y: auto;
}


/* --- ซ้าย: รูปภาพ --- */
.lightbox-image-glass {
    padding: 24px 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    background: #f7f8f9;
    border-right: 1px solid #eee;
    gap: 10px;
    overflow-y: auto;
}

.lightbox-image-glass img#lightbox-image {
    max-width: 100%;
    max-height: 340px;
    object-fit: contain;
    border-radius: 6px;
}


/* --- ขวา: รายละเอียด + คุณสมบัติ --- */
.lightbox-details-glass {
    padding: 24px 28px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow-y: auto;
}


/* ===========================================
   [5] รายละเอียดสินค้า
   =========================================== */
.lightbox-description-glass {
    font-size: 0.9rem;
    color: #555;
    line-height: 1.75;
}

.lightbox-description-glass:not(:empty)::before {
    content: "รายละเอียดสินค้า";
    display: block;
    font-size: 1.05rem;
    font-weight: 700;
    color: #2d3436;
    margin-bottom: 8px;
}

.lightbox-description-glass:empty {
    display: none;
}


/* ===========================================
   [6] ราคา
   =========================================== */
.lightbox-price-glass {
    font-size: 1.5rem;
    font-weight: 800;
    color: #00b894;
    letter-spacing: -0.02em;
}

.lightbox-price-glass:empty {
    display: none;
}


/* ===========================================
   [7] คุณสมบัติหลัก — Features ✓
   =========================================== */
.lightbox-features-glass {
    border-top: 1px solid #eee;
    padding-top: 14px;
}

.lightbox-features-glass h3 {
    font-size: 1rem;
    font-weight: 700;
    color: #2d3436;
    margin: 0 0 14px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #00b894;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* วงกลมเขียว ✓ หน้า h3 */
.lightbox-features-glass h3::before {
    content: "";
    display: inline-block;
    width: 22px;
    height: 22px;
    background: #00b894;
    border-radius: 50%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/%3E%3C/svg%3E");
    background-size: 14px;
    background-repeat: no-repeat;
    background-position: center;
    flex-shrink: 0;
}

/* --- Feature list items --- */
.feature-list-glass {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.feature-list-glass li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 0.88rem;
    color: #444;
    line-height: 1.6;
    padding: 8px 14px;
    border-radius: 8px;
    background: linear-gradient(135deg, #f0faf7 0%, #f8fffe 100%);
    border-left: 3px solid #00b894;
    transition: background 0.2s;
}

.feature-list-glass li:hover {
    background: linear-gradient(135deg, #e6f7f2 0%, #f0faf7 100%);
}

/* วงกลมเขียว ✓ แต่ละรายการ */
.feature-list-glass li::before {
    content: "";
    flex-shrink: 0;
    display: inline-block;
    width: 22px;
    height: 22px;
    min-width: 22px;
    margin-top: 1px;
    border-radius: 50%;
    background: #00b894;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/%3E%3C/svg%3E");
    background-size: 13px;
    background-repeat: no-repeat;
    background-position: center;
}

/* ===========================================
   [7b] ข้อมูลจำเพาะทางเทคนิค — Tech Specs ⚡
   =========================================== */
.lightbox-tech-specs-glass {
    border-top: 1px solid #eee;
    padding-top: 14px;
}

.lightbox-tech-specs-glass h3 {
    font-size: 1rem;
    font-weight: 700;
    color: #e67e22;
    margin: 0 0 14px 0;
    padding-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.lightbox-tech-specs-glass .feature-list-glass li {
    background: linear-gradient(135deg, #fef9f0 0%, #fffdf8 100%);
    border-left: 3px solid #f39c12;
}

.lightbox-tech-specs-glass .feature-list-glass li:hover {
    background: linear-gradient(135deg, #fdf0db 0%, #fef9f0 100%);
}

.lightbox-tech-specs-glass .feature-list-glass li::before {
    background: #f39c12;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M11 21h-1l1-7H7.5c-.88 0-.33-.75-.31-.78C8.48 10.94 10.42 7.54 13.01 3h1l-1 7h3.51c.4 0 .62.19.4.66C12.97 17.55 11 21 11 21z'/%3E%3C/svg%3E");
    background-size: 14px;
    background-repeat: no-repeat;
    background-position: center;
}

/* ไม่มี features → ซ่อน */
.feature-list-glass:empty {
    display: none;
}


/* ===========================================
   [8] FOOTER — ปุ่ม LINE + เช็คราคา
   =========================================== */
.lightbox-footer-glass {
    display: flex;
    gap: 10px;
    padding: 14px 22px;
    background: #f7f8f9;
    border-top: 1px solid #eee;
    border-radius: 0 0 14px 14px;
}

.lightbox-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 700;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0.01em;
}

/* LINE */
.lb-btn-line {
    background: #06C755;
    color: #fff;
}

.lb-btn-line:hover {
    background: #05b04c;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(6, 199, 85, 0.35);
    color: #fff;
}

.lb-btn-line svg {
    flex-shrink: 0;
}

/* เช็คราคา */
.lb-btn-quote {
    background: #0984e3;
    color: #fff;
}

.lb-btn-quote:hover {
    background: #0872c7;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(9, 132, 227, 0.35);
}

.lb-btn-quote svg {
    flex-shrink: 0;
}


/* ===========================================
   [8] RESPONSIVE
   =========================================== */

/* Tablet + Mobile */
@media (max-width: 700px) {
    .lightbox-glass {
        padding: 0 4px 4px 4px;
        padding-top: 72px;
        align-items: flex-start;
    }

    .lightbox-container-glass {
        max-width: 100%;
        max-height: calc(100vh - 76px);
        border-radius: 12px;
    }

    .lightbox-content-glass {
        grid-template-columns: 1fr;
    }

    .lightbox-image-glass {
        border-right: none;
        border-bottom: 1px solid #eee;
        padding: 16px 12px;
    }

    .lightbox-image-glass img#lightbox-image {
        max-height: none;
        max-width: 100%;
        width: 100%;
        object-fit: contain;
    }

    /* ซ่อนลูกศร prev/next บนมือถือ */
    #lb-prev-front,
    #lb-next-front {
        display: none !important;
    }

    /* thumbnail ใหญ่ขึ้น */
    #lb-thumbs-front img {
        width: 60px !important;
        height: 60px !important;
    }

    .lightbox-details-glass {
        padding: 20px;
    }

    .lightbox-header-glass {
        border-radius: 12px 12px 0 0;
    }
}

/* Mobile */
@media (max-width: 420px) {
    .lightbox-glass {
        padding: 0 2px 2px 2px;
        padding-top: 68px;
    }

    .lightbox-container-glass {
        border-radius: 10px;
        max-height: calc(100vh - 72px);
    }

    .lightbox-header-glass {
        border-radius: 10px 10px 0 0;
        padding: 10px 14px;
    }

    .lightbox-title-glass {
        font-size: 0.95rem;
    }

    .lightbox-image-glass {
        padding: 10px 8px;
    }

    .lightbox-image-glass img#lightbox-image {
        max-height: none;
        width: 100%;
    }

    /* thumbnail ใหญ่ขึ้นบนมือถือ */
    #lb-thumbs-front img {
        width: 56px !important;
        height: 56px !important;
    }

    .lightbox-details-glass {
        padding: 14px;
        gap: 10px;
    }

    .lightbox-price-glass {
        font-size: 1.3rem;
    }

    .feature-list-glass li {
        font-size: 0.82rem;
        padding: 6px 10px;
        gap: 10px;
    }

    .feature-list-glass li::before {
        width: 18px;
        height: 18px;
        min-width: 18px;
        background-size: 11px;
    }

    .lightbox-footer-glass {
        flex-direction: column;
        padding: 12px 14px;
        border-radius: 0 0 10px 10px;
    }

    .lightbox-btn {
        font-size: 0.88rem;
        padding: 11px 14px;
    }
}