/* =========================================================
   HBS GARAGE 2026 · Galerie, Gerätedetail, Kalender,
   Lightbox und Bilderverwaltung
   ========================================================= */


/* ---------------------------------------------------------
   1. Gemeinsame Bilder
   --------------------------------------------------------- */

.item-card-image {
    position: relative;
    width: 100%;
    height: 220px;
    overflow: hidden;
    background: var(--color-surface-muted, #eef1eb);
}

.item-image {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center;
}


/* =========================================================
   BILDVERWALTUNG IM WIZARD
   ========================================================= */


/* ---------------------------------------------------------
   2. Vorhandene Bilder
   --------------------------------------------------------- */

.existing-images,
.item-existing-images {
    margin-bottom: 1.4rem;
}

.existing-images-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.existing-images-heading h2,
.existing-images-heading h3 {
    margin: 0;
    font-size: 1.05rem;
}

.existing-images-heading p {
    margin: 0.25rem 0 0;
    color: var(--color-text-muted, #67736b);
    font-size: 0.8rem;
    line-height: 1.45;
}

.existing-images-heading > span {
    flex: 0 0 auto;
    color: var(--color-text-muted, #67736b);
    font-size: 0.78rem;
}


/* ---------------------------------------------------------
   3. Bilderraster
   --------------------------------------------------------- */

.image-management-grid {
    display: grid;
    grid-template-columns:
        repeat(auto-fill, minmax(170px, 1fr));
    gap: 0.8rem;
}

.managed-image {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--color-border, #e9e5dc);
    border-radius: 15px;
    background: var(--color-surface, #ffffff);
    box-shadow: var(--shadow-small, 0 4px 14px rgba(0,0,0,.05));
    cursor: grab;

    transition:
        opacity 160ms ease,
        transform 160ms ease,
        box-shadow 160ms ease;
}

.managed-image:active {
    cursor: grabbing;
}

.managed-image.is-dragging {
    opacity: 0.45;
    transform: scale(0.97);
    box-shadow: var(--shadow-medium, 0 12px 30px rgba(0,0,0,.12));
}

.managed-image-preview {
    position: relative;
}

.managed-image-preview img {
    width: 100%;
    height: 170px;
    display: block;
    object-fit: cover;
    background: var(--color-surface-muted, #f7f8f3);
}

.cover-image-badge {
    position: absolute;
    top: 0.65rem;
    left: 0.65rem;
    z-index: 2;

    margin: 0;
    padding: 0.3rem 0.6rem;

    border-radius: 999px;

    background: var(--color-primary, #0b4a2b);
    color: #ffffff;

    font-size: 0.7rem;
    font-weight: 800;
}

.image-drag-handle {
    position: absolute;
    top: 0.6rem;
    right: 0.6rem;
    z-index: 3;

    width: 34px;
    height: 34px;

    display: grid;
    place-items: center;

    border: 1px solid rgba(255,255,255,.65);
    border-radius: 10px;

    background: rgba(18,31,22,.76);
    color: #ffffff;

    font-size: 1rem;
    font-weight: 800;
    line-height: 1;

    cursor: grab;
}

.image-drag-handle:active {
    cursor: grabbing;
}

.managed-image-actions {
    display: grid;
    gap: 0.45rem;
    padding: 0.7rem;
}

.managed-image-actions form {
    margin: 0;
    padding: 0;
}

.image-action-button {
    width: 100%;
    min-height: 36px;
    padding: 0.45rem 0.6rem;

    font-size: 0.74rem;
}

.managed-image-rotate-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.4rem;
}

.image-order-status {
    min-height: 1.4em;
    margin: 0.7rem 0 0;

    color: var(--color-primary, #0b4a2b);

    font-size: 0.78rem;
}

.image-order-status.error {
    color: var(--color-danger, #a33);
}


/* =========================================================
   GERÄTEDETAIL · 2026 REDESIGN
   ========================================================= */

.item-detail-page {
    display: grid;
    gap: 18px;
    padding: 8px 0 48px;
}

.item-detail-back {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    gap: 7px;
    color: #38604a;
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
}

.item-detail-back:hover {
    color: #075d37;
}


/* ---------- Hauptlayout ---------- */

.item-detail-layout {
    display: grid;
    grid-template-columns:
        minmax(0, 1.35fr)
        minmax(330px, .75fr);
    gap: 20px;
    align-items: start;
}


/* ---------- Galerie ---------- */

.item-detail-gallery {
    min-width: 0;
    display: grid;
    gap: 9px;
}

.item-main-image {
    width: 100%;
    overflow: hidden;
    border: 1px solid #e1e8e3;
    border-radius: 22px;
    background: #f4f7f3;
    box-shadow: 0 10px 32px rgba(27,54,38,.045);
}

.item-main-image-button {
    position: relative;
    width: 100%;
    display: block;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: zoom-in;
}

.item-detail-image {
    width: 100%;
    height: clamp(430px, 55vw, 650px);
    display: block;
    object-fit: contain;
    object-position: center;
    background:
        radial-gradient(
            circle at 50% 30%,
            rgba(231,241,233,.7),
            transparent 50%
        ),
        #f5f7f4;
}

.item-detail-placeholder {
    min-height: clamp(430px, 55vw, 650px);
    display: grid;
    place-items: center;
    border: 1px solid #e1e8e3;
    border-radius: 22px;
    background:
        linear-gradient(
            135deg,
            #e8f2e8,
            #f6f8f5
        );
    font-size: clamp(4.5rem, 9vw, 7rem);
}

.image-zoom-hint {
    position: absolute;
    right: 13px;
    bottom: 13px;
    padding: 7px 10px;
    border-radius: 999px;
    background: rgba(18,31,22,.78);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    opacity: 0;
    transform: translateY(3px);
    transition:
        opacity 160ms ease,
        transform 160ms ease;
}

.item-main-image-button:hover .image-zoom-hint,
.item-main-image-button:focus-visible .image-zoom-hint {
    opacity: 1;
    transform: translateY(0);
}

.item-thumbnails {
    display: flex;
    gap: 7px;
    overflow-x: auto;
    padding: 1px 0 3px;
    scrollbar-width: thin;
}

.thumbnail-button {
    width: 76px;
    height: 61px;
    flex: 0 0 76px;
    padding: 0;
    overflow: hidden;
    border: 2px solid transparent;
    border-radius: 11px;
    background: #fff;
    cursor: pointer;
}

.thumbnail-button:hover {
    border-color: #c9d8cc;
}

.thumbnail-button.is-active {
    border-color: #286945;
}

.thumbnail-button img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}


/* ---------- Infokarte ---------- */

.item-detail-content {
    position: sticky;
    top: calc(var(--header-height, 74px) + 16px);
    padding: 25px;
    border: 1px solid #e1e8e3;
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 10px 32px rgba(27,54,38,.045);
}

.item-detail-topline {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
}

.item-detail-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 9px;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 900;
}

.item-detail-status > span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.item-detail-status.is-available {
    background: #eaf4e8;
    color: #246a40;
}

.item-detail-status.is-unavailable {
    background: #f7ecec;
    color: #995151;
}

.item-detail-title .eyebrow {
    margin-bottom: 6px;
}

.item-detail-title h1 {
    margin: 0;
    color: #152a20;
    font-size: clamp(34px, 4vw, 49px);
    line-height: 1.03;
    letter-spacing: -.045em;
}


/* ---------- Besitzer ---------- */

.item-detail-owner {
    display: grid;
    grid-template-columns: 43px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    margin-top: 19px;
    padding: 11px;
    border: 1px solid #e4eae5;
    border-radius: 14px;
    background: #fafcfa;
}

.item-detail-owner-avatar {
    width: 43px;
    height: 43px;
    display: grid;
    overflow: hidden;
    place-items: center;
    border-radius: 50%;
    background: #e7f2e7;
    color: #17633b;
    font-size: 13px;
    font-weight: 900;
}

.item-detail-owner-avatar img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.item-detail-owner-copy {
    display: grid;
    min-width: 0;
}

.item-detail-owner-copy small {
    color: #7d8981;
    font-size: 9px;
}

.item-detail-owner-copy strong {
    overflow: hidden;
    margin-top: 1px;
    color: #31483a;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.item-detail-owner-copy span {
    margin-top: 1px;
    color: #8b958f;
    font-size: 9px;
}


/* ---------- Beschreibung ---------- */

.item-detail-description {
    margin-top: 23px;
    padding-top: 20px;
    border-top: 1px solid #edf0ee;
}

.item-detail-section-label {
    display: block;
    color: #34714b;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.item-detail-description p {
    margin: 8px 0 0;
    color: #46574e;
    font-size: 13px;
    line-height: 1.65;
    white-space: pre-line;
}

.item-detail-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 19px;
}

.item-detail-fact {
    display: grid;
    grid-template-columns: 33px minmax(0, 1fr);
    gap: 8px;
    align-items: center;
    min-width: 0;
    padding: 9px;
    border: 1px solid #e6ebe7;
    border-radius: 12px;
}

.item-detail-fact-icon {
    display: grid;
    width: 33px;
    height: 33px;
    place-items: center;
    border-radius: 9px;
    background: #edf5eb;
    color: #34704a;
    font-size: 11px;
    font-weight: 900;
}

.item-detail-fact small,
.item-detail-fact strong {
    display: block;
}

.item-detail-fact small {
    color: #89938d;
    font-size: 8px;
}

.item-detail-fact strong {
    overflow: hidden;
    margin-top: 1px;
    color: #34483c;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}


/* ---------- Eigentümeraktionen ---------- */

.item-detail-owner-actions {
    display: grid;
    gap: 10px;
    margin-top: 19px;
    padding-top: 17px;
    border-top: 1px solid #edf0ee;
}

.item-detail-owner-actions-copy strong,
.item-detail-owner-actions-copy small {
    display: block;
}

.item-detail-owner-actions-copy strong {
    color: #34483c;
    font-size: 11px;
}

.item-detail-owner-actions-copy small {
    margin-top: 2px;
    color: #818d85;
    font-size: 9px;
}

.item-detail-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
}

.item-detail-actions form,
.item-detail-actions .btn {
    width: 100%;
    margin: 0;
}


/* =========================================================
   AUSLEIHPROZESS
   ========================================================= */

.item-borrow-section {
    padding: clamp(20px, 3vw, 29px);
    border: 1px solid #dfe7e1;
    border-radius: 22px;
    background:
        linear-gradient(
            135deg,
            #f5f9f4,
            #fff
        );
    box-shadow: 0 10px 32px rgba(27,54,38,.04);
}

.item-borrow-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 20px;
    margin-bottom: 18px;
}

.item-borrow-heading h2 {
    margin: 4px 0 0;
    color: #172d21;
    font-size: clamp(25px, 3vw, 35px);
    letter-spacing: -.035em;
}

.item-borrow-heading p {
    max-width: 650px;
    margin: 6px 0 0;
    color: #718078;
    font-size: 11px;
    line-height: 1.5;
}

.item-borrow-steps {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.item-borrow-step {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 8px;
    border: 1px solid #e0e7e2;
    border-radius: 999px;
    background: #fff;
    color: #77837c;
    font-size: 9px;
    font-weight: 800;
}

.item-borrow-step span {
    display: grid;
    width: 19px;
    height: 19px;
    place-items: center;
    border-radius: 50%;
    background: #f1f4f1;
    font-size: 8px;
}

.item-borrow-step.is-active {
    border-color: #c8ddcc;
    background: #eaf4e8;
    color: #286a43;
}

.item-borrow-layout {
    display: grid;
    grid-template-columns:
        minmax(0, 1.08fr)
        minmax(330px, .92fr);
    gap: 10px;
}


/* ---------- Kalender und Formular ---------- */

.availability-panel,
.booking-panel {
    margin: 0;
    padding: 16px;
    border: 1px solid #e2e8e3;
    border-radius: 17px;
    background: #fff;
    box-shadow: none;
}

.availability-panel {
    display: grid;
    gap: 13px;
}

.availability-intro h2,
.availability-intro h3,
.booking-panel-intro h2,
.booking-panel-intro h3 {
    margin: 5px 0 0;
    color: #2b4135;
    font-size: 15px;
}

.availability-intro p,
.booking-panel-intro p {
    margin: 4px 0 0;
    color: #7a867f;
    font-size: 10px;
    line-height: 1.45;
}

.item-borrow-number {
    display: grid;
    width: 27px;
    height: 27px;
    place-items: center;
    border-radius: 8px;
    background: #eaf4e8;
    color: #286a43;
    font-size: 9px;
    font-weight: 900;
}

.availability-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 10px;
    color: #748078;
    font-size: 9px;
}

.availability-legend span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.legend-dot {
    width: 8px;
    height: 8px;
    display: inline-block;
    border-radius: 50%;
}

.legend-dot.available {
    border: 1px solid #cfd8d1;
    background: #fff;
}

.legend-dot.booked {
    background: #e2abab;
}

.legend-dot.selected {
    background: #286a43;
}


/* ---------- Kalender ---------- */

.availability-calendar {
    padding: 12px;
    border: 1px solid #e5eae6;
    border-radius: 14px;
    background: #f8faf8;
}

.calendar-toolbar {
    display: grid;
    grid-template-columns: 35px 1fr 35px;
    gap: 7px;
    align-items: center;
    margin-bottom: 10px;
}

.calendar-toolbar h3 {
    margin: 0;
    color: #33483c;
    font-size: 12px;
    text-align: center;
    text-transform: capitalize;
}

.calendar-navigation {
    display: grid;
    width: 35px;
    height: 35px;
    padding: 0;
    place-items: center;
    border: 1px solid #e0e6e1;
    border-radius: 9px;
    background: #fff;
    color: #34483c;
    font-size: 19px;
    cursor: pointer;
}

.calendar-navigation:hover:not(:disabled) {
    border-color: #8eb99a;
}

.calendar-navigation:disabled {
    opacity: .3;
    cursor: not-allowed;
}

.calendar-weekdays,
.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 4px;
}

.calendar-weekdays {
    margin-bottom: 4px;
    color: #849088;
    font-size: 8px;
    font-weight: 850;
    text-align: center;
    text-transform: uppercase;
}

.calendar-day {
    position: relative;
    display: grid;
    min-height: 37px;
    aspect-ratio: 1;
    padding: 0;
    place-items: center;
    border: 1px solid transparent;
    border-radius: 9px;
    background: #fff;
    color: #34473c;
    font: inherit;
    font-size: 10px;
    font-weight: 750;
    cursor: pointer;
}

.calendar-day:hover:not(:disabled) {
    border-color: #6d9e7b;
    background: #edf5ec;
}

.calendar-day.placeholder {
    visibility: hidden;
}

.calendar-day.past {
    background: transparent;
    color: #b5bcb7;
    cursor: not-allowed;
}

.calendar-day.booked {
    background: #f5e2e2;
    color: #a05d5d;
    text-decoration: line-through;
    cursor: not-allowed;
}

.calendar-day.today {
    box-shadow: inset 0 0 0 1.5px #397552;
}

.calendar-day.selected {
    border-radius: 0;
    background: #e5f1e5;
    color: #286440;
}

.calendar-day.selection-start,
.calendar-day.selection-end {
    border-radius: 9px;
    background: #286a43;
    color: #fff;
}

.calendar-selection-summary {
    display: grid;
    grid-template-columns: 31px minmax(0, 1fr);
    gap: 8px;
    align-items: center;
    margin-top: 10px;
    padding: 9px;
    border: 1px solid #dce6dd;
    border-radius: 11px;
    background: #fff;
}

.calendar-selection-icon {
    display: grid;
    width: 31px;
    height: 31px;
    place-items: center;
    border-radius: 8px;
    background: #eaf4e8;
    color: #286a43;
    font-size: 9px;
    font-weight: 900;
}

.calendar-selection-summary small,
.calendar-selection-summary strong {
    display: block;
}

.calendar-selection-summary small {
    color: #87928b;
    font-size: 8px;
}

.calendar-selection-summary strong {
    margin-top: 1px;
    color: #34483c;
    font-size: 10px;
}

.calendar-status {
    min-height: 1.4em;
    margin: 9px 0 0;
    color: #77837c;
    font-size: 10px;
}

.calendar-status.error {
    color: #a33;
}


/* ---------- Anfrage ---------- */

.booking-panel form {
    margin-top: 14px;
}

.booking-date-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.booking-message-field textarea {
    min-height: 112px;
    resize: vertical;
}

.booking-submit-area {
    display: grid;
    gap: 9px;
    margin-top: 6px;
}

.booking-submit-note {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 7px;
    align-items: start;
    padding: 9px;
    border-radius: 11px;
    background: #f4f7f3;
}

.booking-submit-note small {
    color: #77847c;
    font-size: 9px;
    line-height: 1.45;
}

.booking-submit-button {
    width: 100%;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 7px;
}


/* ---------- Nicht verfügbar ---------- */

.item-unavailable-panel {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 13px;
    align-items: center;
    padding: 20px;
    border: 1px solid #e7dddd;
    border-radius: 18px;
    background: #fcf8f8;
}

.item-unavailable-icon {
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    border-radius: 14px;
    background: #f4e8e8;
    color: #965656;
    font-size: 18px;
}

.item-unavailable-panel h2 {
    margin: 3px 0 0;
    color: #453737;
    font-size: 18px;
}

.item-unavailable-panel p {
    margin: 4px 0 0;
    color: #806f6f;
    font-size: 11px;
}


/* ---------- Eigentümerkalender ---------- */

.owner-availability-section {
    display: grid;
    grid-template-columns:
        minmax(230px, .7fr)
        minmax(320px, 1.3fr);
    gap: 16px;
    padding: 18px;
    border-radius: 19px;
}


/* ---------- Login ---------- */

.item-login-prompt {
    display: grid;
    grid-template-columns:
        48px minmax(0, 1fr) auto;
    gap: 13px;
    align-items: center;
    padding: 18px;
    border: 1px solid #dfe8e0;
    border-radius: 18px;
    background:
        linear-gradient(
            135deg,
            #edf6eb,
            #fff
        );
}

.item-login-prompt-icon {
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    border-radius: 14px;
    background: #fff;
    font-size: 18px;
}

.item-login-prompt h2 {
    margin: 3px 0 0;
    color: #263d30;
    font-size: 18px;
}

.item-login-prompt p {
    margin: 4px 0 0;
    color: #718078;
    font-size: 10px;
    line-height: 1.45;
}


/* =========================================================
   RESPONSIVE DETAIL
   ========================================================= */

@media (max-width: 980px) {

    .item-detail-layout {
        grid-template-columns: 1fr;
    }

    .item-detail-content {
        position: static;
    }

    .item-borrow-layout {
        grid-template-columns: 1fr;
    }

    .owner-availability-section {
        grid-template-columns: 1fr;
    }
}


@media (max-width: 700px) {

    .item-detail-page {
        gap: 12px;
        padding-top: 3px;
    }

    .item-detail-image,
    .item-detail-placeholder {
        height: 330px;
        min-height: 330px;
    }

    .item-main-image,
    .item-detail-placeholder {
        border-radius: 17px;
    }

    .item-detail-content {
        padding: 18px 15px;
        border-radius: 17px;
    }

    .item-detail-topline {
        margin-bottom: 19px;
    }

    .item-detail-title h1 {
        font-size: 32px;
    }

    .item-detail-facts {
        grid-template-columns: 1fr;
    }

    .item-borrow-section {
        padding: 16px 13px;
        border-radius: 17px;
    }

    .item-borrow-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 13px;
    }

    .item-borrow-heading h2 {
        font-size: 25px;
    }

    .item-borrow-steps {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        width: 100%;
    }

    .item-borrow-step {
        justify-content: center;
        padding-inline: 4px;
        font-size: 8px;
    }

    .booking-date-fields {
        grid-template-columns: 1fr;
    }

    .booking-panel input,
    .booking-panel textarea {
        font-size: 16px;
    }

    .item-login-prompt {
        grid-template-columns: 43px minmax(0, 1fr);
    }

    .item-login-prompt .btn {
        grid-column: 1 / -1;
        width: 100%;
    }
}


@media (max-width: 480px) {

    .item-detail-image,
    .item-detail-placeholder {
        height: 270px;
        min-height: 270px;
    }

    .thumbnail-button {
        width: 65px;
        height: 52px;
        flex-basis: 65px;
    }

    .item-detail-topline {
        align-items: flex-start;
        flex-direction: column;
        gap: 7px;
    }

    .item-detail-actions {
        grid-template-columns: 1fr;
    }

    .availability-panel,
    .booking-panel {
        padding: 12px;
        border-radius: 14px;
    }

    .availability-calendar {
        padding: 9px 7px;
    }

    .calendar-weekdays,
    .calendar-days {
        gap: 3px;
    }

    .calendar-day {
        min-height: 34px;
        font-size: 9px;
    }

    .calendar-toolbar {
        grid-template-columns: 32px 1fr 32px;
    }

    .calendar-navigation {
        width: 32px;
        height: 32px;
    }

    .item-unavailable-panel {
        grid-template-columns: 42px minmax(0, 1fr);
        padding: 15px;
    }

    .item-unavailable-icon {
        width: 42px;
        height: 42px;
    }
}


@media (max-width: 380px) {

    .item-detail-image,
    .item-detail-placeholder {
        height: 235px;
        min-height: 235px;
    }

    .item-borrow-step {
        gap: 3px;
        font-size: 7px;
    }

    .item-borrow-step span {
        width: 17px;
        height: 17px;
    }

    .calendar-day {
        min-height: 30px;
    }
}


/* =========================================================
   LIGHTBOX
   ========================================================= */


/* ---------------------------------------------------------
   15. Overlay
   --------------------------------------------------------- */

body.lightbox-open {
    overflow: hidden;
}

.image-lightbox {
    position: fixed;
    inset: 0;
    z-index: 2000;

    display: grid;
    place-items: center;

    padding: 2rem;

    background: rgba(8,12,9,.94);
}

.image-lightbox[hidden] {
    display: none;
}

.lightbox-content {
    max-width: min(1100px, calc(100vw - 8rem));
    max-height: calc(100vh - 5rem);

    display: grid;
    justify-items: center;
    gap: 0.75rem;
}

.lightbox-content img {
    max-width: 100%;
    max-height: calc(100vh - 8rem);

    display: block;

    object-fit: contain;
}

.lightbox-footer {
    color: #ffffff;

    font-size: 0.78rem;
}

.lightbox-close,
.lightbox-navigation {
    position: fixed;
    z-index: 2001;

    display: grid;
    place-items: center;

    border: 1px solid rgba(255,255,255,.25);

    background: rgba(255,255,255,.12);
    color: #ffffff;

    cursor: pointer;

    backdrop-filter: blur(8px);
}

.lightbox-close:hover,
.lightbox-navigation:hover {
    background: rgba(255,255,255,.22);
}

.lightbox-close {
    top: 1.25rem;
    right: 1.25rem;

    width: 46px;
    height: 46px;

    border-radius: 50%;

    font-size: 2rem;
    line-height: 1;
}

.lightbox-navigation {
    top: 50%;

    width: 52px;
    height: 72px;

    border-radius: 14px;

    transform: translateY(-50%);

    font-size: 2.5rem;
}

.lightbox-previous {
    left: 1.25rem;
}

.lightbox-next {
    right: 1.25rem;
}


/* =========================================================
   RESPONSIVE
   ========================================================= */


/* ---------------------------------------------------------
   16. Tablet
   --------------------------------------------------------- */

@media (max-width: 980px) {
    .item-detail-layout {
        grid-template-columns: 1fr;
    }

    .item-detail-content {
        position: static;
    }

    .item-borrow-layout {
        grid-template-columns: 1fr;
    }

    .owner-availability-section {
        grid-template-columns: 1fr;
    }
}


/* ---------------------------------------------------------
   17. Kleine Tablets / große Smartphones
   --------------------------------------------------------- */

@media (max-width: 760px) {
    .item-detail-page {
        gap: 1.5rem;
    }

    .item-detail-image,
    .item-detail-placeholder {
        height: 360px;
        min-height: 360px;
    }

    .item-detail-content {
        padding: 1.1rem;

        border-radius: 18px;
    }

    .item-detail-title h1 {
        font-size: clamp(2rem, 10vw, 3.2rem);
    }

    .item-detail-facts {
        grid-template-columns: 1fr;
    }

    .item-borrow-section {
        padding: 1rem;

        border-radius: 18px;
    }

    .item-borrow-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .booking-date-fields {
        grid-template-columns: 1fr;
    }

    .item-login-prompt {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .item-login-prompt .btn {
        grid-column: 1 / -1;

        width: 100%;
    }
}


/* ---------------------------------------------------------
   18. Smartphones
   --------------------------------------------------------- */

@media (max-width: 560px) {
    .item-main-image,
    .item-detail-placeholder {
        border-radius: 16px;
    }

    .item-detail-image,
    .item-detail-placeholder {
        height: 280px;
        min-height: 280px;
    }

    .thumbnail-button {
        flex-basis: 68px;

        width: 68px;
        height: 54px;
    }

    .item-detail-topline {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.55rem;
    }

    .item-detail-owner-actions {
        gap: 0.65rem;
    }

    .item-detail-actions {
        grid-template-columns: 1fr;
    }

    .item-borrow-steps {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));

        width: 100%;
    }

    .item-borrow-step {
        justify-content: center;

        padding-inline: 0.35rem;

        font-size: 0.62rem;
    }

    .availability-panel,
    .booking-panel {
        padding: 0.8rem;

        border-radius: 15px;
    }

    .availability-calendar {
        padding: 0.6rem;
    }

    .calendar-day {
        min-height: 34px;

        font-size: 0.7rem;
    }

    .calendar-toolbar {
        grid-template-columns: 34px 1fr 34px;
    }

    .calendar-navigation {
        width: 34px;
        height: 34px;
    }

    .image-management-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .managed-image-preview img {
        height: 140px;
    }

    .managed-image-rotate-actions {
        grid-template-columns: 1fr;
    }

    .image-lightbox {
        padding: 0.75rem;
    }

    .lightbox-content {
        max-width: calc(100vw - 1.5rem);
        max-height: calc(100vh - 4rem);
    }

    .lightbox-content img {
        max-height: calc(100vh - 7rem);
    }

    .lightbox-navigation {
        width: 40px;
        height: 56px;

        font-size: 2rem;
    }

    .lightbox-previous {
        left: 0.4rem;
    }

    .lightbox-next {
        right: 0.4rem;
    }

    .lightbox-close {
        top: 0.65rem;
        right: 0.65rem;
    }
}


/* ---------------------------------------------------------
   19. Sehr kleine Smartphones
   --------------------------------------------------------- */

@media (max-width: 390px) {
    .item-detail-image,
    .item-detail-placeholder {
        height: 240px;
        min-height: 240px;
    }

    .item-borrow-step {
        gap: 0.2rem;

        font-size: 0.57rem;
    }

    .item-borrow-step span {
        width: 18px;
        height: 18px;
    }

    .calendar-weekdays,
    .calendar-days {
        gap: 0.2rem;
    }

    .calendar-day {
        min-height: 31px;
    }

    .image-management-grid {
        grid-template-columns: 1fr;
    }

    .managed-image-preview img {
        height: 190px;
    }
}
