/* Image fit overrides.
   The original Drupal theme relied on image-style derivatives (pre-sized
   270x270, 336x230, etc.). We serve full-size originals from storage, so fit
   them into their containers and crop with object-fit instead of the legacy
   absolute-centering hack that assumed small source images. */

.category__image img,
.rent__image img {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    transform: none !important;
    object-fit: cover;
    object-position: center;
}

/* Gallery slides: keep aspect ratio, fill carousel width. */
.jcarousel-img img {
    display: block;
    width: 100%;
    height: auto;
}

/* Banner slides already use background-size:cover; just ensure the box crops. */
.slide {
    background-size: cover;
    background-position: center center;
}

/* Booking modal: native controls styling (kept free of legacy SelectFx). */
.booking-resource,
#booking-date,
#booking-time {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1px solid #e2d5c5;
    background: #fff;
    font-size: 16px;
    border-radius: 4px;
    margin-bottom: 8px;
}

/* Keep the two card buttons on one line. */
.rent__link {
    white-space: nowrap;
}

/* Field labels (replicates Drupal field.css — bold, inline label + value). */
.field { margin-bottom: 12px; }
.field-label {
    font-weight: bold;
    display: inline-block;
    padding-right: 0.4em;
}
.field-label-inline .field-items,
.field-label-inline-cleanfix .field-items { display: inline; }

/* Breadcrumb spacing. */
.breadcrumb { padding: 8px 0; font-size: 14px; }
.breadcrumb a { margin-right: 2px; }

/* Object page gallery: a self-contained 700x400 carousel (arrows + counter),
   independent of the legacy jcarousel. The outer .jcarousel-imgs__wrap keeps
   the original float-left + max-width so .rent__chr floats beside it. */
.object-gallery {
    position: relative;
    overflow: hidden;
    max-height: 400px;
}
.object-gallery__track {
    display: flex;
    height: 400px;
    transition: transform 0.4s ease;
}
.object-gallery__slide {
    flex: 0 0 100%;
    height: 400px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.object-gallery__slide img {
    max-width: 100%;
    max-height: 400px;
    width: auto;
    height: auto;
    display: block;
    background: #f5f0e8;
}

/* Lightbox */
.object-lightbox {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0,0,0,.92);
    display: flex;
    align-items: center;
    justify-content: center;
}
.object-lightbox img {
    max-width: 85vw;
    max-height: 85vh;
    object-fit: contain;
}
.object-lightbox__close {
    position: absolute;
    top: 16px;
    right: 24px;
    font-size: 36px;
    color: #fff;
    cursor: pointer;
    z-index: 2;
    line-height: 1;
}
.object-lightbox__counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 14px;
    z-index: 2;
}
.object-lightbox__arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,.15);
    color: #fff;
    border: none;
    width: 48px;
    height: 48px;
    font-size: 28px;
    cursor: pointer;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
}
.object-lightbox__arrow:hover {
    background: rgba(255,255,255,.3);
}
.object-lightbox__arrow--prev { left: 20px; }
.object-lightbox__arrow--next { right: 20px; }
.object-gallery__arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    border: none;
    width: 40px;
    height: 40px;
    font-size: 24px;
    line-height: 36px;
    text-align: center;
    cursor: pointer;
    border-radius: 50%;
    z-index: 2;
}
.object-gallery__arrow:hover {
    background: rgba(0, 0, 0, 0.7);
}
.object-gallery__arrow--prev { left: 8px; }
.object-gallery__arrow--next { right: 8px; }
.object-gallery__counter {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 13px;
    z-index: 2;
}

/* Always center popups/modals on screen. */
.modals.active {
    display: flex !important;
    align-items: center;
    justify-content: center;
}
.modals #block-block-4,
.modals #block-webform-client-block-13 {
    margin: 0 auto !important;
    max-height: 90vh;
    overflow-y: auto;
}

/* Keep the modal overlay pinned to the viewport (centered on screen). */
.modals {
    position: fixed !important;
}

/* The modals wrapper must stay full-width so the inner blocks keep their
   original max-width (map 530px, booking form) and center via margin:auto. */
.modals .region-modals {
    width: 100%;
    flex: 0 0 100%;
}

/* Booking form (BEM) */
.booking-form__field {
    margin-bottom: 16px;
}
.booking-form__row {
    display: flex;
    gap: 16px;
}
.booking-form__row .booking-form__field {
    flex: 1;
    min-width: 0;
}
@media (max-width: 600px) {
    .booking-form__row {
        flex-direction: column;
    }
}
.booking-form__label {
    display: block !important;
    font-size: 14px;
    margin-bottom: 4px;
    width: auto !important;
    font-weight: normal;
}
.booking-form__select,
.booking-form__input {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1px dotted #6b4832;
    background: #fff;
    font-size: 16px;
    height: auto !important;
    border-radius: 0 !important;
    max-width: none;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
}
.booking-form__select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236bbd00' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 10px center !important;
    background-size: 18px !important;
    padding-right: 36px !important;
    cursor: pointer;
}
.booking-form__textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1px dotted #6b4832;
    background: #fff;
    font-size: 16px;
    height: 100px !important;
    border-radius: 0 !important;
    max-width: none;
}
.booking-form__messages {
    margin-bottom: 16px;
    font-size: 14px;
}
.booking-form__messages--status { color: #166534; }
.booking-form__messages--error { color: #991b1b; }
.booking-form__messages--error p { margin: 0; }
.booking-form__honeypot { position: absolute; left: -9999px; top: -9999px; }
.booking-form__turnstile { margin-bottom: 16px; }
.booking-form__consent { margin-bottom: 16px; width: 100%; }
.booking-form__consent-label {
    display: flex !important;
    align-items: flex-start;
    gap: 10px;
    font-size: 12px;
    color: #666;
    cursor: pointer;
    width: 100% !important;
}
#webform-client-form-13 .booking-form__consent-label input[type="checkbox"] {
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    flex-shrink: 0;
    width: 20px !important;
    height: 20px !important;
    min-width: 20px;
    border: 2px solid #6bbd00 !important;
    background: #fff !important;
    cursor: pointer;
    position: relative;
    margin: 0;
    padding: 0;
    outline: none;
}
#webform-client-form-13 .booking-form__consent-label input[type="checkbox"]:checked {
    background: #6bbd00 !important;
}
#webform-client-form-13 .booking-form__consent-label input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 0px;
    width: 6px;
    height: 12px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
.booking-form__consent-label span {
    flex: 1;
    line-height: 1.5;
}
.booking-form__actions { text-align: center; }
.booking-form__submit {
    padding: 12px 32px;
    border: none;
    background: #6bbd00;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 0 !important;
    text-transform: uppercase;
}
.booking-form__submit:hover { background: #5a9e00; }

/* Booking schedule (BEM) */
.booking-schedule {
    display: flex !important;
    gap: 5%;
    margin-bottom: 20px;
}
.booking-schedule__date { flex: 0 0 65%; }
.booking-schedule__time {
    flex: 0 0 30%;
    display: flex !important;
    flex-direction: column;
    gap: 12px;
}
.booking-schedule__label {
    display: block !important;
    font-size: 14px;
    margin-bottom: 4px;
    width: auto !important;
    font-weight: normal;
}
.booking-schedule__input,
.booking-schedule__select {
    width: 100%;
    padding: 8px 32px 8px 12px;
    border: 1px solid #e8e8e8;
    background-color: #e8e8e8;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b4832' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 16px;
    box-sizing: border-box;
    height: auto !important;
    border-radius: 0 !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    cursor: pointer;
    font-size: 14px;
    color: #333;
}

/* Booking availability */
.booking-availability {
    padding: 10px 14px;
    border-radius: 0 !important;
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
}
.booking-availability--busy {
    background: #fee2e2;
    border: 1px solid #f87171;
    color: #991b1b;
}
.booking-availability--free {
    background: #dcfce7;
    border: 1px solid #4ade80;
    color: #166534;
}
.booking-availability__busy { font-weight: 500; }
