/* Grid items otherwise keep the intrinsic width of long preformatted lines. */
.catalog-product-view .product-info-main > .grid > section,
.catalog-product-view :is(#description, section[id^="custom_tab_"]) > .card {
    min-width: 0;
    max-width: 100%;
}

/* Include Page Builder wrappers, which can themselves be flex items. */
.catalog-product-view :is(#description .prose, .custom-tab-content),
.catalog-product-view :is(#description .prose, .custom-tab-content) :is(div, pre) {
    min-width: 0;
    max-width: 100%;
}

/* Typography comes from Hyva prose; retain only content overflow safeguards. */
.catalog-product-view :is(#description .prose, .custom-tab-content) {
    overflow-wrap: anywhere;
}

.catalog-product-view :is(#description .prose, .custom-tab-content) pre {
    box-sizing: border-box;
    overflow-x: auto;
    white-space: pre;
    overflow-wrap: normal;
    word-break: normal;
}

.catalog-product-view :is(#description .prose, .custom-tab-content) :not(pre) > code {
    white-space: normal;
    overflow-wrap: anywhere;
}

.catalog-product-view :is(#description .prose, .custom-tab-content) pre code {
    white-space: inherit;
    overflow-wrap: normal;
    word-break: normal;
}

/* Only the detail grid receives these classes, never the gallery/buy-box grid. */
.catalog-product-view .kowal-hyva-details-grid {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
}

.catalog-product-view .kowal-hyva-details-grid > section,
.catalog-product-view .kowal-hyva-details-grid > section > .card {
    min-width: 0;
    max-width: 100%;
}

@media (min-width: 1024px) {
    .catalog-product-view .kowal-hyva-details-grid[data-columns="2"] {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .catalog-product-view .kowal-hyva-details-grid[data-columns="3"] {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* Retain table headers for assistive technology when visual labels are off. */
.kowal-hyva-hide-attribute-labels #product-attributes th {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

.kowal-hyva-hide-attribute-labels #product-attributes td {
    width: 100%;
}

.catalog-product-view .kowal-hyva-content-limited {
    max-height: var(--kowal-hyva-content-height);
    /* Scrolling keeps links and interactive content accessible while collapsed. */
    overflow: auto;
    overscroll-behavior: contain;
}

.catalog-product-view .kowal-hyva-content-toggle {
    display: block;
    margin: 0.75rem auto 0;
    padding: 0.5rem 1rem;
    border: 1px solid currentColor;
    border-radius: 0.375rem;
    font-weight: 600;
}

.catalog-product-view .kowal-hyva-content-toggle[hidden] {
    display: none;
}

.catalog-product-view .kowal-hyva-content-toggle:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 3px;
}
