/* ============================================================
   CUSTOM BOOKING FORM  v8  –  Simple & Aligned
   ============================================================ */

/* ── Open button ────────────────────────────────────────────── */
.wbk-btn-wrap { margin-top: 12px; }

.wbk-open-btn {
    width:           100%;
    padding:         11px 18px;
    background:      #2563eb;
    color:           #fff;
    font-size:       15px;
    font-weight:     600;
    border:          none;
    border-radius:   6px;
    cursor:          pointer;
    transition:      background .15s;
}
.wbk-open-btn:hover { background: #1d4ed8; }

/* ── Overlay ────────────────────────────────────────────────── */
.wbk-overlay {
    position:        fixed;
    inset:           0;
    z-index:         99999;
    background:      rgba(0,0,0,.55);
    display:         flex;
    align-items:     center;
    justify-content: center;
    padding:         16px;
    opacity:         0;
    pointer-events:  none;
    transition:      opacity .2s;
}
.wbk-overlay.wbk-open { opacity: 1; pointer-events: auto; }

/* ── Modal ──────────────────────────────────────────────────── */
.wbk-modal {
    width:         100%;
    max-width:     580px;
    max-height:    90vh;
    overflow-y:    auto;
    background:    #fff;
    border-radius: 10px;
    box-shadow:    0 8px 40px rgba(0,0,0,.18);
    transform:     translateY(16px);
    transition:    transform .2s;
}
.wbk-overlay.wbk-open .wbk-modal { transform: translateY(0); }

/* ── Header ─────────────────────────────────────────────────── */
.wbk-header {
    display:         flex;
    align-items:     center;
    justify-content: space-between;
    padding:         18px 20px;
    border-bottom:   1px solid #e5e7eb;
}
.wbk-header-title {
    font-size:   17px;
    font-weight: 700;
    color:       #111827;
}
.wbk-close {
    width:           30px;
    height:          30px;
    border:          none;
    background:      #f3f4f6;
    border-radius:   6px;
    font-size:       18px;
    line-height:     1;
    color:           #6b7280;
    cursor:          pointer;
    display:         flex;
    align-items:     center;
    justify-content: center;
}
.wbk-close:hover { background: #fee2e2; color: #dc2626; }

/* ── Product label ──────────────────────────────────────────── */
.wbk-product-label {
    margin:        12px 20px;
    padding:       8px 12px;
    background:    #eff6ff;
    border-radius: 6px;
    font-size:     13px;
    color:         #374151;
    border:        1px solid #bfdbfe;
}
.wbk-product-label strong { color: #111827; }

/* ── Form padding ───────────────────────────────────────────── */
#wbk-form { padding: 4px 20px 20px; }

/* ── Section title ──────────────────────────────────────────── */
.wbk-section {
    margin:         16px 0 10px;
    font-size:      11px;
    font-weight:    700;
    text-transform: uppercase;
    letter-spacing: .9px;
    color:          #6b7280;
    border-bottom:  1px solid #e5e7eb;
    padding-bottom: 6px;
}

/* ── Grid layouts ───────────────────────────────────────────── */
.wbk-grid-1,
.wbk-grid-2,
.wbk-grid-4 {
    display: grid;
    gap:     12px;
    margin-bottom: 12px;
}
.wbk-grid-1 { grid-template-columns: 1fr; }
.wbk-grid-2 { grid-template-columns: 1fr 1fr; }
.wbk-grid-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }

/* ── Field ──────────────────────────────────────────────────── */
.wbk-f {
    display:        flex;
    flex-direction: column;
    gap:            4px;
}

/* ── Label ──────────────────────────────────────────────────── */
.wbk-f label {
    font-size:   12px;
    font-weight: 600;
    color:       #374151;
}
.wbk-f label em  { color: #ef4444; font-style: normal; margin-left: 1px; }
.wbk-f label small { font-weight: 400; color: #9ca3af; font-style: normal; }

/* ── All inputs & selects — identical height & look ─────────── */
.wbk-f input,
.wbk-f select,
.wbk-f textarea,
.wbk-phone-box {
    height:        40px;
    padding:       0 11px;
    font-size:     13px;
    font-family:   inherit;
    color:         #111827;
    background:    #fff;
    border:        1px solid #d1d5db;
    border-radius: 6px;
    outline:       none;
    width:         100%;
    box-sizing:    border-box;
    transition:    border-color .15s, box-shadow .15s;
}
.wbk-f select { cursor: pointer; }
.wbk-f textarea {
    height:     80px;
    padding:    9px 11px;
    resize:     vertical;
    line-height: 1.5;
}
.wbk-f input::placeholder,
.wbk-f textarea::placeholder { color: #9ca3af; }

.wbk-f input:focus,
.wbk-f select:focus,
.wbk-f textarea:focus,
.wbk-phone-box:focus-within {
    border-color: #2563eb;
    box-shadow:   0 0 0 3px rgba(37,99,235,.12);
}

/* invalid */
.wbk-f input.err,
.wbk-f select.err,
.wbk-phone-box.err {
    border-color: #ef4444 !important;
    box-shadow:   0 0 0 3px rgba(239,68,68,.1) !important;
}

/* ── Phone box — one unified border, two children ───────────── */
.wbk-phone-box {
    display:    flex;
    align-items: stretch;
    padding:    0;
    overflow:   hidden;
    position:   relative;
}

.wbk-phone-box select {
    height:      100%;
    width:       100px;
    flex-shrink: 0;
    border:      none;
    border-right: 1px solid #d1d5db;
    border-radius: 0;
    background:  #f9fafb;
    padding:     0 8px;
    font-size:   12px;
    outline:     none;
    box-shadow:  none;
    cursor:      pointer;
}
.wbk-phone-box input[type="tel"] {
    height:      100%;
    flex:        1;
    border:      none;
    border-radius: 0;
    padding:     0 32px 0 10px;
    font-size:   13px;
    outline:     none;
    box-shadow:  none;
    min-width:   0;
    background:  #fff;
}
.wbk-phone-box input[type="tel"]::placeholder { color: #9ca3af; }

.wbk-counter {
    position:       absolute;
    right:          8px;
    top:            50%;
    transform:      translateY(-50%);
    font-size:      10px;
    font-weight:    600;
    color:          #9ca3af;
    pointer-events: none;
}
.wbk-counter.ok  { color: #16a34a; }
.wbk-counter.err { color: #ef4444; }

/* ── Upload zone ────────────────────────────────────────────── */
.wbk-upload {
    position:      relative;
    border:        1.5px dashed #d1d5db;
    border-radius: 6px;
    background:    #f9fafb;
    cursor:        pointer;
    transition:    border-color .15s, background .15s;
    overflow:      hidden;
}
.wbk-upload:hover,
.wbk-upload.drag { border-color: #2563eb; background: #eff6ff; }
.wbk-upload.err  { border-color: #ef4444; background: #fef2f2; }

.wbk-upload-input {
    position: absolute;
    inset:    0;
    opacity:  0;
    cursor:   pointer;
    z-index:  2;
    /* reset any inherited input styles */
    height:   100% !important;
    border:   none !important;
    box-shadow: none !important;
    width:    100% !important;
}

.wbk-upload-idle {
    display:         flex;
    flex-direction:  column;
    align-items:     center;
    justify-content: center;
    gap:             4px;
    padding:         18px 16px;
    text-align:      center;
    position:        relative;
    z-index:         1;
    color:           #6b7280;
    font-size:       13px;
}
.wbk-upload-idle svg  { color: #9ca3af; margin-bottom: 2px; }
.wbk-upload-idle small { font-size: 11px; color: #9ca3af; }

.wbk-upload-done {
    display:     flex;
    align-items: center;
    gap:         10px;
    padding:     10px 14px;
    position:    relative;
    z-index:     1;
}
.wbk-upload-done img {
    width:         48px;
    height:        48px;
    object-fit:    cover;
    border-radius: 4px;
    border:        1px solid #e5e7eb;
    flex-shrink:   0;
}
.wbk-upload-done span {
    flex:       1;
    font-size:  13px;
    color:      #374151;
    word-break: break-all;
    min-width:  0;
}
.wbk-upload-remove {
    flex-shrink:     0;
    width:           26px;
    height:          26px;
    border:          none;
    border-radius:   4px;
    background:      #fee2e2;
    color:           #dc2626;
    font-size:       13px;
    cursor:          pointer;
    display:         flex;
    align-items:     center;
    justify-content: center;
    z-index:         3;
}
.wbk-upload-remove:hover { background: #fca5a5; }

/* ── Submit ─────────────────────────────────────────────────── */
.wbk-submit-wrap { margin-top: 18px; }

.wbk-submit {
    width:           100%;
    height:          42px;
    background:      #2563eb;
    color:           #fff;
    font-size:       14px;
    font-weight:     600;
    font-family:     inherit;
    border:          none;
    border-radius:   6px;
    cursor:          pointer;
    display:         flex;
    align-items:     center;
    justify-content: center;
    gap:             8px;
    transition:      background .15s;
}
.wbk-submit:hover    { background: #1d4ed8; }
.wbk-submit:disabled { opacity: .6; cursor: not-allowed; }

.wbk-submit-text,
.wbk-submit-loader { display: flex; align-items: center; gap: 7px; }

@keyframes wbk-spin { to { transform: rotate(360deg); } }
.wbk-spin { animation: wbk-spin .8s linear infinite; }

/* ── Error ──────────────────────────────────────────────────── */
.wbk-error {
    margin-top:    12px;
    padding:       9px 14px;
    background:    #fef2f2;
    border:        1px solid #fca5a5;
    border-radius: 6px;
    color:         #dc2626;
    font-size:     13px;
    text-align:    center;
}

/* ── Success ────────────────────────────────────────────────── */
.wbk-success {
    text-align: center;
    padding:    40px 24px;
}
.wbk-success svg    { display: block; margin: 0 auto 14px; }
.wbk-success h3     { margin: 0 0 8px; font-size: 18px; color: #111827; }
.wbk-success p      { margin: 0 0 6px; font-size: 13px; color: #6b7280; }
.wbk-success strong { color: #111827; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 520px) {
    .wbk-grid-2 { grid-template-columns: 1fr; }
    .wbk-grid-4 { grid-template-columns: 1fr 1fr; }
    #wbk-form,
    .wbk-header,
    .wbk-product-label { padding-left: 14px; padding-right: 14px; }
    .wbk-product-label { margin-left: 14px; margin-right: 14px; }
}

/* ── Yes / No design toggle ─────────────────────────────────── */
.wbk-yn-row {
    display: flex;
    gap:     12px;
}
.wbk-yn-opt {
    display:     flex;
    align-items: center;
    gap:         7px;
    cursor:      pointer;
    padding:     9px 16px;
    border:      1.5px solid #d1d5db;
    border-radius: 6px;
    font-size:   13px;
    color:       #374151;
    font-weight: 500;
    transition:  border-color .15s, background .15s, color .15s;
    user-select: none;
}
.wbk-yn-opt input[type="radio"] {
    /* reset inherited input styles */
    width:        16px;
    height:       16px;
    min-width:    16px;
    border:       none;
    box-shadow:   none;
    padding:      0;
    margin:       0;
    accent-color: #2563eb;
    cursor:       pointer;
    flex-shrink:  0;
}
.wbk-yn-opt:has(input:checked) {
    border-color: #2563eb;
    background:   #eff6ff;
    color:        #1d4ed8;
}

/* ── Smooth show/hide of upload zone ───────────────────────── */
#wbk-design-wrap {
    overflow:   hidden;
    transition: max-height .25s ease, opacity .2s ease, margin .2s ease;
    max-height: 200px;
    opacity:    1;
    margin-top: 10px;
}
#wbk-design-wrap.wbk-hidden {
    max-height: 0;
    opacity:    0;
    margin-top: 0;
    pointer-events: none;
}
