.ff-reservation-widget {
    margin: 20px 0;
    padding: 20px;
    border: 1px solid #ccc;
    background: #f9f9f9;
}

.ff-res-form-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.ff-res-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.ff-res-form input[type="text"],
.ff-res-form select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 0;
}

.ff-res-form-submit {
    padding: 10px 20px;
    border: none;
    border-radius: 0;
    cursor: pointer;
    font-weight: bold;
    margin-top: 10px;
}

.ff-res-form-submit[disabled] {
    opacity: 0.25;
    cursor: not-allowed;
    pointer-events: none;
}

.ff-res-form-submit.loading {
    opacity: 0.7;
    cursor: not-allowed;
}

.ff-res-form-submit .fa-spin {
    display: none;
    margin-left: 10px;
}

.ff-res-form-submit.loading .fa-spin {
    display: inline-block;
}

.ff-checkbox-container {
    margin-top: 10px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.ff-checkbox-container input[type="checkbox"] {
    margin-top: 5px;
    margin-right: 10px;
}

.ff-checkbox-container label {
    margin-bottom: 0;
    line-height: 1.4;
}

.ff-res-errors {
    color: #d63638;
    margin-top: 10px;
    font-weight: bold;
}

.ff-res-first, .ff-res-list {
    margin-top: 20px;
}

.ff-res-other-title {
    margin-top: 30px;
    margin-bottom: 20px;
    font-size: 28px;
    font-weight: 700;
    text-transform: uppercase;
}


/* Experience Item Grid Layout */
.ff-experience-item {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 30px;
    padding: 30px 0;
    border-top: 1px solid #eee;
    margin-top: 20px;
    align-items: start;
}

.ff-experience-image img {
    width: 100%;
    height: auto;
    display: block;
}

.ff-experience-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.ff-experience-title {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    text-transform: uppercase;
}

.ff-experience-price {
    font-size: 24px;
    font-weight: 700;
}

.ff-experience-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.ff-experience-body.no-description {
    grid-template-columns: 1fr;
}

/* Date, time and guest fields moved into the main experience card */
.ff-res-controls-pending {
    min-height: 120px;
}

.ff-res-controls-pending .ff-res-controls {
    display: none;
}

.ff-res-controls-in-card .ff-res-first {
    margin-top: 0;
}

.ff-res-controls-in-card .ff-res-first .ff-experience-main {
    border-top: 0;
    margin-top: 0;
    padding: 0;
}

.ff-res-form-slot {
    container-type: inline-size;
    container-name: ffresformslot;
}

.ff-res-form-slot .ff-res-controls {
    margin-bottom: 20px;
}

/* Date fills the row beside time and guests at their natural width; it takes its own row when they don't fit. */
.ff-res-form-slot .ff-res-form-fields {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 10px;
}

@container ffresformslot (width < 18em) {
    .ff-res-form-slot .ff-res-form-fields {
        grid-template-columns: 1fr 1fr;
    }

    .ff-res-form-slot .ff-res-form-date {
        grid-column: 1 / -1;
    }
}

.ff-res-form-slot .ff-res-form-submit {
    width: 100%;
}

.ff-experience-desc {
    font-size: 16px;
    line-height: 1.6;
}

.ff-experience-desc p:first-child {
    margin-top: 0;
}

.ff-experience-desc p:last-child {
    margin-bottom: 0;
}

.ff-closest-times {
    display: block;
    margin-bottom: 15px;
    font-weight: 600;
    font-size: 14px;
}

.ff-res-options {
    border: 0;
    padding: 0;
    margin: 0 0 20px;
    min-width: 0;
}

.ff-res-options legend {
    padding: 0;
    margin-bottom: 10px;
    font-weight: 600;
    font-size: 14px;
}

.ff-res-options .ff-res-option {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 6px;
    font-weight: normal;
    cursor: pointer;
}

.ff-res-options .ff-res-option-input {
    margin: 0;
}

.ff-res-option-price {
    opacity: 0.7;
}

.ff-reservation-btns {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
}

.ff-res-list  .ff-experience-times {
    container-type: inline-size;
    container-name: otherexptimes;
}

@container otherexptimes (width < 300px) {
    .ff-res-list  .ff-reservation-btns {
        grid-template-columns: 1fr 1fr;
    }
}

.ff-reservation-btns .button {
    border: none; 
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    cursor: pointer;
    transition: background-color 0.2s;
}

.ff-reservation-btns .button .fa-spin {
    margin-right: 5px;
    display: none;
}

.ff-reservation-btns .button.loading .fa-spin {
    display: inline-block;
}

.ff-experience-item.no-image {
    grid-template-columns: 1fr;
    padding: 20px 0;
}

@media (max-width: 768px) {
    .ff-experience-item {
        grid-template-columns: 1fr;
    }
    
    .ff-experience-body {
        grid-template-columns: 1fr;
    }
}

.loading-times {
    position: relative;
    opacity: 0.6;
}

/* Custom Popup for noTimesPassed */
.ff-reservation-widget {
    position: relative;
    container-type: inline-size;
    container-name: reswidget;
}

.ff-res-popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    text-align: center;
    padding: 20px;
    box-sizing: border-box;
}

.ff-res-popup-content {
    max-width: 100%;
}

.ff-res-popup-text {
    font-size: 16px;
    margin-bottom: 20px;
    color: #333;
    line-height: 1.5;
}

.ff-res-popup-btns {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.ff-res-popup-btns .button {
    padding: 10px 20px;
    cursor: pointer;
    font-weight: bold;
    border: none;
    text-transform: uppercase;
}

.ff-res-popup-btn-cancel {
    background: #eee;
    color: #333;
}

.ff-res-popup-btn-continue {
    background: #0073aa;
    color: #fff;
}

/* Loading state for the entire widget */
.ff-reservation-widget.ff-loading {
    position: relative;
    pointer-events: none;
}

.ff-reservation-widget.ff-loading::before,
.ff-reservation-widget.ff-loading::after {
    opacity: 1;
}

.ff-reservation-widget::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.7);
    z-index: 99;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
}

.ff-reservation-widget::before {
    content: "\f110"; /* fa-spinner / fa-circle-notch fallback */
    font-family: "Font Awesome 5 Free", "Font Awesome 6 Free", sans-serif;
    font-weight: 900;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 100;
    font-size: 30px;
    color: #0073aa;
    animation: ff-spin 1s linear infinite;
    pointer-events: none;
    opacity: 0;
}

@keyframes ff-spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}
