/* =============================================================
   Cookie Consent Banner & Modal Styles (Standalone)
============================================================= */
/* รีเซ็ต box-sizing เฉพาะองค์ประกอบของ Cookie Consent */
.cookie-banner, .cookie-banner *,
.cookie-modal-overlay, .cookie-modal-overlay * {
    box-sizing: border-box;
}

/* -------------------------------------------------------------
   1. แบนเนอร์คุกกี้ (Cookie Consent Banner)
------------------------------------------------------------- */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #1e293b;
    color: #ffffff;
    padding: 10px;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.15);
    z-index: 9998;
}

.cookie-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.cookie-content p {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    flex: 1;
    min-width: 280px;
    color: #ffffff;
}

.cookie-link {
    color: #38bdf8;
    text-decoration: underline;
}

.cookie-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* -------------------------------------------------------------
   ปรับแต่งสไตล์ปุ่ม (Visual Hierarchy)
------------------------------------------------------------- */
.cookie-btn {
    padding: 9px 18px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

/* 1. ปุ่มยอมรับทั้งหมด (Primary - เด่นที่สุด) */
.btn-accept { 
    background-color: #22c55e; 
    color: #ffffff; 
    border: 1px solid #22c55e;
}
.btn-accept:hover { 
    background-color: #16a34a; 
    border-color: #16a34a;
}

/* 2. ปุ่มตั้งค่าคุกกี้ (Secondary - โทนเทาทึบ) */
.btn-settings { 
    background-color: #334155; 
    color: #f1f5f9; 
    border: 1px solid #334155;
}
.btn-settings:hover { 
    background-color: #475569; 
    border-color: #475569;
}

/* 3. ปุ่มปฏิเสธทั้งหมด (Subtle - กรอบเทาเรียบๆ กลมกลืนไปกับแบนเนอร์) */
.btn-reject { 
    background-color: transparent; 
    color: #94a3b8; 
    border: 1px solid #475569;
}
.btn-reject:hover { 
    background-color: rgba(255, 255, 255, 0.05); 
    color: #ffffff; 
    border-color: #64748b;
}

/* -------------------------------------------------------------
   2. หน้าต่างตั้งค่าคุกกี้ (Preferences Modal)
------------------------------------------------------------- */
.cookie-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    font-family: 'Helvetica Neue', Arial, sans-serif;
}

.cookie-modal {
    position: relative;
    background: white;
    color: #333;
    width: 90%;
    max-width: 550px;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.btn-close-modal {
    position: absolute;
    top: 15px;
    right: 18px;
    background: none;
    border: none;
    font-size: 22px;
    font-weight: bold;
    color: #64748b;
    cursor: pointer;
    line-height: 1;
    padding: 5px;
    transition: color 0.2s ease;
}

.btn-close-modal:hover {
    color: #0f172a;
}

.cookie-modal h3 {
    margin: 0 0 15px 0;
    color: #0f172a;
    padding-right: 30px;
    font-size: 18px;
}

.cookie-category {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #e2e8f0;
}

.cookie-category-info {
    flex: 1;
    padding-right: 15px;
}

.cookie-category-info h4 {
    margin: 0 0 4px 0;
    font-size: 15px;
    color: #1e293b;
}

.cookie-category-info p {
    margin: 0;
    font-size: 12px;
    color: #64748b;
    line-height: 1.4;
}

/* ปุ่ม Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.switch input { opacity: 0; width: 0; height: 0; }

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #cbd5e1;
    transition: .3s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px; width: 18px;
    left: 3px; bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

input:checked + .slider { background-color: #22c55e; }
input:checked + .slider:before { transform: translateX(20px); }
input:disabled + .slider { background-color: #94a3b8; cursor: not-allowed; }

.modal-actions {
    margin-top: 20px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Responsive Support */
@media (max-width: 768px) {
    .cookie-content { flex-direction: column; align-items: stretch; }
    .cookie-actions { flex-direction: column; width: 100%; }
    .cookie-btn { width: 100%; text-align: center; }
}

