/* ========================================
   OBY Starter - Front-end Popup & Inline Form Styles
   All classes prefixed with .oby- for easy
   override via WordPress Customizer CSS.

   CUSTOMISATION CLASSES:
   .oby-trigger-btn        the button that opens the popup
   .oby-overlay            dark backdrop
   .oby-modal              white popup card
   .oby-inline-form        inline form container
   .oby-modal__close       × close button
   .oby-modal__badge       "Quick Booking" badge
   .oby-modal__title       popup heading
   .oby-modal__subtitle    subheading text
   .oby-modal__summary     fixed fields summary card
   .oby-modal__label       field labels
   .oby-modal__input       all input fields
   .oby-modal__date        date input
   .oby-modal__select      dropdown select
   .oby-modal__btn-row     dual button container
   .oby-modal__submit--wa  WhatsApp submit button
   .oby-modal__submit--email Email submit button
   .oby-modal__hidden-fields hidden email fields
   .oby-modal__calc-row    calculated field row
   ======================================== */

/* ─── Trigger Button ─── */
.oby-trigger-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    font-size: 15px;
    font-weight: 700;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: #fff;
    background: #25D366;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    letter-spacing: 0.02em;
    transition: background 0.18s, transform 0.15s, box-shadow 0.18s;
    box-shadow: 0 4px 16px rgba(37, 211, 102, 0.3);
}

.oby-trigger-btn:hover {
    background: #1ebe5a;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(37, 211, 102, 0.4);
}

.oby-trigger-btn:active {
    transform: translateY(0);
}

/* ─── Overlay ─── */
.oby-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    z-index: 99998;
    align-items: center;
    justify-content: center;
    padding: 16px;
    will-change: opacity;
}

.oby-modal {
    transform: translateZ(0);
}

.oby-overlay.oby-active {
    display: flex;
    animation: obyFadeIn 0.22s ease;
}

@keyframes obyFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes obySlideUp {
    from { opacity: 0; transform: translateY(28px) scale(0.97); }
    to   { opacity: 1; transform: none; }
}

/* ─── Modal Card ─── */
.oby-modal {
    background: #fff;
    border-radius: 18px;
    padding: 36px 32px 28px;
    width: 100%;
    max-width: 460px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.28);
    animation: obySlideUp 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* Scrollbar styling */
.oby-modal::-webkit-scrollbar {
    width: 5px;
}
.oby-modal::-webkit-scrollbar-track {
    background: transparent;
}
.oby-modal::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 10px;
}

/* ─── Inline Form ─── */
.oby-inline-form {
    background: #fff;
    border-radius: 18px;
    padding: 36px 32px 28px;
    width: 100%;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    border: 1px solid #e8ecf2;
}

/* ─── Close Button ─── */
.oby-modal__close {
    position: absolute;
    top: 14px;
    right: 18px;
    background: none;
    border: none;
    font-size: 22px;
    line-height: 1;
    color: #666;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
}

.oby-modal__close:hover {
    background: #f0f0f0;
    color: #111;
}

/* ─── Badge ─── */
.oby-modal__badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #e8f8f1;
    color: #1a7a4a;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 20px;
    margin-bottom: 10px;
}

/* ─── Title & Subtitle ─── */
.oby-modal__title {
    font-size: 22px;
    font-weight: 800;
    color: #0d1b2a;
    margin: 0 0 4px;
    line-height: 1.25;
    letter-spacing: -0.3px;
}

.oby-modal__subtitle {
    font-size: 13px;
    color: #888;
    margin: 0 0 22px;
}

.oby-modal__desc {
    font-size: 13px;
    color: #666;
    margin: -14px 0 22px;
    line-height: 1.5;
}

/* ─── Summary Card (Fixed Fields) ─── */
.oby-modal__summary {
    background: #f7f9fc;
    border: 1px solid #e8ecf2;
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 22px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px 12px;
}

.oby-modal__summary-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    box-sizing: border-box;
}

.oby-modal__summary-key {
    font-size: 10px;
    font-weight: 700;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.oby-modal__summary-val {
    font-size: 13px;
    font-weight: 600;
    color: #1a1a2e;
}

/* ─── Form Fields ─── */
.oby-modal__form {
    display: flex;
    flex-wrap: wrap;
    gap: 0 12px;
}

.oby-modal__field {
    margin-bottom: 16px;
    box-sizing: border-box;
}

.oby-modal__label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
}

.oby-modal__label span {
    color: #e53e3e;
    margin-left: 2px;
}

/* ─── Input Fields ─── */
.oby-modal__input,
.oby-modal__date,
.oby-modal__select {
    width: 100%;
    box-sizing: border-box;
    border: 1.5px solid #dde3ed;
    border-radius: 10px;
    padding: 11px 14px;
    font-size: 15px;
    color: #111;
    outline: none;
    transition: border-color 0.18s, box-shadow 0.18s;
    background: #fff;
    font-family: inherit;
    -webkit-appearance: none;
    appearance: none;
}

.oby-modal__input:focus,
.oby-modal__date:focus,
.oby-modal__select:focus {
    border-color: #25D366;
    box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.15);
}

.oby-modal__input::placeholder {
    color: #bbb;
}

/* Dropdown arrow */
.oby-modal__select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 12px;
    padding-right: 36px;
    cursor: pointer;
}

/* Textarea */
textarea.oby-modal__input {
    resize: vertical;
    min-height: 70px;
}

/* ─── Error State ─── */
.oby-modal__input.oby-error,
.oby-modal__date.oby-error,
.oby-modal__select.oby-error,
.oby-modal__input.oby-error:focus,
.oby-modal__date.oby-error:focus,
.oby-modal__select.oby-error:focus {
    border-color: #e53e3e !important;
    box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.35);
    animation: oby-flash-border 0.8s ease-in-out 2;
}

@keyframes oby-flash-border {
    0%, 100% { box-shadow: 0 0 0 1px rgba(229, 62, 62, 0.2); }
    50% { box-shadow: 0 0 4px 1px rgba(229, 62, 62, 0.8); }
}

/* ─── Intl Phone Input ─── */
.oby-intl-phone {
    position: relative;
    width: 100%;
}
.oby-intl-phone__input {
    padding-left: 52px !important;
}
.oby-intl-phone__trigger {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 4px 6px;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    color: #333;
    transition: background 0.15s;
    z-index: 2;
}
.oby-intl-phone__trigger:hover {
    background: #f1f4f9;
}
.oby-intl-phone__flag {
    font-size: 18px;
    line-height: 1;
}
.oby-intl-phone__caret {
    font-size: 9px;
    color: #888;
}
.oby-intl-phone__dropdown {
    position: fixed;
    top: 0;
    left: 0;
    width: 300px;
    background: #fff;
    border: 1px solid #c7ccd6;
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    z-index: 2147483000;
    overflow: hidden;
    animation: oby-intl-fade 0.1s ease-out;
}
@keyframes oby-intl-fade {
    from { opacity: 0; }
    to   { opacity: 1; }
}
.oby-intl-phone__search-wrap {
    padding: 0;
    border-bottom: 1px solid #e4e7ed;
}
.oby-intl-phone__search {
    width: 100%;
    box-sizing: border-box;
    border: none;
    border-radius: 0;
    padding: 9px 14px;
    font-size: 14px;
    font-family: inherit;
    color: #111;
    outline: none;
    background: #fff;
}
.oby-intl-phone__search::placeholder { color: #bbb; }
.oby-intl-phone__search:focus {
    background: #fafbfc;
}
.oby-intl-phone__list {
    max-height: 220px;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 0;
}
.oby-intl-phone__item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 7px 14px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    color: #222;
    text-align: left;
}
.oby-intl-phone__item:hover {
    background: #1e6fd9;
    color: #fff;
}
.oby-intl-phone__item:hover .oby-intl-phone__item-dial {
    color: rgba(255, 255, 255, 0.85);
}
.oby-intl-phone__item.is-selected {
    background: #eef2f8;
    color: #111;
    font-weight: 600;
}
.oby-intl-phone__item.is-selected:hover {
    background: #1e6fd9;
    color: #fff;
}
.oby-intl-phone__item-flag {
    font-size: 17px;
    line-height: 1;
    flex-shrink: 0;
}
.oby-intl-phone__item-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.oby-intl-phone__item-dial {
    color: #8a94a6;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
    font-size: 13px;
}
.oby-intl-phone__empty {
    padding: 18px 14px;
    text-align: center;
    color: #999;
    font-size: 13px;
}

.oby-modal__validation-summary {
    font-size: 13px;
    color: #e53e3e;
    font-weight: 600;
    margin-top: 10px;
    margin-bottom: 2px;
    display: none;
}

.oby-modal__validation-summary.oby-visible {
    display: block;
}

/* ─── Calculated Fields Section ─── */
.oby-modal__calc-section {
    margin-top: 4px;
    margin-bottom: 4px;
    padding: 12px 0 0;
    border-top: 1.5px dashed #e8ecf2;
}

.oby-modal__calc-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 10px;
    margin-bottom: 8px;
}

.oby-modal__calc-row:last-child {
    margin-bottom: 0;
}

.oby-modal__calc-label {
    font-size: 13px;
    font-weight: 600;
    color: #166534;
}

.oby-modal__calc-value {
    font-size: 17px;
    font-weight: 700;
    color: #0a7c42;
}

.oby-modal__currency {
    font-size: 12px;
    font-weight: 600;
    margin-right: 3px;
    opacity: 0.8;
}

/* ─── Dual Button Row (WhatsApp + Email) ─── */
.oby-modal__btn-row {
    display: flex;
    gap: 10px;
    margin-top: 22px;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), margin 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 2;
}

.oby-modal__btn-row.oby-btn-row--shifted {
    transform: translateY(8px);
    margin-bottom: 8px;
}

.oby-modal__submit {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    line-height: 1;
    text-align: center;
    transition: all .3s;
    box-shadow: none;
    border-style: solid;
    border-width: 0px;
    padding: 16px 32px;
    text-decoration: none;
    background-color: #C8A96E;
    font-family: "Work Sans", Sans-serif;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    font-style: normal;
    letter-spacing: 0.5px;
    fill: #000000;
    color: #000000;
    border-radius: 10px;
    cursor: pointer;
    width: 60%;
}

.oby-modal__submit svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* WhatsApp button */
.oby-modal__submit--wa {
    width: 60%;
}

.oby-modal__submit--wa:hover {
    opacity: 0.85;
    transform: translateY(-1px);
}

/* Email button */
.oby-modal__submit--email {
    width: 40%;
}

.oby-modal__submit--email:hover {
    opacity: 0.85;
    transform: translateY(-1px);
}

.oby-modal__submit:active {
    transform: none;
}

/* ─── Hidden Fields (Email) ─── */
.oby-modal__hidden-fields {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.45s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.35s ease 0.1s,
                padding 0.35s ease;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0 12px;
    position: relative;
    z-index: 1;
}

.oby-modal__hidden-fields.oby-revealed {
    max-height: 1200px;
    opacity: 1;
    padding: 16px 0 0;
    border-top: 1.5px dashed #dbeafe;
    margin-top: 4px;
}

/* Email button disabled state (during sending) */
.oby-modal__submit--email:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* ─── Email Success Message ─── */
.oby-email-success {
    text-align: center;
    padding: 40px 20px;
}

.oby-email-success svg {
    margin-bottom: 16px;
}

.oby-email-success h3 {
    font-size: 20px;
    font-weight: 800;
    color: #0d1b2a;
    margin: 0 0 8px;
}

.oby-email-success p {
    font-size: 14px;
    color: #666;
    margin: 0;
    line-height: 1.5;
}

/* ─── Error Display (shortcode errors) ─── */
p.oby-error {
    text-align: center;
    color: #dc3545;
    font-style: italic;
    padding: 20px;
}

/* ─── Responsive ─── */
@media (max-width: 480px) {
    .oby-modal {
        padding: 28px 20px 22px;
        border-radius: 14px;
    }

    .oby-inline-form {
        padding: 28px 20px 22px;
        border-radius: 14px;
    }

    .oby-modal__summary-item {
        width: 100% !important;
    }

    .oby-modal__field {
        width: 100% !important;
    }

    .oby-modal__title {
        font-size: 20px;
    }

    .oby-modal__submit {
        padding: 12px 8px;
        font-size: 13px;
        width: 100% !important;
    }

    .oby-modal__btn-row {
        flex-direction: column;
        gap: 8px;
    }
}
