/* ================================================
   Quick Booking Plugin – Frontend Styles
   ================================================ */

/* ── Root (one shortcode — width from Form Style --qb-max-width) ── */
.qb-booking-root {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* ── Wrapper ── */
.qb-hero-wrapper {
    position: relative;
    width: 100%;
    max-width: min(var(--qb-max-width, 100%), 100%);
    box-sizing: border-box;
    border-radius: 14px;
    overflow: hidden;
    background:
        linear-gradient(135deg, rgba(0,0,0,0.72) 0%, rgba(0,0,0,0.45) 100%),
        repeating-linear-gradient(-45deg, #2a2a2a 0px, #2a2a2a 2px, #222 2px, #222 12px);
    box-shadow: 0 24px 72px rgba(0,0,0,0.55);
    font-family: 'Barlow', sans-serif;
}

/* Decorative diagonal arrows (top-right) */
.qb-arrows-deco {
    position: absolute;
    top: 0; right: 0;
    width: 220px; height: 100%;
    pointer-events: none;
    background: linear-gradient(135deg, transparent 40%, rgba(245,197,24,0.05) 100%);
}
.qb-arrows-deco::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        135deg,
        transparent 0, transparent 18px,
        rgba(245,197,24,0.12) 18px, rgba(245,197,24,0.12) 22px
    );
    clip-path: polygon(60% 0%, 100% 0%, 100% 100%, 30% 100%);
}

/* ── Panel ── */
.qb-booking-panel {
    position: relative;
    background: rgba(15,15,15,0.93);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 12px;
    margin: 36px;
    padding: 30px 32px;
    backdrop-filter: blur(14px);
    box-shadow: 0 8px 40px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.05);
}

/* ── Title ── */
.qb-title {
    font-size: 22px;
    font-weight: 800;
    color: #fff;
    letter-spacing: 0.025em;
    margin: 0 0 24px;
    padding: 0;
    border: none;
    background: none;
}

/* ── Step layout ── */
.qb-fields-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr auto;
    gap: 14px;
    align-items: end;
}
.qb-details-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr auto;
    gap: 14px;
    align-items: end;
}

.qb-field-full {
    grid-column: 1 / -1;
}

.qb-input-wrap textarea {
    width: 100%;
    min-height: 72px;
    resize: vertical;
    padding: 10px 12px;
    box-sizing: border-box;
}

.qb-input-wrap select {
    width: 100%;
    padding: 10px 12px;
    box-sizing: border-box;
    cursor: pointer;
}

/* ── Field group ── */
.qb-field-group {
    display: flex;
    flex-direction: column;
    gap: 7px;
}
.qb-label {
    font-size: 11px;
    font-weight: 700;
    color: #777;
    text-transform: uppercase;
    letter-spacing: 0.09em;
}

/* ── Input wrap ── */
.qb-input-wrap {
    position: relative;
}
.qb-input-wrap input {
    width: 100%;
    background: #1c1c1c;
    border: 1.5px solid #2e2e2e;
    border-radius: 8px;
    color: #ccc;
    font-family: 'Barlow', sans-serif;
    font-size: 14px;
    font-weight: 500;
    padding: 10px 36px 10px 13px;
    outline: none;
    transition: border-color .2s, background .2s, box-shadow .2s;
    -webkit-appearance: none;
    appearance: none;
    color-scheme: dark;
    box-sizing: border-box;
}
.qb-input-wrap input::-webkit-calendar-picker-indicator {
    opacity: 0;
    position: absolute;
    right: 0;
    width: 36px;
    height: 100%;
    cursor: pointer;
}
.qb-input-wrap input:focus,
.qb-input-wrap input:hover {
    border-color: #F5C518;
    background: #242424;
    box-shadow: 0 0 0 3px rgba(245,197,24,0.13);
}
.qb-icon {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #555;
    pointer-events: none;
    transition: color .2s;
    display: flex;
    align-items: center;
}
.qb-input-wrap:hover .qb-icon,
.qb-input-wrap:focus-within .qb-icon {
    color: #F5C518;
}

/* ── Primary Button ── */
.qb-btn-check {
    background: linear-gradient(135deg, #F5C518 0%, #e6b800 100%);
    color: #111;
    border: none;
    border-radius: 9px;
    font-family: 'Barlow', sans-serif;
    font-size: 14px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0 26px;
    height: 46px;
    cursor: pointer;
    white-space: nowrap;
    line-height: 1.25;
    text-align: center;
    transition: transform .15s, box-shadow .15s, background .15s;
    box-shadow: 0 4px 20px rgba(245,197,24,0.35);
    align-self: end;
}
.qb-btn-check:hover {
    background: linear-gradient(135deg, #ffd63a 0%, #F5C518 100%);
    box-shadow: 0 6px 28px rgba(245,197,24,0.55);
    transform: translateY(-1px);
}
.qb-btn-check:active { transform: translateY(0); }
.qb-btn-check:disabled {
    opacity: .5;
    cursor: not-allowed;
    transform: none;
}

/* ── Back Button ── */
.qb-btn-back {
    background: transparent;
    color: #888;
    border: 1.5px solid #333;
    border-radius: 9px;
    font-family: 'Barlow', sans-serif;
    font-size: 13px;
    font-weight: 600;
    padding: 0 18px;
    height: 46px;
    cursor: pointer;
    transition: border-color .2s, color .2s;
    margin-right: 8px;
}
.qb-btn-back:hover {
    border-color: #F5C518;
    color: #F5C518;
}

/* ── Step 2 actions ── */
.qb-step2-actions {
    display: flex;
    align-items: center;
    align-self: end;
}

/* ── Notice ── */
.qb-notice {
    margin-top: 18px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Barlow', sans-serif;
}
.qb-notice.qb-success {
    background: rgba(50,200,100,0.12);
    border: 1px solid rgba(50,200,100,0.35);
    color: #4cdb7a;
}
.qb-notice.qb-error {
    background: rgba(220,60,60,0.12);
    border: 1px solid rgba(220,60,60,0.35);
    color: #f07070;
}

/* ── Loading ── */
.qb-loading {
    margin-top: 16px;
    font-size: 14px;
    color: #888;
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Barlow', sans-serif;
}
.qb-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid #333;
    border-top-color: #F5C518;
    border-radius: 50%;
    animation: qb-spin .7s linear infinite;
    display: inline-block;
}
@keyframes qb-spin { to { transform: rotate(360deg); } }

/* ── Utility ── */
.qb-hidden { display: none !important; }

/* ── Step transitions ── */
.qb-step {
    transition: opacity .25s;
}

/* ── Responsive ── */
@media (max-width: 760px) {
    .qb-booking-panel { margin: 16px; padding: 22px 16px; }
    .qb-fields-row,
    .qb-details-row {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto;
    }
    .qb-btn-check,
    .qb-step2-actions {
        grid-column: 1 / -1;
    }
    .qb-step2-actions { justify-content: stretch; }
    .qb-btn-check { width: 100%; height: 50px; }
}
@media (max-width: 480px) {
    .qb-fields-row,
    .qb-details-row { grid-template-columns: 1fr; }
}

/* ── Layout: columns ── */
.qb-booking-root.qb-cols-1 .qb-fields-row,
.qb-booking-root.qb-cols-1 .qb-details-row {
    grid-template-columns: 1fr;
}
.qb-booking-root.qb-cols-2 .qb-fields-row {
    grid-template-columns: 1fr 1fr auto;
}
.qb-booking-root.qb-cols-2 .qb-details-row {
    grid-template-columns: 1fr 1fr auto;
}

/* ── Layout: stacked (vertical flex) ── */
.qb-booking-root.qb-layout-stacked .qb-fields-row,
.qb-booking-root.qb-layout-stacked .qb-details-row {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
}
.qb-booking-root.qb-layout-stacked .qb-btn-check,
.qb-booking-root.qb-layout-stacked .qb-step2-actions {
    align-self: stretch;
    width: 100%;
}

/* ── Layout: horizontal (flex wrap) ── */
.qb-booking-root.qb-layout-horizontal .qb-fields-row,
.qb-booking-root.qb-layout-horizontal .qb-details-row {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: flex-end;
}
.qb-booking-root.qb-layout-horizontal .qb-field-group {
    flex: 1 1 160px;
    min-width: 140px;
}

/* ── Layout: compact ── */
.qb-booking-root.qb-layout-compact .qb-booking-panel {
    margin: 12px;
    padding: 18px 16px;
}
.qb-booking-root.qb-layout-compact .qb-title {
    font-size: 18px !important;
    margin-bottom: 14px;
}

/* ── Align ── */
.qb-booking-root.qb-align-center .qb-hero-wrapper {
    margin-left: auto;
    margin-right: auto;
}
.qb-booking-root.qb-align-start .qb-hero-wrapper {
    margin-right: auto;
}
.qb-booking-root.qb-align-end .qb-hero-wrapper {
    margin-left: auto;
}

/* ── Inline mode (full form on page) ── */
.qb-booking-root.qb-mode-inline {
    display: block;
    clear: both;
}

/* ── Popup mode (header button) ── */
.qb-booking-root.qb-mode-popup {
    display: inline-block;
    width: auto;
    max-width: none;
}
.qb-booking-root.qb-mode-popup .qb-popup-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.qb-popup-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(0, 0, 0, 0.72);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}
.qb-popup-dialog {
    position: relative;
    width: 100%;
    max-width: min(960px, 100%);
    max-height: 92vh;
    overflow-y: auto;
}
.qb-popup-dialog .qb-hero-wrapper {
    max-width: 100% !important;
}
.qb-popup-close {
    position: absolute;
    top: 12px;
    right: 14px;
    z-index: 2;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}
body.qb-popup-open {
    overflow: hidden;
}
