.ilm-sizechart-inline {
    margin: 1rem 0;
}

.ilm-sizechart-trigger {
    cursor: pointer;
}

.ilm-sizechart-modal {
    display: none;
    overflow: visible;
    position: fixed;
    box-sizing: border-box;
}

.ilm-sizechart-modal.is-open {
    display: block;
}

.ilm-sizechart-modal-dialog {
    display: flex;
    flex-direction: column;
    overflow: visible;
    box-sizing: border-box;
}

/* The close button is a child of the dialog and may sit outside it (negative
   offsets), so the dialog does not clip; the scrolling body keeps the rounded
   corners instead. */
.ilm-sizechart-modal-dialog > .ilm-sizechart-modal-close {
    position: absolute;
    z-index: 100002;
    pointer-events: auto;
    margin: 0;
}

.ilm-sizechart-modal-surface {
    border-radius: inherit;
    position: relative;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: visible;
    box-sizing: border-box;
}

.ilm-sizechart-modal-body {
    border-radius: inherit;
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
}

.ilm-sizechart-modal-close {
    position: absolute;
    z-index: 1000;
    margin: 0;
}

.ilm-size-columns-container {
    display: flex;
    align-items: stretch;
    flex-wrap: nowrap;
}

.ilm-size-column {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-height: 1px;
}

.ilm-size-column-content {
    flex: 1 1 auto;
    width: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    box-sizing: border-box;
}

.ilm-size-column-content .ilm-size-component-preview {
    flex: 0 0 auto;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: auto;
    overflow: hidden;
    box-sizing: border-box;
}

.ilm-size-column {
    min-width: 0;
    overflow: hidden;
}

.ilm-size-column-content {
    min-width: 0;
    overflow: hidden;
}

.ilm-size-component-preview img,
.ilm-size-column-content img,
.ilm-column-image {
    max-width: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    box-sizing: border-box;
}

.ilm-text-preview img {
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

/* ── Tab Component (front-end) ── */
.ilm-tab-component { width: 100%; }
.ilm-tab-titles { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 0; }
.ilm-tab-title-btn {
    cursor: pointer;
    padding: 8px 16px;
    border: 1px solid #ddd;
    background: #f5f5f5;
    font-size: 14px;
    transition: background 0.2s, color 0.2s;
}
.ilm-tab-title-btn:hover { opacity: 0.85; }
.ilm-tab-contents { width: 100%; }
.ilm-tab-content { display: none; width: 100%; }
.ilm-tab-content.active { display: block; }
.ilm-tab-inner-component { width: 100%; }

/* ── Video / iFrame Component (front-end) ── */
.ilm-video-placeholder,
.ilm-iframe-placeholder { padding: 20px; text-align: center; border: 1px dashed #ddd; color: #999; min-height: 150px; display: flex; align-items: center; justify-content: center; }

/* Classic theme prints displayProductActions inside the .product-quantity
   flex row (qty, add to cart, wishlist) and that row does not wrap: on a phone
   the button was pushed past the screen edge and widened the whole page.
   Let the row wrap and give the button its own line under the cart button. */
.product-quantity {
    flex-wrap: wrap;
}

.product-quantity > .ilm-sizechart-popup-trigger-container {
    flex: 0 0 100%;
    max-width: 100%;
}

/* Chart shown on the page: themes print it inside the add-to-cart row
   (Classic .product-quantity, Hummingbird .product-actions__...), which is a
   flex row; give the block a line of its own and a plain card look. */
.ilm-sizechart-container {
    flex: 0 0 100%;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin: 1rem 0;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
}

.ilm-sizechart-header {
    padding: .75rem 1rem;
}

.ilm-sizechart-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.3;
}

.ilm-sizechart-content {
    padding: 0 1rem 1rem;
}

/* Phones: columns of a row stack instead of squeezing side by side
   (their widths are inline styles, hence !important). */
@media (max-width: 575px) {
    .ilm-size-columns-container {
        flex-wrap: wrap !important;
    }

    .ilm-size-columns-container > .ilm-size-column {
        flex: 0 0 100% !important;
        width: 100% !important;
        max-width: 100% !important;
    }
}

/* Headings in a text of the popup take the popup's text colour (Popup Button >
   Window > Text color), not the theme's heading colour */
.ilm-sizechart-modal-dialog .ilm-text-preview :is(h1, h2, h3, h4, h5, h6) {
    color: inherit;
}
