/*
 * ParsKala product tab content
 *
 * Important isolation rule:
 * - Raw / imported WooCommerce descriptions use the --normalized marker and may
 *   receive ParsKala typography/layout normalization.
 * - Elementor/page-builder output never receives that marker and must keep its
 *   own generated CSS without being overridden by this file.
 */

/* Elementor/page-builder output: layout safety only. Never force typography,
 * colors, spacing, links, media or box-sizing on builder descendants. */
#tab_description .prk-product-description-content--elementor,
.prk-modal .prk-product-description-content--elementor,
.prk-mobile-info-tabs-modal .prk-product-description-content--elementor {
    min-width: 0;
    max-width: 100%;
}

#tab_description .prk-product-description-content--normalized + .prk-product-description-content--elementor,
#tab_description .prk-product-description-content--elementor + .prk-product-description-content--normalized {
    margin-top: 18px;
}

/* Raw/native description wrapper. Values are inherited naturally; no wildcard
 * selector and no !important font-family are used, so embedded widgets/shortcodes
 * can keep their own styling. */
#tab_description .prk-product-description-content--normalized {
    box-sizing: border-box;
    color: #3f4064;
    font-family: var(--prk-font-family, "prk-font", Tahoma, Arial, sans-serif);
    font-size: 14px;
    line-height: 2;
    overflow-wrap: anywhere;
    word-break: normal;
}

#tab_description .prk-product-description-content--normalized > :first-child,
#tab_description .prk-product-description-content--normalized .prk-pi-imported-description-intro > :first-child,
#tab_description .prk-product-description-content--normalized .prk-pi-review-section-text > :first-child {
    margin-top: 0;
}

#tab_description .prk-product-description-content--normalized > :last-child,
#tab_description .prk-product-description-content--normalized .prk-pi-imported-description-intro > :last-child,
#tab_description .prk-product-description-content--normalized .prk-pi-review-section-text > :last-child {
    margin-bottom: 0;
}

/* Only direct native content is normalized. Nested blocks/widgets are left alone. */
#tab_description .prk-product-description-content--normalized > p {
    margin: 0 0 16px;
    line-height: 2;
    text-align: start;
}

#tab_description .prk-product-description-content--normalized > h2,
#tab_description .prk-product-description-content--normalized > h3,
#tab_description .prk-product-description-content--normalized > h4,
#tab_description .prk-product-description-content--normalized > h5,
#tab_description .prk-product-description-content--normalized > h6 {
    margin: 26px 0 10px;
    color: #23254e;
    font-weight: 700;
    line-height: 1.9;
    text-align: start;
}

#tab_description .prk-product-description-content--normalized > h2 { font-size: 17px; }
#tab_description .prk-product-description-content--normalized > h3 { font-size: 16px; }
#tab_description .prk-product-description-content--normalized > h4,
#tab_description .prk-product-description-content--normalized > h5,
#tab_description .prk-product-description-content--normalized > h6 { font-size: 15px; }

#tab_description .prk-product-description-content--normalized > ul,
#tab_description .prk-product-description-content--normalized > ol {
    margin: 12px 0 18px;
    padding-inline-start: 24px;
    line-height: 2;
}

#tab_description .prk-product-description-content--normalized > ul { list-style: disc; }
#tab_description .prk-product-description-content--normalized > ol { list-style: decimal; }

#tab_description .prk-product-description-content--normalized > ul > li,
#tab_description .prk-product-description-content--normalized > ol > li {
    margin: 4px 0;
    padding-inline-start: 3px;
    line-height: 2;
}

/* Do not set generic <a> color/text-decoration here. Links may be Elementor
 * buttons, Gutenberg buttons or shortcode UI. Global/theme/builder styles win. */

#tab_description .prk-product-description-content--normalized > blockquote {
    margin: 18px 0;
    padding: 12px 16px;
    border-inline-start: 3px solid var(--prk-color-primary, var(--prk-primary-color, #19bfd3));
    border-radius: 8px;
    background: #f7f7f8;
    color: #4f5156;
}

#tab_description .prk-product-description-content--normalized > figure {
    margin: 20px 0;
}

/* WordPress native image captions ([caption] shortcode). */
#tab_description .prk-product-description-content--normalized > .wp-caption,
#tab_description .prk-product-description-content--normalized > figure.wp-caption,
.prk-modal .prk-product-description-content--normalized > .wp-caption,
.prk-modal .prk-product-description-content--normalized > figure.wp-caption,
.prk-mobile-info-tabs-modal .prk-mobile-info-tabs__short > .wp-caption,
.prk-mobile-info-tabs-modal .prk-mobile-info-tabs__desc > .wp-caption,
.prk-mobile-info-tabs-modal .prk-mobile-info-tabs__short > figure.wp-caption,
.prk-mobile-info-tabs-modal .prk-mobile-info-tabs__desc > figure.wp-caption {
    width: auto !important;
    max-width: 100%;
    margin: 20px auto;
    text-align: center;
}

#tab_description .prk-product-description-content--normalized > .wp-caption img,
.prk-modal .prk-product-description-content--normalized > .wp-caption img,
.prk-mobile-info-tabs-modal .prk-mobile-info-tabs__short > .wp-caption img,
.prk-mobile-info-tabs-modal .prk-mobile-info-tabs__desc > .wp-caption img {
    display: block;
    max-width: 100%;
    height: auto;
    margin-inline: auto;
}

#tab_description .prk-product-description-content--normalized > .wp-caption .wp-caption-text,
#tab_description .prk-product-description-content--normalized > figure.wp-caption > figcaption,
.prk-modal .prk-product-description-content--normalized > .wp-caption .wp-caption-text,
.prk-modal .prk-product-description-content--normalized > figure.wp-caption > figcaption,
.prk-mobile-info-tabs-modal .prk-mobile-info-tabs__short > .wp-caption .wp-caption-text,
.prk-mobile-info-tabs-modal .prk-mobile-info-tabs__short > figure.wp-caption > figcaption,
.prk-mobile-info-tabs-modal .prk-mobile-info-tabs__desc > .wp-caption .wp-caption-text,
.prk-mobile-info-tabs-modal .prk-mobile-info-tabs__desc > figure.wp-caption > figcaption {
    margin: 8px 0 0;
    color: #81858b;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.9;
    text-align: center;
}

#tab_description .prk-product-description-content--normalized > .wp-caption.aligncenter,
.prk-modal .prk-product-description-content--normalized > .wp-caption.aligncenter,
.prk-mobile-info-tabs-modal .wp-caption.aligncenter {
    margin-inline: auto;
}

#tab_description .prk-product-description-content--normalized > img,
#tab_description .prk-product-description-content--normalized > video,
#tab_description .prk-product-description-content--normalized > iframe {
    display: block;
    max-width: 100%;
    height: auto;
    margin-inline: auto;
    border-radius: 12px;
}

#tab_description .prk-product-description-content--normalized > table {
    width: 100%;
    margin: 18px 0;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    border: 1px solid #e0e0e2;
    border-radius: 10px;
}

#tab_description .prk-product-description-content--normalized > table > tbody > tr > th,
#tab_description .prk-product-description-content--normalized > table > tbody > tr > td,
#tab_description .prk-product-description-content--normalized > table > thead > tr > th,
#tab_description .prk-product-description-content--normalized > table > thead > tr > td {
    padding: 10px 12px;
    border-bottom: 1px solid #f0f0f1;
    text-align: start;
    vertical-align: top;
}

#tab_description .prk-product-description-content--normalized > table > tbody > tr:last-child > th,
#tab_description .prk-product-description-content--normalized > table > tbody > tr:last-child > td {
    border-bottom: 0;
}

/* Imported product content has known ParsKala wrappers, so stronger normalization
 * is deliberately limited to those wrappers rather than every descendant. */
#tab_description .prk-product-description-content--normalized .prk-pi-imported-description-intro,
#tab_description .prk-product-description-content--normalized .prk-pi-imported-description-intro *,
#tab_description .prk-product-description-content--normalized .prk-pi-imported-review-sections,
#tab_description .prk-product-description-content--normalized .prk-pi-imported-review-sections * {
    line-height: 2 !important;
    text-align: start !important;
}

#tab_description .prk-product-description-content--normalized .prk-pi-imported-description-intro br {
    display: block;
    content: "";
    margin-bottom: 5px;
}

#tab_description .prk-product-description-content--normalized .prk-pi-review-section {
    margin-top: 28px;
}

#tab_description .prk-product-description-content--normalized .prk-pi-review-section:first-child {
    margin-top: 0;
}

#tab_description .prk-product-description-content--normalized .prk-pi-review-section-image {
    margin: 16px 0 22px;
}

/* Same known imported content inside the mobile information modal. */
.prk-mobile-info-tabs-modal .prk-mobile-info-tabs__desc.prk-product-description-content--normalized .prk-pi-imported-description-intro,
.prk-mobile-info-tabs-modal .prk-mobile-info-tabs__desc.prk-product-description-content--normalized .prk-pi-imported-description-intro *,
.prk-mobile-info-tabs-modal .prk-mobile-info-tabs__desc.prk-product-description-content--normalized .prk-pi-imported-review-sections,
.prk-mobile-info-tabs-modal .prk-mobile-info-tabs__desc.prk-product-description-content--normalized .prk-pi-imported-review-sections * {
    line-height: 2 !important;
    text-align: start !important;
}

.prk-mobile-info-tabs-modal .prk-mobile-info-tabs__desc.prk-product-description-content--normalized .prk-pi-imported-description-intro br {
    display: block;
    content: "";
    margin-bottom: 4px;
}

/* Native WooCommerce attributes when grouped attributes are disabled. */
.specifications-content table.prk-native-attributes-table {
    display: block;
    width: 100%;
    margin: 0;
    border: 0;
    border-collapse: separate;
    border-spacing: 0;
}

.specifications-content table.prk-native-attributes-table tbody {
    display: grid;
    gap: 8px;
    width: 100%;
}

.specifications-content table.prk-native-attributes-table tr {
    display: grid;
    grid-template-columns: minmax(150px, 220px) minmax(0, 1fr);
    width: 100%;
    overflow: hidden;
    border: 1px solid #ececed;
    border-radius: 10px;
    background: #f7f7f8;
}

.specifications-content table.prk-native-attributes-table th,
.specifications-content table.prk-native-attributes-table td {
    display: block;
    width: auto !important;
    min-width: 0;
    margin: 0;
    padding: 11px 14px;
    border: 0 !important;
    background: transparent !important;
    line-height: 1.9 !important;
    text-align: start;
    vertical-align: top;
    overflow-wrap: anywhere;
    font-family: var(--prk-font-family, 'prk-font', Tahoma, Arial, sans-serif);
}

.specifications-content table.prk-native-attributes-table th {
    color: #424750;
    font-weight: 600 !important;
}

.specifications-content table.prk-native-attributes-table td {
    color: #3f4064;
    font-weight: 400 !important;
}

.specifications-content table.prk-native-attributes-table td p {
    margin: 0;
    line-height: inherit !important;
}

.prk-native-attributes-toggle svg {
    transition: transform .2s ease-in-out;
    transform: rotate(-90deg);
}

.prk-native-attributes-toggle[aria-expanded="true"] svg {
    transform: rotate(90deg);
}

@media (min-width: 1024px) {
    .specifications-content table.prk-native-attributes-preview:not(.is-expanded) tr.prk-native-attribute-row--initially-hidden {
        display: none;
    }
}

@media (max-width: 1023px) {
    .specifications-content table.prk-native-attributes-preview:not(.is-expanded) tr.prk-native-attribute-row--initially-hidden {
        display: none;
    }

    .specifications-content table.prk-native-attributes-table tbody {
        gap: 0;
    }

    .specifications-content table.prk-native-attributes-table tr {
        display: block;
        padding: 12px 0;
        overflow: visible;
        border: 0;
        border-bottom: 1px solid #f0f0f1;
        border-radius: 0;
        background: #fff;
    }

    .specifications-content table.prk-native-attributes-table tr:first-child {
        padding-top: 0;
    }

    .specifications-content table.prk-native-attributes-table th,
    .specifications-content table.prk-native-attributes-table td {
        padding: 0;
    }

    .specifications-content table.prk-native-attributes-table th {
        margin-bottom: 4px;
        color: #81858b;
        font-size: 11px;
        font-weight: 500 !important;
        line-height: 1.75 !important;
    }

    .specifications-content table.prk-native-attributes-table td {
        color: #424750;
        font-size: 13px;
        font-weight: 400 !important;
        line-height: 1.9 !important;
    }
}

/* Native attributes inside the combined mobile information modal. */
.prk-mobile-info-tabs-modal table.prk-mobile-native-attributes-table {
    display: block;
    width: 100%;
    margin: 0;
    border: 0;
    border-collapse: separate;
    border-spacing: 0;
}

.prk-mobile-info-tabs-modal table.prk-mobile-native-attributes-table tbody {
    display: block;
    width: 100%;
}

.prk-mobile-info-tabs-modal table.prk-mobile-native-attributes-table tr {
    display: block;
    width: 100%;
    padding: 13px 0;
    border: 0;
    border-bottom: 1px solid #f0f0f1;
    background: #fff;
}

.prk-mobile-info-tabs-modal table.prk-mobile-native-attributes-table tr:first-child {
    padding-top: 0;
}

.prk-mobile-info-tabs-modal table.prk-mobile-native-attributes-table tr:last-child {
    border-bottom: 0;
}

.prk-mobile-info-tabs-modal table.prk-mobile-native-attributes-table th,
.prk-mobile-info-tabs-modal table.prk-mobile-native-attributes-table td {
    display: block;
    width: 100% !important;
    margin: 0;
    padding: 0;
    border: 0 !important;
    background: transparent !important;
    text-align: start;
    overflow-wrap: anywhere;
}

.prk-mobile-info-tabs-modal table.prk-mobile-native-attributes-table th {
    margin-bottom: 5px;
    color: #81858b;
    font-size: 11px;
    font-weight: 500 !important;
    line-height: 1.75 !important;
}

.prk-mobile-info-tabs-modal table.prk-mobile-native-attributes-table td {
    color: #424750;
    font-size: 13px;
    font-weight: 400 !important;
    line-height: 1.9 !important;
}

.prk-mobile-info-tabs-modal table.prk-mobile-native-attributes-table td p {
    margin: 0 !important;
    color: inherit;
    font-weight: inherit !important;
    line-height: inherit !important;
}

/* Description-tab more button only. */
#tab_description .listis-btn-more {
    color: var(--prk-color-primary, var(--prk-primary-color, #19bfd3));
}

#tab_description .listis-btn-more:hover {
    color: var(--prk-color-primary-hover, var(--prk-color-primary, var(--prk-primary-color, #19bfd3)));
}

@media (max-width: 767px) {
    #tab_description .prk-product-description-content--normalized {
        font-size: 13px;
    }

    #tab_description .prk-product-description-content--normalized > p {
        margin-bottom: 12px;
    }
}

#tab_description .prk-product-description-content--normalized + .prk-product-description-content--normalized {
    margin-top: 18px;
}

#tab_description .prk-product-description-content--normalized > hr {
    height: 1px;
    margin: 24px 0;
    border: 0;
    background: #ececed;
}

#tab_description .prk-product-description-content--normalized > dl {
    margin: 14px 0 18px;
}

#tab_description .prk-product-description-content--normalized > dt {
    margin-top: 10px;
    color: #424750;
    font-weight: 700;
}

#tab_description .prk-product-description-content--normalized > dd {
    margin: 4px 0 0;
    color: #62666d;
}

#tab_description .prk-product-description-content--normalized > pre {
    max-width: 100%;
    margin: 18px 0;
    padding: 14px;
    overflow: auto;
    border: 1px solid #e0e0e2;
    border-radius: 10px;
    background: #f7f7f8;
    direction: ltr;
    text-align: left;
    white-space: pre-wrap;
}

#tab_description .prk-product-description-content--normalized > code {
    padding: 2px 5px;
    border-radius: 5px;
    background: #f0f0f1;
    font-family: monospace;
    font-size: .92em;
}

/* Text-only custom specification rows (title entered without a value).
 * These rows are rendered with one colspan cell by Product_Specifications_Resolver.
 * The desktop attributes table uses CSS Grid, so colspan alone is not enough;
 * explicitly span the cell across the whole row to keep it truly one-line/full-width.
 */
.specifications-content table.prk-native-attributes-table td.prk-product-specification-text-only {
    grid-column: 1 / -1;
    width: 100% !important;
}


/* Custom specification rows appended into the grouped-attributes renderer.
 * A custom item with only a title/value-line must occupy the complete inner row
 * instead of leaving the normal attribute-name column empty. */
.specifications-content .attribute_name_values tr.prk-grouped-specification-text-only-row > td.prk-grouped-specification-text-only,
.prk-mobile-info-tabs-modal .attribute_name_values tr.prk-grouped-specification-text-only-row > td.prk-grouped-specification-text-only {
    width: 100% !important;
    max-width: none !important;
    margin-left: 0 !important;
    border-radius: 8px !important;
}

.shop_attributes.woocommerce-group-attributes-layout-2 tbody tr td table tr.prk-grouped-specification-text-only-row > td.prk-grouped-specification-text-only,
.shop_attributes.woocommerce-group-attributes-layout-2 tbody tr td table tr.prk-grouped-specification-text-only-row > td.prk-grouped-specification-text-only {
    font-size: 14px;
    font-weight: 500;
}

.shop_attributes.woocommerce-group-attributes-layout-3 tbody tr td table tr.prk-grouped-specification-text-only-row > td.prk-grouped-specification-text-only,
.shop_attributes.woocommerce-group-attributes-layout-3 tbody tr td table tr.prk-grouped-specification-text-only-row > td.prk-grouped-specification-text-only {
    font-size: 14px;
}

/* Width fix for appended custom-specification rows inside grouped-attributes layouts.
 * Layout 2/3 render inner rows as flex rows with a right offset. A single full-width
 * text-only item must not keep the default 100% cell width + row offset, otherwise it
 * visually overflows to the left. */
.specifications-content .shop_attributes tbody tr td table.attribute_name_values,
.prk-mobile-info-tabs-modal .shop_attributes tbody tr td table.attribute_name_values {
    width: 100%;
    table-layout: fixed;
}

@media (max-width: 990px) {
    .specifications-content .shop_attributes tbody tr td table.attribute_name_values tr.prk-grouped-specification-text-only-row,
    .prk-mobile-info-tabs-modal .shop_attributes tbody tr td table.attribute_name_values tr.prk-grouped-specification-text-only-row {
        width: 100% !important;
        margin-right: 0 !important;
    }
}


/* Linked WooCommerce attribute terms.
 * Only attributes with their WooCommerce archive enabled are rendered as links.
 * Keep the link visually identical to the surrounding specification value. */
.specifications-content .prk-product-attribute-term-link,
.prk-mobile-info-tabs-modal .prk-product-attribute-term-link {
    font-family: inherit !important;
    font-size: inherit !important;
    font-weight: inherit !important;
    font-style: inherit !important;
    line-height: inherit !important;
    letter-spacing: inherit !important;
    color: var(--prk-color-primary, var(--prk-primary-color, #19bfd3)) !important;
    text-decoration: none !important;
    transition: color .2s ease;
}

.specifications-content .prk-product-attribute-term-link:hover,
.prk-mobile-info-tabs-modal .prk-product-attribute-term-link:hover {
    color: var(--prk-color-primary-hover, var(--prk-color-primary, var(--prk-primary-color, #19bfd3))) !important;
    text-decoration: underline !important;
}
