/**
 * ====================================================
 * 📁 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: 800px;
    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: 260px 1fr;
    min-height: 0;
    max-height: calc(88vh - 120px); /* header 55px + footer 65px */
    overflow-y: auto;
}


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

.lightbox-image-glass img {
    max-width: 100%;
    max-height: 200px;
    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;
}

/* ไม่มี 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 */
@media (max-width: 700px) {
    .lightbox-container-glass {
        max-width: 100%;
        border-radius: 12px;
    }

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

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

    .lightbox-image-glass img {
        max-height: 180px;
    }

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

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

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

    .lightbox-container-glass {
        border-radius: 10px;
        max-height: 92vh;
    }

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

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

    .lightbox-image-glass {
        padding: 16px;
    }

    .lightbox-image-glass img {
        max-height: 150px;
    }

    .lightbox-details-glass {
        padding: 16px;
        gap: 12px;
    }

    .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;
    }
}