.lp-rental-cal {
    user-select: none;
}

.lp-rental-cal-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    gap: 0.5rem;
}

.lp-rental-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.lp-rental-cal-head {
    text-align: center;
    font-size: 0.7rem;
    font-weight: 600;
    color: #6c757d;
    padding: 0.2rem 0;
}

.lp-rental-cal-empty {
    min-height: 2.1rem;
}

.lp-rental-cal-day {
    min-height: 2.35rem;
    border: 1px solid #e9ecef;
    background: #fff;
    border-radius: 0.4rem;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0;
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s;
    -webkit-tap-highlight-color: transparent;
}

.lp-rental-cal-day:hover:not(:disabled) {
    border-color: #0d6efd;
    background: #f0f6ff;
}

.lp-rental-cal-day.is-disabled,
.lp-rental-cal-day:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: #f1f3f5;
}

.lp-rental-cal-day.is-full {
    text-decoration: line-through;
    background: #e9ecef;
}

.lp-rental-cal-day.is-partial {
    box-shadow: inset 0 -3px 0 #ffc107;
}

.lp-rental-cal-day.is-in-range {
    background: #cfe2ff;
    border-color: #9ec5fe;
}

.lp-rental-cal-day.is-edge {
    background: #0d6efd;
    border-color: #0d6efd;
    color: #fff;
}

/* ----- Catalogue : grille de miniatures ----- */
.lp-rental-catalog {
    padding-bottom: 2.5rem;
    max-width: 1100px;
}

.lp-rental-catalog-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.85rem 1rem;
    margin-bottom: 1.15rem;
}

.lp-rental-catalog-title {
    font-size: clamp(1.35rem, 2.5vw, 1.75rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0 0 0.2rem;
    color: #1a1d21;
}

.lp-rental-catalog-count {
    margin: 0;
    font-size: 0.9rem;
    color: #6c757d;
}

.lp-rental-catalog-filters {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.5rem;
    flex: 1 1 220px;
    max-width: 360px;
}

.lp-rental-catalog-filters .form-control {
    min-width: 0;
    flex: 1;
}

.lp-rental-thumb-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
}

@media (min-width: 576px) {
    .lp-rental-thumb-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.85rem;
    }
}

@media (min-width: 992px) {
    .lp-rental-thumb-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 1rem;
    }
}

.lp-rental-thumb-wrap {
    min-width: 0;
}

.lp-rental-thumb {
    display: block;
    height: 100%;
    text-decoration: none;
    color: inherit;
    border: 1px solid #e5e7eb;
    border-radius: 0.65rem;
    overflow: hidden;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.lp-rental-thumb:hover {
    border-color: #93c5fd;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
    transform: translateY(-2px);
    color: inherit;
}

.lp-rental-thumb-media {
    aspect-ratio: 1;
    background: #eef1f4;
    overflow: hidden;
}

.lp-rental-thumb-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.lp-rental-thumb-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #adb5bd;
    font-size: 1.75rem;
}

.lp-rental-thumb-body {
    padding: 0.55rem 0.6rem 0.7rem;
    min-width: 0;
}

.lp-rental-thumb-price {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: #1a1d21;
    line-height: 1.2;
}

.lp-rental-thumb-title {
    margin: 0.25rem 0 0;
    font-size: 0.82rem;
    font-weight: 600;
    color: #495057;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.lp-rental-thumb-meta {
    margin: 0.25rem 0 0;
    font-size: 0.72rem;
    color: #868e96;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 399.98px) {
    .lp-rental-thumb-body {
        padding: 0.4rem 0.45rem 0.5rem;
    }

    .lp-rental-thumb-price {
        font-size: 0.82rem;
    }

    .lp-rental-thumb-title {
        font-size: 0.74rem;
    }

    .lp-rental-thumb-meta {
        display: none;
    }
}

html.dark-mode .lp-rental-catalog-title,
body.dark-mode .lp-rental-catalog-title {
    color: var(--lp-text, #e7eef8);
}

html.dark-mode .lp-rental-catalog-count,
body.dark-mode .lp-rental-catalog-count {
    color: var(--lp-muted, #8fa0b8);
}

html.dark-mode .lp-rental-thumb,
body.dark-mode .lp-rental-thumb {
    background: var(--lp-surface, #0e1729);
    border-color: var(--lp-border, #1c2c44);
}

html.dark-mode .lp-rental-thumb-media,
body.dark-mode .lp-rental-thumb-media {
    background: var(--lp-bg-soft, #080e1a);
}

html.dark-mode .lp-rental-thumb-price,
body.dark-mode .lp-rental-thumb-price {
    color: var(--lp-text, #e7eef8);
}

html.dark-mode .lp-rental-thumb-title,
body.dark-mode .lp-rental-thumb-title {
    color: var(--lp-muted, #8fa0b8);
}

html.dark-mode .lp-rental-thumb-meta,
body.dark-mode .lp-rental-thumb-meta {
    color: var(--lp-muted, #8fa0b8);
}

/* Anciennes cartes (service.php / embeds) */
.lp-rental-item-card {
    position: relative;
    display: grid;
    grid-template-columns: 1fr;
    border: 1px solid #e5e7eb;
    border-radius: 1rem;
    overflow: hidden;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.lp-rental-item-card-media {
    position: relative;
    aspect-ratio: 16 / 10;
    background: #eef1f4;
    overflow: hidden;
}

.lp-rental-item-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.lp-rental-item-card-body {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.95rem 1rem 1rem;
    min-width: 0;
}

.lp-rental-item-card-body h2 {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.3;
}

/* ----- Modal formulaire (responsive + scroll) ----- */
#rentalModal .modal-dialog {
    margin: 0.75rem auto;
    max-height: calc(100dvh - 1.5rem);
    display: flex;
}

#rentalModal .modal-content {
    border: 0;
    border-radius: 0.85rem;
    width: 100%;
    max-height: calc(100dvh - 1.5rem);
    display: flex;
    flex-direction: column;
    overflow: hidden; /* le scroll est dans .modal-body */
}

#rentalModal .modal-header {
    flex: 0 0 auto;
    padding: 0.85rem 1rem;
}

#rentalModal .modal-title {
    font-size: 1.05rem;
    line-height: 1.3;
}

#rentalModal .modal-body {
    flex: 1 1 auto;
    min-height: 0; /* indispensable pour autoriser le scroll flex */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 1rem;
}

#rentalModal form,
#rentalModal .lp-rental-modal-form {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    height: 100%;
}

#rentalModal .lp-rental-form-grid {
    display: grid;
    gap: 0.85rem;
}

#rentalModal .lp-rental-form-cal-wrap {
    border: 1px solid #e9ecef;
    border-radius: 0.65rem;
    padding: 0.65rem;
    background: #f8f9fa;
}

#rentalModal .lp-rental-form-contacts {
    display: grid;
    gap: 0.85rem;
}

#rentalModal .modal-footer {
    flex: 0 0 auto;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    position: static;
}

#rentalModal .modal-footer .btn {
    flex: 1 1 auto;
    min-width: 120px;
}

@media (min-width: 576px) {
    #rentalModal .lp-rental-form-contacts {
        grid-template-columns: 1fr 1fr;
    }

    #rentalModal .lp-rental-form-contacts .lp-rental-form-full {
        grid-column: 1 / -1;
    }
}

@media (min-width: 768px) {
    #rentalModal .modal-dialog {
        margin: 1.5rem auto;
        max-height: calc(100dvh - 3rem);
    }

    #rentalModal .modal-content {
        max-height: calc(100dvh - 3rem);
    }

    #rentalModal .lp-rental-form-grid {
        grid-template-columns: 1fr 1.15fr;
        align-items: start;
    }

    #rentalModal .lp-rental-form-main {
        grid-column: 1 / -1;
    }
}

@media (max-width: 575.98px) {
    .lp-rental-cal-day {
        min-height: 2.6rem;
        font-size: 0.9rem;
    }

    .lp-rental-cal-grid {
        gap: 3px;
    }

    #rentalModal .modal-dialog {
        max-width: 100%;
        width: 100%;
        height: 100%;
        max-height: 100dvh;
        margin: 0;
    }

    #rentalModal .modal-content {
        border-radius: 0;
        height: 100%;
        max-height: 100dvh;
        min-height: 0;
    }

    #rentalModal .modal-body {
        padding: 0.85rem;
        padding-bottom: 1.25rem;
    }

    #rentalModal .modal-footer {
        position: static;
        background: #fff;
        border-top: 1px solid #dee2e6;
        padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
    }
}

html.dark-mode .lp-rental-item-card,
body.dark-mode .lp-rental-item-card,
html.dark-mode .lp-rental-cal-day,
body.dark-mode .lp-rental-cal-day,
html.dark-mode #rentalModal .lp-rental-form-cal-wrap,
body.dark-mode #rentalModal .lp-rental-form-cal-wrap {
    background: var(--lp-surface, #0e1729);
    border-color: var(--lp-border, #1c2c44);
    color: var(--lp-text, #e7eef8);
}

html.dark-mode .lp-rental-item-card-media,
body.dark-mode .lp-rental-item-card-media {
    background: var(--lp-bg-soft, #080e1a);
}

html.dark-mode .lp-rental-cal-day.is-disabled,
body.dark-mode .lp-rental-cal-day.is-disabled {
    background: var(--lp-bg-soft, #080e1a);
}

html.dark-mode .lp-rental-cal-day.is-in-range,
body.dark-mode .lp-rental-cal-day.is-in-range {
    background: var(--lp-accent-soft, #132744);
}

html.dark-mode #rentalModal .modal-footer,
body.dark-mode #rentalModal .modal-footer {
    background: var(--lp-surface, #0e1729);
    border-color: var(--lp-border, #1c2c44);
}

html.dark-mode .lp-rental-item-card-badge,
body.dark-mode .lp-rental-item-card-badge {
    background: rgba(8, 14, 26, 0.92);
    color: var(--lp-text, #e7eef8);
}
