/**
 * REVISED CSS for the public-facing Responsive Pricing Table.
 */

/* --- Common Styles --- */
:root {
    --rpt-primary-color: #0073aa;
    --rpt-text-color: #333;
    --rpt-border-color: #ccc;
    --rpt-bg-light: #fff;
    --rpt-bg-hover: #f0f0f1;
}

.rpt-main-wrapper { font-family: inherit; color: var(--rpt-text-color); text-align: center; margin: 20px auto; }

/* **START: FIX - Updated styles for header content with new classes and spacing.** */
.rpt-header-content {
    margin-bottom: 30px;
}
.rpt-header-content .rpt-main-heading {
    margin-top: 0;
    margin-bottom: 0.5em;
    color: var(--rpt-text-color);
}
.rpt-header-content .rpt-heading-description {
    font-size: 1.1em;
    margin-top: 0;
    margin-bottom: 3rem; /* Applied new margin */
    color: #555;
    max-width: 650px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}
/* **END: FIX** */

.rpt-controls-container {
    position: relative;
    margin-bottom: 30px;
}

.rpt-toolbar { display: flex; align-items: center; position: relative; z-index: 21; }
.rpt-toolbar-group { display: flex; align-items: center; gap: 15px; }
.rpt-toolbar-group--col2 { margin-left: auto; }
.rpt-toolbar-group--col3 { margin-right: auto; }

.rpt-view-switcher { display: inline-flex; border: 1px solid var(--rpt-border-color); border-radius: 5px; overflow: hidden; }
.rpt-view-switcher .rpt-view-button { background: var(--rpt-bg-light); border: none; padding: 8px 12px; cursor: pointer; color: var(--rpt-primary-color); line-height: 1; transition: background-color 0.2s ease, color 0.2s ease; display: flex; align-items: center; justify-content: center; }
.rpt-view-switcher .rpt-view-button:first-child { border-right: 1px solid var(--rpt-border-color); }
.rpt-view-switcher .rpt-view-button:hover { background: var(--rpt-bg-hover); }
.rpt-view-switcher .rpt-view-button .dashicons { font-size: 20px; width: 20px; height: 20px; margin-right: 5px; color: var(--rpt-primary-color); }
.rpt-view-switcher .rpt-view-button.active { background: var(--rpt-primary-color); color: var(--rpt-bg-light); }
.rpt-view-switcher .rpt-view-button.active .dashicons { color: var(--rpt-bg-light); }

.rpt-search-wrapper { position: relative; }
.rpt-feature-search { padding: 10px; border: 1px solid var(--rpt-border-color); border-radius: 5px; width: 100%; max-width: 250px; padding-right: 35px; }
.rpt-search-wrapper::after { content: '\f179'; font-family: 'dashicons'; position: absolute; top: 50%; right: 12px; transform: translateY(-50%); color: #a0a5aa; pointer-events: none; font-size: 20px; }
.rpt-billing-cycle-switcher { display: inline-flex; border: 1px solid var(--rpt-primary-color); border-radius: 5px; overflow: hidden; flex-shrink: 0; }
.rpt-billing-cycle-switcher .rpt-button { background: var(--rpt-bg-light); border: none; padding: 10px 15px; cursor: pointer; border-left: 1px solid var(--rpt-primary-color); transition: background-color 0.2s ease, color 0.2s ease; font-size: 14px; color: var(--rpt-primary-color); }
.rpt-billing-cycle-switcher .rpt-button:first-child { border-left: none; }
.rpt-billing-cycle-switcher .rpt-button:hover { background: var(--rpt-bg-hover); }
.rpt-billing-cycle-switcher .rpt-button.active { background: var(--rpt-primary-color); color: var(--rpt-bg-light); }
.rpt-billing-cycle-switcher .rpt-button.rpt-hidden, .rpt-hidden { display: none; }
.rpt-feature-item.rpt-feature-hidden { display: none; }
.rpt-cta-button { display: block; width: 100%; padding: 12px; background: var(--rpt-primary-color); color: var(--rpt-bg-light); text-decoration: none; border-radius: 5px; font-weight: bold; transition: background-color 0.2s ease; box-sizing: border-box; }
.rpt-cta-button:hover { background: #005a87; }

.rpt-ribbon-horizontal {
    position: absolute;
    padding: 6px 15px;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 12px;
    line-height: 1.5;
    z-index: 3;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    background-color: var(--rpt-ribbon-bg-color, #d9534f);
    color: var(--rpt-ribbon-text-color, #ffffff);
    white-space: nowrap;
}
.rpt-ribbon-horizontal::after { content: ''; position: absolute; top: 0; right: -13px; width: 0; height: 0; border-style: solid; border-width: 15px 0 15px 14px; border-left-color: var(--rpt-ribbon-bg-color, #d9534f); border-top-color: transparent; border-bottom-color: transparent; border-right-color: transparent; }

.rpt-feature-info { position: relative; display: inline-flex; align-items: center; cursor: help; margin-left: 10px; }
.rpt-feature-info .dashicons { font-size: 16px; width: 16px; height: 16px; vertical-align: middle; color: var(--rpt-primary-color); }
.rpt-feature-info .rpt-tooltip { visibility: hidden; width: 220px; background-color: #333; color: #fff; text-align: center; border-radius: 6px; padding: 8px; position: absolute; z-index: 101; bottom: 125%; right: 50%; transform: translateX(50%); opacity: 0; transition: opacity 0.3s; font-size: 12px; font-weight: normal; line-height: 1.4; }
.rpt-feature-info:hover .rpt-tooltip { visibility: visible; opacity: 1; }
.rpt-pricing-table, .rpt-grid-scroll-wrapper, .rpt-list-view-wrapper { transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out; }
.rpt-style-list .rpt-grid-scroll-wrapper, .rpt-style-comparison .rpt-list-view-wrapper { display: none; visibility: hidden; opacity: 0; }
.rpt-style-list .rpt-list-view-wrapper, .rpt-style-comparison .rpt-grid-scroll-wrapper { visibility: visible; opacity: 1; }
.rpt-tier-tagline { font-size: 14px; color: #6b7280; margin: 0; font-weight: normal; min-height: 1.2em; }
.rpt-price-period--lifetime { font-weight: 600; color: #111827; }

/* --- New Unified Filter Popover Styles --- */
.rpt-filters-wrapper { position: relative; display: inline-block; }
.rpt-filters-button { background: var(--rpt-bg-light); border: 1px solid var(--rpt-border-color); border-radius: 5px; padding: 8px 12px; cursor: pointer; color: var(--rpt-primary-color); font-size: 14px; line-height: 1; display: inline-flex; align-items: center; gap: 5px; transition: background-color 0.2s ease, color 0.2s ease; position: relative; }
.rpt-filters-button:hover { background: var(--rpt-bg-hover); }
.rpt-filters-button .dashicons { font-size: 18px; color: var(--rpt-primary-color); }

.rpt-filter-badge { position: absolute; top: -5px; right: -5px; background-color: #d63638; color: white; border-radius: 50%; width: 10px; height: 10px; display: block; }

.rpt-filters-popover { display: none; position: absolute; top: 110%; left: 50%; transform: translateX(-50%); width: 380px; max-width: 90vw; background-color: var(--rpt-bg-light); border: 1px solid #ddd; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.15); z-index: 100; text-align: left; }
.rpt-filters-popover.is-open { display: block; }

.rpt-popover-header { padding: 15px; border-bottom: 1px solid #eee; }
.rpt-popover-header h3 { margin: 0 0 5px 0; font-size: 16px; font-weight: 600; color: #111827; }
.rpt-popover-header .rpt-popover-status { margin: 0; font-size: 15px; color: #6b7280; text-align: center; }

.rpt-popover-top-actions { padding: 15px; border-bottom: 1px solid #eee; background-color: #f9f9f9; }

.rpt-popover-section { padding: 15px; border-bottom: 1px solid #eee; }
.rpt-popover-section:last-child { border-bottom: none; }
.rpt-popover-section > h4 { margin: 0 0 15px 0; font-size: 14px; font-weight: 600; }

.rpt-popover-scrollable-list { max-height: 150px; overflow-y: auto; padding-right: 10px; }
.rpt-popover-scrollable-list ul { list-style: none; margin: 0; padding: 0; }
.rpt-popover-scrollable-list li { padding: 2px 0; }
.rpt-popover-scrollable-list li label { display: flex; align-items: center; gap: 8px; font-weight: normal; cursor: pointer; font-size: 14px; }
.rpt-popover-scrollable-list li label input[type="checkbox"] { margin: 0; }

.rpt-filters-popover .rpt-button {
    width: 100%;
    padding: 10px 15px;
    border-radius: 5px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s ease, opacity 0.2s ease;
    box-sizing: border-box;
    border-style: solid;
    border-width: 1px;
}

.rpt-filters-popover .rpt-button-primary {
    background-color: var(--rpt-primary-color);
    color: var(--rpt-bg-light);
    border-color: var(--rpt-primary-color);
}
.rpt-filters-popover .rpt-button-primary:hover {
    background-color: #005a87;
}
.rpt-filters-popover .rpt-button-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.rpt-filters-popover .rpt-button-secondary {
    background: var(--rpt-bg-hover);
    border-color: var(--rpt-border-color);
    color: var(--rpt-text-color);
    margin-top: 15px;
}
.rpt-filters-popover .rpt-button-secondary:hover {
    background-color: #e5e7eb;
}


/* --- Highlight Differences and Tier/Message Styles --- */
.rpt-highlight-diff-wrapper { display: flex; align-items: center; justify-content: flex-start; width: 100%; }
.rpt-highlight-diff-wrapper { display: none; }
.rpt-style-comparison.rpt-is-comparing .rpt-highlight-diff-wrapper { display: flex; }
.rpt-highlight-diff-wrapper label { display: flex; align-items: center; gap: 8px; font-weight: normal; cursor: pointer; font-size: 14px; }
.rpt-highlight-diff-wrapper input[type="checkbox"] { margin: 0; }
.rpt-feature-row-faded { opacity: 0.3; transition: opacity 0.3s ease-in-out; }
.rpt-feature-row-faded:hover { opacity: 1; }

.rpt-tier-is-hidden { display: none !important; }

.rpt-table-is-hidden { display: none !important; }

.rpt-style-comparison .rpt-col-is-hidden {
    flex-grow: 0 !important;
    flex-basis: 0 !important;
    min-width: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    opacity: 0;
    overflow: hidden;
    white-space: nowrap;
}

.rpt-no-tiers-message {
    border: 1px dashed var(--rpt-border-color);
    padding: 40px 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    background-color: #f9f9f9;
    text-align: center;
    color: #555;
    font-size: 16px;
}
.rpt-no-tiers-message span {
    display: block;
    font-size: 13px;
    margin-top: 8px;
    color: #777;
}


/* ==========================================================================
   STYLE 1: List Style (Default)
   ========================================================================== */
.rpt-style-list .rpt-list-view-wrapper { position: relative; }

.rpt-style-list .rpt-pricing-table {
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: stretch;
    margin: 0;
    padding-bottom: 20px;
    max-width: 100%;
}

.rpt-style-list .rpt-tier { flex: 0 0 280px; max-width: 420px; margin: 0 10px 20px 10px; position: relative; --rpt-highlight-color: #0073aa; }
.rpt-style-list .rpt-tier:hover { z-index: 10; }

.rpt-tier-inner-wrap {
    background: var(--rpt-bg-light);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    position: relative;
    border: 1px solid #ddd;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

.rpt-tier-highlighted .rpt-tier-inner-wrap { border: 10px solid var(--rpt-highlight-color); }
.rpt-tier:hover .rpt-tier-inner-wrap { box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1); }
.rpt-style-list .rpt-tier-header { position: relative; padding: 20px 30px; }
.rpt-style-list .rpt-tier-header h3 { margin: 0; margin-top: 25px; font-size: 26px; font-weight: bold; }
.rpt-style-list .rpt-tier-header .rpt-tier-tagline { margin-top: 4px; }
.rpt-style-list .rpt-ribbon-horizontal { top: 10px; left: 0; }
.rpt-tier-highlighted .rpt-ribbon-horizontal { left: 0; }
.rpt-style-list .rpt-tier-price, .rpt-style-list .rpt-tier-footer { padding: 20px 30px; }
.rpt-style-list .rpt-tier-price { padding-top: 15px; }
.rpt-style-list .rpt-price-value { font-size: 42px; font-weight: 700; line-height: 1; color: #000; }
.rpt-style-list .rpt-price-period { font-size: 14px; color: #666; min-height: 1.2em; }
.rpt-style-list .rpt-tier-features { list-style: none; padding: 0; margin: 0 0 20px 0; text-align: center; flex-grow: 1; }
.rpt-style-list .rpt-feature-item { padding: 10px 25px; border-bottom: 1px solid #eee; box-sizing: border-box; }
.rpt-style-list .rpt-feature-item:last-child { border-bottom: none; }
.rpt-style-list .rpt-tier-footer { margin-top: auto; padding-top: 0; }

/* --- Carousel Layout Styles --- */
.rpt-style-list .rpt-pricing-table.rpt-layout-carousel {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: hidden;
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.rpt-style-list .rpt-pricing-table.rpt-layout-carousel::-webkit-scrollbar { display: none; }

.rpt-scroll-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 15;
    background-color: rgba(255, 255, 255, 0.95);
    border: 1px solid #ddd;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: opacity 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}
.rpt-scroll-arrow:hover {
    background-color: #fff;
    transform: translateY(-50%) scale(1.1);
}
.rpt-scroll-arrow .dashicons {
    font-size: 32px;
    width: 32px;
    height: 32px;
    color: var(--rpt-primary-color);
}
.rpt-list-view-wrapper.has-scroll .rpt-scroll-arrow { display: inline-flex; }
.rpt-scroll-arrow--left { left: -22px; }
.rpt-scroll-arrow--right { right: -22px; }
.rpt-scroll-arrow.rpt-arrow-hidden {
    opacity: 0;
    pointer-events: none;
}

/* ==========================================================================
   STYLE 2: Comparison Grid Style (REVISED)
   ========================================================================== */
.rpt-style-comparison .rpt-grid-scroll-wrapper { display: flex; justify-content: center; }
.rpt-grid-scroller { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.rpt-style-comparison .rpt-comparison-grid { display: block; width: max-content; max-width: none; border-radius: 8px; box-shadow: 0 4px 8px rgba(0,0,0,0.05); border: 1px solid #e5e7eb; background-color: #f9fafb }
.rpt-style-comparison .rpt-grid-header-row, .rpt-style-comparison .rpt-grid-feature-row, .rpt-style-comparison .rpt-grid-footer-row { display: flex; width: auto; }
.rpt-style-comparison .rpt-grid-cell { box-sizing: border-box; display: flex; align-items: center; justify-content: center; flex-shrink: 0; width: auto; border-bottom: 1px solid #e5e7eb; border-left: 1px solid #e5e7eb; transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1); padding: 15px 10px; }
.rpt-style-comparison .rpt-grid-cell:first-child { position: -webkit-sticky; position: sticky; left: 0; z-index: 6; background-color: #f9fafb; border-right: 1px solid #e5e7eb; }
.rpt-style-comparison .rpt-grid-header-row .rpt-grid-cell:first-child, .rpt-style-comparison .rpt-grid-feature-row .rpt-grid-cell:first-child { box-shadow: 2px 0 5px rgba(0,0,0,0.05); }
.rpt-style-comparison .rpt-grid-footer-row { position: -webkit-sticky; position: sticky; bottom: 0; z-index: 1; background-color: var(--rpt-bg-light); }
.rpt-style-comparison .rpt-grid-footer-row .rpt-grid-cell:first-child { z-index: 7; }

.rpt-style-comparison .rpt-grid-features-header { font-size: 1.25em; font-weight: 700; }
.rpt-style-comparison .rpt-grid-features-header, .rpt-style-comparison .rpt-grid-feature-name, .rpt-style-comparison .rpt-grid-footer-row .rpt-grid-cell:first-child { flex-basis: 180px; flex-shrink: 0; }
.rpt-style-comparison .rpt-grid-feature-name { font-weight: bold; }
.rpt-style-comparison .rpt-grid-features-header, .rpt-style-comparison .rpt-grid-feature-name { justify-content: flex-end; text-align: right; }
.rpt-style-comparison .rpt-grid-tier-header-cell, .rpt-style-comparison .rpt-grid-tier-cell, .rpt-style-comparison .rpt-grid-footer-row .rpt-grid-cell:not(:first-child) { flex: 1 1 180px; min-width: 180px; }
.rpt-style-comparison .rpt-grid-tier-header-cell { flex-direction: column; justify-content: flex-start; position: relative; --rpt-highlight-color: #0073aa; border-top: 10px solid transparent; }
.rpt-grid-col-highlighted.rpt-grid-tier-header-cell { border-top-color: var(--rpt-highlight-color); }
.rpt-style-comparison .rpt-tier-header { position: static; }
.rpt-style-comparison .rpt-grid-tier-header-cell .rpt-tier-header { padding: 15px 20px 0; }
.rpt-style-comparison .rpt-grid-tier-header-cell .rpt-tier-price { padding: 20px 20px; }
.rpt-style-comparison .rpt-ribbon-horizontal { top: 10px; left: 0; }
.rpt-style-comparison .rpt-grid-tier-header-cell h3 { margin: 0; margin-top: 15px; font-size: 20px; font-weight: 700; }
.rpt-style-comparison .rpt-grid-tier-header-cell .rpt-price-value { font-size: 32px; font-weight: 700; line-height: 1.1; }
.rpt-style-comparison .rpt-grid-tier-header-cell .rpt-price-period { font-size: 13px; color: #6b7280; }
.rpt-style-comparison .rpt-grid-feature-name { word-break: break-word; }
.rpt-style-comparison .rpt-check, .rpt-style-comparison .rpt-cross { font-size: 28px; width: 28px; height: 28px; line-height: 1; }
.rpt-style-comparison .rpt-check { color: #22c55e; }
.rpt-style-comparison .rpt-cross { color: #ef4444; }
.rpt-style-comparison .rpt-grid-footer-row .rpt-grid-cell { border-top: 2px solid #e5e7eb; }

.rpt-style-comparison .rpt-row-odd .rpt-grid-cell { background-color: var(--rpt-zebra-color-1, #f9f9f9); }
.rpt-style-comparison .rpt-row-even .rpt-grid-cell { background-color: var(--rpt-zebra-color-2, #ffffff); }
.rpt-style-comparison .rpt-row-odd .rpt-grid-cell:first-child { background-color: var(--rpt-zebra-color-1, #f3f4f6); }
.rpt-style-comparison .rpt-row-even .rpt-grid-cell:first-child { background-color: var(--rpt-zebra-color-2, #ffffff); }


/* --- RESPONSIVENESS --- */
@media (max-width: 960px) {
    .rpt-toolbar { flex-wrap: wrap; }
    .rpt-toolbar-group--col1 { order: 1; }
    .rpt-toolbar-group--col4 { order: 2; flex-grow: 1; }
    .rpt-toolbar-group--col2 { order: 3; flex-basis: 100%; justify-content: center; }
    .rpt-toolbar-group--col3 { order: 4; flex-basis: 100%; justify-content: center; }
    .rpt-toolbar .rpt-search-wrapper { width: 100%; }
    .rpt-feature-search { max-width: none; }
}

@media (max-width: 600px) {
    .rpt-toolbar-group { flex-basis: 100%; justify-content: center; }
    .rpt-toolbar-group--col1, .rpt-toolbar-group--col4 { flex-grow: 0; }
    .rpt-toolbar-group { margin-bottom: 10px; }

    .rpt-filters-popover {
        left: 0;
        transform: none;
    }
}

@media (max-width: 540px) {
    .rpt-style-list .rpt-pricing-table { display: block; overflow-x: hidden; padding-bottom: 0; }
    .rpt-style-list .rpt-tier { flex-basis: auto; margin-left: auto; margin-right: auto; }
}
