@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700&family=Inter:wght@300;400;500;600&display=swap');

/* ── Reset inside modal only ── */
#modal * { margin: 0; padding: 0; box-sizing: border-box; }

.tlc-open-modal { cursor: pointer; }

/* ── Overlay ── */
#modal {
    display: none;
    position: fixed;
    z-index: 999999;
    inset: 0;
    background-color: rgba(0,0,0,0.6);
    backdrop-filter: blur(5px);
    animation: tlcFadeIn 0.3s ease;
}
@keyframes tlcFadeIn { from{opacity:0} to{opacity:1} }

/* ── Modal box ── */
#modal .modal-content {
    position: relative;
    background: #fefefe;
    margin: 4% auto;
    width: 90%;
    max-width: 900px;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    animation: tlcSlideDown 0.3s ease;
    overflow: hidden;
}
@keyframes tlcSlideDown {
    from { transform: translateY(-40px); opacity: 0; }
    to   { transform: translateY(0);     opacity: 1; }
}

/* ── Close button ── */
#modal .close {
    position: absolute;
    right: 18px; top: 14px;
    z-index: 10;
    font-size: 28px; font-weight: 300;
    color: #999; cursor: pointer; line-height: 1;
    transition: color 0.2s;
    font-family: 'Inter', sans-serif;
}
#modal .close:hover { color: #1a1a2e; }

/* ── Two-column body ── */
#modal .modal-body { display: flex; min-height: 500px; }

#modal .form-section {
    flex: 0 0 50%; width: 50%;
    padding: 40px;
    background: #fff;
    border-right: 1px solid #e8e8e8;
    overflow-y: auto;
    max-height: 90vh;
}

#modal .content-section {
    flex: 0 0 50%; width: 50%;
    padding: 40px;
    background: linear-gradient(135deg,#1a1a2e 0%,#16213e 50%,#0f3460 100%);
    color: #f5f5f5;
    display: flex; flex-direction: column; justify-content: center;
}

/* ── Typography ── */
#modal .form-section h2 {
    font-family: 'Playfair Display', serif;
    font-size: 26px; font-weight: 600;
    color: #1a1a2e; margin-bottom: 24px; letter-spacing: -0.5px;
}
#modal .content-section h2 {
    font-family: 'Playfair Display', serif;
    font-size: 26px; font-weight: 600;
    color: #d4af37; margin-bottom: 16px;
}
#modal .content-section p {
    font-family: 'Inter', sans-serif;
    font-size: 14px; font-weight: 300;
    color: #e8e8e8; line-height: 1.7; margin-bottom: 12px;
}

/* ── Form groups ── */
#modal .form-group { margin-bottom: 14px; }

#modal .form-group label {
    display: block; margin-bottom: 5px;
    font-family: 'Inter', sans-serif;
    font-size: 13px; font-weight: 500; color: #1a1a2e;
}
#modal .form-group label::after { content:" *"; color:#d32f2f; }

#modal .form-group input[type="text"],
#modal .form-group input[type="email"],
#modal .form-group input[type="tel"] {
    width: 100%; padding: 10px 14px;
    border: 1.5px solid #d0d0d0; border-radius: 6px;
    font-size: 14px; font-family: 'Inter', sans-serif;
    background: #fafafa; color: #1a1a2e;
    transition: border-color 0.25s, box-shadow 0.25s;
}
#modal .form-group input[type="text"]:focus,
#modal .form-group input[type="email"]:focus,
#modal .form-group input[type="tel"]:focus {
    outline: none; border-color: #d4af37;
    background: #fff; box-shadow: 0 0 0 3px rgba(212,175,55,0.1);
}
#modal .form-group input.error-field {
    border-color: #d32f2f; background: #fff5f5;
}

/* ── Submit button ── */
#modal .submit-btn {
    width: 100%; padding: 12px; margin-top: 6px;
    background: #d4af37; color: #1a1a2e;
    border: none; border-radius: 6px;
    font-size: 14px; font-weight: 600;
    font-family: 'Inter', sans-serif;
    letter-spacing: 0.8px; text-transform: uppercase;
    cursor: pointer; transition: all 0.25s;
    box-shadow: 0 4px 14px rgba(212,175,55,0.25);
}
#modal .submit-btn:hover:not(:disabled) {
    background: #c9a227; transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(212,175,55,0.35);
}
#modal .submit-btn:disabled {
    background: #ccc; opacity: 0.7;
    cursor: not-allowed; transform: none;
}

/* ── Features list ── */
#modal .features { margin-top: 22px; }
#modal .features h3 {
    font-family: 'Playfair Display', serif;
    font-size: 19px; font-weight: 600;
    color: #d4af37; margin-bottom: 12px;
}
#modal .features ul { list-style: none; padding: 0; }
#modal .features ul li {
    padding: 8px 0 8px 24px; position: relative;
    font-family: 'Inter', sans-serif;
    font-size: 14px; font-weight: 300; color: #e8e8e8;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
#modal .features ul li:last-child { border-bottom: none; }
#modal .features ul li::before {
    content:"✓"; position:absolute; left:0;
    color:#d4af37; font-weight:700; font-size:14px;
}

/* ══════════════════════════════════════════
   CUSTOM CHECKBOX DROPDOWN
   ══════════════════════════════════════════ */

.tlc-custom-select-wrapper { position: relative; width: 100%; }
.tlc-custom-select-wrapper select { display: none !important; }

.tlc-select-trigger {
    display: flex; align-items: center;
    width: 100%; min-height: 42px; padding: 10px 14px;
    border: 1.5px solid #d0d0d0; border-radius: 6px;
    background: #fafafa; cursor: pointer; user-select: none;
    overflow: hidden;
    transition: border-color 0.25s, box-shadow 0.25s;
}
.tlc-select-trigger:hover { border-color: #b8972e; }
.tlc-select-trigger.active {
    border-color: #d4af37; background: #fff;
    box-shadow: 0 0 0 3px rgba(212,175,55,0.12);
}
.tlc-select-trigger.error-field { border-color: #d32f2f; background: #fff5f5; }

.tlc-select-trigger-text {
    flex: 1; min-width: 0;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    font-family: 'Inter', sans-serif; font-size: 14px; color: #aaa;
}
.tlc-select-trigger-text.has-value { 
color: #1a1a2e; 
font-weight: 500;
padding: 0 10px !important;
}

.tlc-select-arrow {
    flex-shrink: 0; width: 15px; height: 15px; margin-left: 8px;
    color: #aaa; transition: transform 0.22s, color 0.22s;
}
.tlc-select-trigger.active .tlc-select-arrow { transform: rotate(180deg); color: #d4af37; }

/* Dropdown panel */
.tlc-select-dropdown {
    display: none; position: fixed;
    z-index: 99999999; background: #fff;
    border: 1.5px solid #d4af37; border-radius: 8px;
    box-shadow: 0 10px 28px rgba(0,0,0,0.16);
    overflow-y: auto;
}
.tlc-select-dropdown.open { display: block; }

/* Select all row */
.tlc-select-all-row {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 13px; border-bottom: 1px solid #eee;
    cursor: pointer; font-family: 'Inter', sans-serif;
    font-size: 11px; font-weight: 700; color: #888;
    letter-spacing: 0.6px; text-transform: uppercase;
    transition: background 0.12s;
}
.tlc-select-all-row:hover { background: #fffbef; }

/* Option rows */
.tlc-select-option {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 13px; border-bottom: 1px solid #f5f5f5;
    cursor: pointer; font-family: 'Inter', sans-serif;
    font-size: 14px; color: #1a1a2e;
    transition: background 0.12s;
}
.tlc-select-option:last-child { border-bottom: none; }
.tlc-select-option:hover   { background: #fffbef; }
.tlc-select-option.selected { background: #eef3ff; }

/* Checkbox */
.tlc-checkbox {
    flex-shrink: 0; width: 16px; height: 16px;
    border: 2px solid #ccc; border-radius: 3px;
    background: #fff; display: flex; align-items: center; justify-content: center;
    transition: background 0.15s, border-color 0.15s; position: relative;
}
.tlc-select-option.selected .tlc-checkbox,
.tlc-select-all-row.all-selected .tlc-checkbox { background: #4070c4; border-color: #4070c4; }
.tlc-checkbox::after {
    content:''; position:absolute;
    width:4px; height:8px;
    border:2px solid transparent; border-top:none; border-left:none;
    transform:rotate(45deg) translate(-1px,-1px);
    opacity:0; transition:opacity 0.12s;
}
.tlc-select-option.selected .tlc-checkbox::after,
.tlc-select-all-row.all-selected .tlc-checkbox::after { border-color:#fff; opacity:1; }

.tlc-option-label { flex: 1; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }

/* ── Type badge on each subtype option ── */
.tlc-type-badge {
    display: inline-flex; align-items: center;
    padding: 2px 7px; border-radius: 20px;
    font-size: 10px; font-weight: 600;
    letter-spacing: 0.3px; white-space: nowrap;
    font-family: 'Inter', sans-serif;
    margin-left: auto;
    flex-shrink: 0;
}
/* Badge colors per type */
.tlc-badge-tables  { background: #fff3cd; color: #856404; }
.tlc-badge-chairs  { background: #d1e7dd; color: #0f5132; }
.tlc-badge-linens  { background: #cfe2ff; color: #084298; }
.tlc-badge-drapes  { background: #f8d7da; color: #842029; }
.tlc-badge-tent    { background: #e2d9f3; color: #432874; }

/* ── Option label (name only) ── */
.tlc-option-name {
    flex: 1;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: #1a1a2e;
}

/* ── Inline qty inside checked option row ── */
.tlc-inline-qty {
    display: none;
    align-items: center;
    margin: 0 6px;
}
.tlc-inline-qty.visible { display: flex; }

.tlc-qty-input {
    width: 60px !important;
    padding: 3px 6px !important;
    border: 1.5px solid #d0d0d0 !important;
    border-radius: 5px !important;
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    color: #1a1a2e;
    background: #fff;
    text-align: center;
    transition: border-color 0.2s;
}
.tlc-qty-input:focus {
    outline: none;
    border-color: #d4af37;
    box-shadow: 0 0 0 2px rgba(212,175,55,0.15);
}

/* Remove old external qty wrapper styles */
.tlc-qty-wrapper { display: none !important; }
.tlc-qty-item-name { display: none; }
.tlc-qty-label { display: none; }

/* ── Responsive ── */
@media (max-width: 768px) {
    #modal .modal-body { flex-direction: column; }
    #modal .form-section {
        flex: none; width: 100%;
        border-right: none; border-bottom: 1px solid #e8e8e8;
        max-height: 75vh; overflow-y: auto;
    }
    #modal .content-section { flex: none; width: 100%; padding: 28px; }
    #modal .modal-content { width: 95%; margin: 6% auto; }
}