/*
 * wow.services.integration widget styles
 * ---------------------------------------
 * Compact modal booking form. Classes are namespaced with "wsi-" so
 * nothing collides with the Webflow theme. Sized to fit a typical
 * laptop viewport without page scroll behind the overlay.
 */

/* Full-screen dimmed backdrop that holds the modal.
 * This overlay is the scroll container so wheel/touch always
 * moves modal content, never the page behind it. */
.wsi-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 12px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    background: rgba(17, 24, 39, 0.55);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    opacity: 0;
    transition: opacity 0.2s ease;
}
.wsi-overlay.wsi-open { opacity: 1; }

/* Compact card. Grows with content; overlay scrolls when tall. */
.wsi-modal {
    width: 100%;
    max-width: 560px;
    margin: auto; /* vertically centres short modals while overlay scrolls */
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.22);
    font-family: inherit;
    color: #1f2937;
    overflow: visible;
    transform: translateY(8px);
    transition: transform 0.2s ease;
}
/* Wider booking modal on tablet/desktop. */
.wsi-modal.wsi-modal-lg {
    max-width: 820px;
}
/* Large desktops: room for calendar + form + vehicles in one row. */
@media (min-width: 1100px) {
    .wsi-modal.wsi-modal-lg {
        max-width: 1120px;
    }
}
.wsi-overlay.wsi-open .wsi-modal { transform: translateY(0); }

/* Form content — no nested scroll; the overlay handles scrolling. */
.wsi-body {
    padding: 12px 14px 6px;
    overflow: visible;
    flex: 0 0 auto;
}

/* Top row: calendar (left) + contact form (right). Stacks on small screens. */
.wsi-layout {
    display: grid;
    gap: 6px 14px;
}
@media (min-width: 700px) {
    .wsi-layout {
        grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
        align-items: start;
    }
}

/* Vehicle picker sits in its own full-width row under the top layout. */
.wsi-vehicles {
    margin-top: 4px;
    padding-top: 10px;
    border-top: 1px solid #e5e7eb;
}

/*
 * Desktop: put vehicles in a third column beside calendar + form so the
 * whole booking UI fits in the viewport without scrolling.
 */
@media (min-width: 1100px) {
    .wsi-overlay {
        align-items: center;
        padding: 20px;
    }

    .wsi-body {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr) minmax(260px, 0.95fr);
        grid-template-areas:
            "schedule schedule schedule"
            "layout   layout   cars";
        gap: 8px 18px;
        align-items: start;
        padding: 14px 18px 8px;
    }

    .wsi-schedule {
        grid-area: schedule;
        margin-bottom: 0;
    }

    /* Calendar + contact stay as a 2-col block spanning the first two areas. */
    .wsi-layout {
        grid-area: layout;
        gap: 6px 16px;
    }

    /* Vehicles column on the right — no top border, use a side divider. */
    .wsi-vehicles {
        grid-area: cars;
        margin-top: 0;
        padding-top: 0;
        padding-left: 16px;
        border-top: 0;
        border-left: 1px solid #e5e7eb;
        align-self: stretch;
    }

    /* 2×2 vehicle grid fits the side column without adding height. */
    .wsi-cars {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    /* Tall photo panel so cars are clearly visible in the side column. */
    .wsi-car-media {
        height: 120px;
    }

    .wsi-footer {
        padding: 10px 18px 14px;
    }

    /* No vehicles column: let calendar + form use the full width. */
    .wsi-body:not(:has(.wsi-vehicles)) {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
        grid-template-areas:
            "schedule schedule"
            "layout   layout";
    }
}

/* Start time + duration chips at the top of the form. */
.wsi-schedule {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}
.wsi-chip {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 88px;
    padding: 6px 10px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
}
.wsi-chip-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #166534;
}
.wsi-chip strong {
    font-size: 13px;
    color: #0f5132;
}

/* Vehicle cards — large photo as background, details underneath. */
.wsi-cars-wrap { width: 100%; }
.wsi-cars {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}
/* Four across when vehicles sit in a full-width row (tablet / small desktop). */
@media (min-width: 700px) and (max-width: 1099px) {
    .wsi-cars {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}
.wsi-car {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    text-align: left;
    padding: 0;
    margin: 0;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    overflow: hidden;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.05s ease;
    font: inherit;
    color: inherit;
}
.wsi-car:hover {
    border-color: #86efac;
    box-shadow: 0 2px 8px rgba(15, 81, 50, 0.08);
}
.wsi-car:active { transform: scale(0.98); }
.wsi-car-selected {
    border-color: #0f5132;
    box-shadow: 0 0 0 2px rgba(15, 81, 50, 0.2);
}

/* Large background photo area — enough height for the vehicle to read. */
.wsi-car-media {
    width: 100%;
    height: 110px;
    background-color: #f3f4f6;
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
    border-bottom: 1px solid #f3f4f6;
}
.wsi-car-img-ph {
    background-image:
        linear-gradient(135deg, #f3f4f6 25%, #e5e7eb 25%, #e5e7eb 50%, #f3f4f6 50%, #f3f4f6 75%, #e5e7eb 75%);
    background-size: 16px 16px;
}
.wsi-car-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 10px 10px;
    background: #fff;
}
.wsi-car-selected .wsi-car-info {
    background: #f7fdf9;
}
.wsi-car-name {
    font-size: 12px;
    font-weight: 600;
    color: #111827;
    line-height: 1.25;
}
.wsi-car-meta {
    font-size: 11px;
    color: #6b7280;
}
.wsi-car-price {
    margin-top: 2px;
    font-size: 13px;
    font-weight: 700;
    color: #0f5132;
}

.wsi-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 0 0 auto;
    padding: 10px 14px;
    background: #0f5132; /* deep green to match the Armonia brand */
    color: #ffffff;
}
.wsi-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    padding-right: 8px;
}
.wsi-close {
    border: 0;
    background: transparent;
    color: #ffffff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 0 2px;
}

/* Each labelled field — tight spacing so the whole form fits. */
.wsi-field { margin-bottom: 8px; }
.wsi-field label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 3px;
    color: #374151;
}
/* Small helper under a field (e.g. client-selected start time hint). */
.wsi-hint {
    margin: -4px 0 8px;
    font-size: 11px;
    line-height: 1.3;
    color: #6b7280;
}
.wsi-field input,
.wsi-field select,
.wsi-field textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 7px 9px;
    font-size: 13px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    color: #1f2937;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.wsi-field input:focus,
.wsi-field select:focus,
.wsi-field textarea:focus {
    border-color: #0f5132;
    box-shadow: 0 0 0 2px rgba(15, 81, 50, 0.15);
}
.wsi-field textarea {
    resize: vertical;
    min-height: 40px;
}

/* Two fields side by side (e.g. adults / children). */
.wsi-row { display: flex; gap: 8px; }
.wsi-row .wsi-field { flex: 1; }

/* ---- availability calendar ---------------------------------------- */
.wsi-cal {
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 6px 8px 8px;
    background: #fff;
    user-select: none;
}
/* Month title + prev/next navigation. */
.wsi-cal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}
.wsi-cal-title {
    font-size: 12px;
    font-weight: 600;
    color: #111827;
    text-transform: capitalize;
}
.wsi-cal-nav {
    width: 24px;
    height: 24px;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1;
    color: #374151;
    cursor: pointer;
    transition: background 0.15s ease;
}
.wsi-cal-nav:hover:not(:disabled) { background: #eef2f0; }
.wsi-cal-nav:disabled { opacity: 0.35; cursor: default; }

/* Weekday header row. */
.wsi-cal-dow {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    margin-bottom: 2px;
}
.wsi-cal-dow span {
    text-align: center;
    font-size: 9px;
    font-weight: 600;
    color: #9ca3af;
    padding: 1px 0;
}

/* The 7-column day grid. */
.wsi-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}
.wsi-cal-cell {
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    border-radius: 5px;
}
.wsi-cal-empty { visibility: hidden; }

/* Days with no availability: shown but not selectable. */
.wsi-cal-disabled {
    color: #d1d5db;
    text-decoration: line-through;
}
/* Bookable days. */
.wsi-cal-avail {
    color: #0f5132;
    font-weight: 600;
    cursor: pointer;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    transition: background 0.15s ease, transform 0.05s ease;
}
.wsi-cal-avail:hover { background: #dcfce7; }
.wsi-cal-avail:active { transform: scale(0.94); }
/* The currently selected day. */
.wsi-cal-selected {
    background: #0f5132;
    border-color: #0f5132;
    color: #fff;
}
.wsi-cal-selected:hover { background: #0b3d26; }

/* Confirm button shows the live total inline: "Confirm booking · €480.00". */
.wsi-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: #0f5132;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s ease;
}
.wsi-submit:hover { background: #0b3d26; }
.wsi-submit:disabled { opacity: 0.6; cursor: not-allowed; }
.wsi-submit-sep {
    opacity: 0.55;
    font-weight: 400;
}
.wsi-submit-price {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.wsi-footer {
    flex: 0 0 auto;
    padding: 8px 14px 12px;
    border-top: 1px solid #f3f4f6;
    background: #fff;
}

/* Small status / error message under the button. */
.wsi-message {
    margin-top: 6px;
    font-size: 12px;
    text-align: center;
    min-height: 14px;
}
.wsi-message.wsi-error { color: #b91c1c; }
.wsi-message.wsi-ok { color: #166534; }

/* Simple loading + success states. */
.wsi-state {
    padding: 28px 16px;
    text-align: center;
    color: #4b5563;
    font-size: 14px;
}
.wsi-state h3 { color: #166534; margin: 0 0 6px; font-size: 16px; }
.wsi-ref {
    display: inline-block;
    margin-top: 6px;
    padding: 4px 10px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 6px;
    font-weight: 700;
    color: #166534;
    letter-spacing: 0.5px;
}

/* Small spinner used while data loads. */
.wsi-spinner {
    width: 28px;
    height: 28px;
    margin: 0 auto 10px;
    border: 3px solid #e5e7eb;
    border-top-color: #0f5132;
    border-radius: 50%;
    animation: wsi-spin 0.8s linear infinite;
}
@keyframes wsi-spin { to { transform: rotate(360deg); } }

@media (max-width: 520px) {
    .wsi-row { flex-direction: column; gap: 0; }
    .wsi-overlay { padding: 8px; }
}
