/* Shared storefront components.
   Loaded by the CMS and embedded verbatim in booking-widget shadow roots.
   Keep cart and catalogue behaviour in their respective JavaScript adapters. */

/* Quantity: identical colours, controls and input behaviour in Hire and Buy. */
.ich-qty {
    display: inline-grid;
    grid-template-columns: 28px minmax(28px, 1fr) 28px;
    align-items: center;
    overflow: hidden;
    border: 1px solid #2f342f;
    border-radius: 999px;
    background: #2f342f;
    color: #f4ebcb;
}
.ich-qty button {
    width: 100%;
    min-height: 38px;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}
.ich-qty input {
    box-sizing: border-box;
    appearance: textfield;
    width: 100%;
    height: 38px;
    min-height: 38px;
    padding: 0;
    border: 0;
    border-inline: 1px solid #f4ebcb42;
    background: transparent;
    color: inherit;
    -webkit-text-fill-color: currentColor;
    font: inherit;
    font-size: 13px;
    text-align: center;
}
.ich-qty input:focus { outline: none; box-shadow: none; }
.ich-qty input::-webkit-inner-spin-button,
.ich-qty input::-webkit-outer-spin-button { appearance: none; margin: 0; }
.ich-qty button:disabled { cursor: not-allowed; opacity: .45; }
.ich-qty:has(input:disabled) { opacity: .55; }

/* Quick view: one layout and type scale for both catalogues. */
.ich-gallery-lightbox {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 64px clamp(18px, 4vw, 44px) 32px;
    border: 0;
    background: transparent;
    overflow: auto;
    overscroll-behavior: contain;
    font-family: Poppins, Arial, sans-serif;
    font-weight: 600;
}
.ich-gallery-lightbox[open] { display: grid; place-items: safe center; }
.ich-gallery-lightbox::backdrop { background: rgba(15, 17, 15, .78); }
.ich-gallery-dialog {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(430px, .67fr);
    align-items: stretch;
    column-gap: 0;
    row-gap: 14px;
    width: min(100%, 1180px);
    color: #2f342f;
}
.ich-gallery-frame {
    position: relative;
    align-self: stretch;
    width: 100%;
    min-width: 0;
    overflow: hidden;
    background: #fffdf5;
}
.ich-gallery-image > img,
.ich-gallery-frame .gallery-main img {
    display: block;
    width: 100%;
    height: auto;
    max-width: 100%;
    max-height: min(74vh, 760px);
    aspect-ratio: auto;
    object-fit: contain;
}
.ich-gallery-content {
    align-self: stretch;
    display: grid;
    align-content: start;
    gap: 14px;
    background: #fffdf5;
    color: #2f342f;
    padding: clamp(18px, 2.4vw, 28px);
}
.ich-gallery-content h2 {
    margin: 0;
    color: inherit;
    font-size: clamp(22px, 2.4vw, 34px);
    font-weight: 700;
    letter-spacing: normal;
    line-height: 1.02;
}
.ich-gallery-content p { margin: 0; color: #2f342fb8; font-size: 13px; line-height: 1.45; }
.ich-gallery-content ul { margin: 0; padding-left: 18px; color: #2f342fc2; font-size: 12px; line-height: 1.45; }
.ich-gallery-meta {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    color: #fffdf5db;
    font-size: 12px;
    font-weight: 700;
}
.ich-gallery-close {
    position: absolute;
    right: 0;
    top: -48px;
    z-index: 2;
    display: grid;
    align-items: center;
    justify-items: end;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #fffdf5;
    cursor: pointer;
}
.ich-gallery-close:focus { outline: none; box-shadow: none; }
.ich-gallery-nav,
.ich-gallery-frame .gallery-controls .ich-gallery-nav {
    width: 42px;
    height: 42px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: #fffdf5eb;
    color: #2f342f;
    font-size: 22px;
    font-weight: 700;
    cursor: pointer;
}
.ich-full-details,
.quick-view-full { display: inline-block; margin-top: 24px; color: inherit; font-size: 13px; text-decoration: underline; }

@media (max-width: 767px) {
    .ich-gallery-lightbox { padding: 56px 16px 16px; }
    .ich-gallery-dialog { grid-template-columns: 1fr; }
    .ich-gallery-content { padding: 24px; }
    .ich-gallery-nav,
    .ich-gallery-frame .gallery-controls .ich-gallery-nav { width: 36px; height: 36px; }
}

/* Thumbnail strips sit over the lower left of the actual image, at one eighth its height. */
.ich-gallery-image { position: relative; }
.ich-gallery-frame .ich-gallery-thumbnails {
    position: absolute;
    left: 12px;
    bottom: 12px;
    display: flex;
    gap: 6px;
    max-width: calc(100% - 24px);
    margin: 0;
    padding: 0;
    overflow-x: auto;
    z-index: 3;
}
.ich-gallery-frame .ich-gallery-thumbnails[hidden] { display: none; }
.ich-gallery-frame .ich-gallery-thumbnails button {
    flex: 0 0 auto;
    width: calc(var(--gallery-image-height, 480px) / 8);
    height: calc(var(--gallery-image-height, 480px) / 8);
    min-width: 32px;
    min-height: 32px;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 0;
    background: #fffdf5;
    cursor: pointer;
}
.ich-gallery-frame .ich-gallery-thumbnails button[aria-pressed="true"] { border-color: #2f342f; }
.ich-gallery-frame .ich-gallery-thumbnails img { display: block; width: 100%; height: 100%; aspect-ratio: 1; object-fit: cover; }

/* Give quantities the same proportions as the storefront control. */
.ich-gallery-content .product-price,
.ich-gallery-content .ich-detail-purchase > .ich-price,
.ich-gallery-content .ich-card-purchase > .ich-price { font-size: 24px; }
.ich-gallery-content .quantity { flex-basis: 92px; }
.ich-gallery-content .ich-qty { grid-template-columns: 28px 34px 28px; }
.ich-gallery-content .ich-qty :is(button, input) { height: 38px; min-height: 38px; }

/* Purchase buttons and quantities share one height on cards, details and quick views. */
.product-info .product-purchase .button,
.product-card .product-purchase .button,
.ich-widget .ich-card-purchase .ich-button,
.ich-widget .ich-detail-purchase .ich-button {
    box-sizing: border-box;
    height: 40px;
    min-height: 40px;
    padding-block: 0;
    white-space: nowrap;
}
.ich-widget .ich-detail-quantity input {
    height: 40px;
    min-height: 40px;
    padding-block: 0;
}

/* Quantity names remain available to assistive technology without a visible caption. */
.quantity > span,
.ich-detail-quantity > span {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

/* Full-page booking controls use the same quantity component as Hire and Buy cards. */
.ich-widget .ich-detail-purchase { flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.ich-widget .ich-detail-purchase .ich-qty { grid-template-columns: 28px 34px 28px; flex: 0 0 auto; }
.ich-widget .ich-detail-purchase .ich-qty input { width: 100%; }
.ich-widget:has(.ich-detail-purchase) .ich-date-picker { width: min(100%, 640px); }
