/*
 * MediShop — product-content.css v36.1
 * Tables, charts, and rich HTML in product descriptions.
 */

#tab-description,
.woocommerce-Tabs-panel--description,
.woocommerce-product-details__short-description,
.ms-page-body,
.entry-content.wc-tab {
    overflow-wrap: break-word;
}

/* ── Tables ── */
#tab-description table,
.woocommerce-Tabs-panel--description table,
.woocommerce div.product .woocommerce-tabs .panel table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 12px;
    line-height: 1.5;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    display: table;
}

#tab-description .table-scroll,
.woocommerce-Tabs-panel--description .table-scroll {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 1rem 0;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

#tab-description .table-scroll table,
.woocommerce-Tabs-panel--description .table-scroll table {
    margin: 0;
    border: none;
    border-radius: 0;
    min-width: 480px;
}

#tab-description th,
#tab-description td,
.woocommerce-Tabs-panel--description th,
.woocommerce-Tabs-panel--description td {
    padding: 8px 10px;
    border: 1px solid #e5e7eb;
    text-align: left;
    vertical-align: top;
}

#tab-description thead th,
.woocommerce-Tabs-panel--description thead th {
    background: #f0f7f0;
    color: var(--ms-green, #2e7d32);
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

#tab-description tbody tr:nth-child(even),
.woocommerce-Tabs-panel--description tbody tr:nth-child(even) {
    background: #fafafa;
}

#tab-description tbody tr:hover,
.woocommerce-Tabs-panel--description tbody tr:hover {
    background: #f0fdf4;
}

/* Gutenberg / WP block tables */
#tab-description .wp-block-table,
.woocommerce-Tabs-panel--description .wp-block-table {
    margin: 1rem 0;
    overflow-x: auto;
}

#tab-description .wp-block-table table,
.woocommerce-Tabs-panel--description .wp-block-table table {
    margin: 0;
}

/* ── Charts & data visuals ── */
#tab-description figure,
.woocommerce-Tabs-panel--description figure {
    margin: 1rem 0;
    max-width: 100%;
}

#tab-description canvas,
#tab-description svg.chart,
#tab-description .chart-container,
#tab-description .ms-chart,
.woocommerce-Tabs-panel--description canvas,
.woocommerce-Tabs-panel--description svg.chart,
.woocommerce-Tabs-panel--description .chart-container,
.woocommerce-Tabs-panel--description .ms-chart {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 1rem auto;
}

#tab-description .chart-wrap,
.woocommerce-Tabs-panel--description .chart-wrap {
    position: relative;
    width: 100%;
    min-height: 200px;
    margin: 1rem 0;
    padding: 12px;
    background: #fafafa;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow-x: auto;
}

#tab-description iframe,
.woocommerce-Tabs-panel--description iframe {
    max-width: 100%;
    border: 0;
    border-radius: 6px;
    min-height: 200px;
}

/* Comparison / spec grids often pasted as div tables */
#tab-description .spec-table,
#tab-description .dosage-table,
.woocommerce-Tabs-panel--description .spec-table,
.woocommerce-Tabs-panel--description .dosage-table {
    display: grid;
    gap: 0;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    margin: 1rem 0;
    font-size: 12px;
}

@media (max-width: 767px) {
    #tab-description .table-scroll,
    .woocommerce-Tabs-panel--description .table-scroll {
        margin-left: -4px;
        margin-right: -4px;
        border-radius: 6px;
    }

    #tab-description th,
    #tab-description td,
    .woocommerce-Tabs-panel--description th,
    .woocommerce-Tabs-panel--description td {
        padding: 6px 8px;
        font-size: 11px;
    }
}

/* ================================================================
   PRESCRIPTION NOTICE — single product page
   Uses theme design tokens. Shown only when _requires_prescription
   is checked in the product admin.
================================================================ */

.ms-rx-notice {
    display: flex;
    align-items: flex-start;
    gap: var(--sp-4);
    background: var(--c-orange-light);
    border: 1.5px solid var(--c-orange-border);
    border-left: 4px solid var(--c-orange);
    border-radius: var(--r-md);
    padding: var(--sp-4) var(--sp-5);
    margin: var(--sp-5) 0;
    font-family: var(--f-body);
}

.ms-rx-notice__icon {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    background: var(--c-orange);
    border-radius: var(--r-full);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
}

.ms-rx-notice__icon svg {
    width: 20px;
    height: 20px;
    fill: #fff;
}

.ms-rx-notice__body {
    flex: 1;
}

.ms-rx-notice__title {
    font-family: var(--f-heading);
    font-size: var(--fs-base);
    font-weight: var(--fw-bold);
    color: var(--c-orange);
    margin: 0 0 var(--sp-1) 0;
    line-height: var(--lh-tight);
    display: flex;
    align-items: center;
    gap: 6px;
}

.ms-rx-notice__badge {
    display: inline-block;
    background: var(--c-orange);
    color: #fff;
    font-size: var(--fs-2xs);
    font-weight: var(--fw-bold);
    font-family: var(--f-body);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 2px 7px;
    border-radius: var(--r-full);
    line-height: 1.5;
}

.ms-rx-notice__text {
    font-size: var(--fs-sm);
    color: var(--c-text-2);
    margin: 0;
    line-height: var(--lh-base);
}

.ms-rx-notice__text strong {
    color: var(--c-text);
    font-weight: var(--fw-semibold);
}

/* Position: inside summary, just above Add-to-Cart (priority 25) */
.ms-single-summary .ms-rx-notice {
    margin: var(--sp-3) 0 var(--sp-4);
}

@media (max-width: 600px) {
    .ms-rx-notice {
        flex-direction: column;
        gap: var(--sp-3);
    }

    .ms-rx-notice__icon {
        width: 32px;
        height: 32px;
        margin-top: 0;
    }

    .ms-rx-notice__icon svg {
        width: 16px;
        height: 16px;
    }
}
