/* This file is part of the blocking single-deferred stylesheet on product
   pages. Own the final offer geometry here: the two plugins' earlier critical
   blocks disagree, and the shared compset stylesheet deliberately loads async.
   Scoped parity below keeps the existing final desktop/mobile design without
   making the complete shared compset stylesheet a first-paint dependency. */


.pt-price-filters {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 !important;
    margin: 0 !important;
}

.pt-price-filters__left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pt-price-filters__pill {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.pt-price-filters__pill input {
    display: none;
}

.pt-price-filters__pill span {
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    color: var(--pt-color-gray-700, #374151);
    background: #fff;
    border: 1px solid var(--pt-color-gray-300, #d1d5db);
    border-radius: 999px;
    transition: all 0.2s;
}

.pt-price-filters__pill:hover span {
    background: var(--pt-color-gray-50, #f9fafb);
    border-color: var(--pt-color-gray-400, #9ca3af);
}

.pt-price-filters__pill input:checked + span {
    background: var(--pt-color-gray-900, #111827);
    color: #fff;
    border-color: var(--pt-color-gray-900, #111827);
}

.pt-price-filters__right {
    display: flex;
    align-items: center;
}

.pt-price-filters__dropdown {
    position: relative;
    display: block;
    width: 220px;
    min-width: 220px;
    height: 42px;
    min-height: 42px;
    box-sizing: border-box;
    background: #fff;
    border: 1px solid var(--pt-color-gray-300, #d1d5db);
    border-radius: 999px;
}

.pt-price-filters__dropdown select {
    display: block;
    appearance: none;
    padding: 10px 36px 10px 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--pt-color-gray-700, #374151);
    background: transparent;
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    width: 100%;
    min-width: 0;
    height: 40px;
    min-height: 40px;
    box-sizing: border-box;
}

.pt-price-filters__dropdown select:focus {
    outline: none;
}

.pt-price-filters__dropdown:focus-within {
    border-color: var(--pt-color-primary, #3b82f6);
}

.pt-price-filters__dropdown-trigger,
.pt-price-filters__dropdown-menu {
    display: none;
}

/* Defensive: the user-agent `[hidden] { display: none }` rule has very low
   specificity (0,0,1) so the !important `display:flex` rules further down
   for `.pt-price-filters__dropdown-trigger` and the bare menu's later
   `display: flex` win without this guard. Without it, the trigger button
   and the entire menu (with all option buttons) flash visible during the
   LiteSpeed CSS-loaded-but-JS-not-yet window — that's what the "filter
   dropdown loads weirdly" report was. This rule keeps the elements hidden
   for as long as PHP renders them with the `hidden` HTML attribute.       */
.pt-price-filters__dropdown-trigger[hidden],
.pt-price-filters__dropdown-menu[hidden] {
    display: none !important;
}

.pt-price-filters__dropdown--enhanced select {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    border: 0 !important;
}

.pt-price-filters__dropdown--enhanced .pt-price-filters__dropdown-trigger {
    display: flex !important;
}

.pt-price-filters__dropdown--enhanced {
    border-color: var(--pt-color-gray-300, #d1d5db) !important;
}

.pt-price-filters__dropdown--enhanced.is-open {
    border-color: var(--pt-color-gray-400, #9ca3af) !important;
}

.pt-price-filters__dropdown--enhanced .pt-price-filters__dropdown-menu {
    display: flex;
}

.pt-price-filters__dropdown--enhanced .pt-price-filters__dropdown-menu[hidden] {
    display: none !important;
}

.pt-price-filters__dropdown-trigger {
    width: 100% !important;
    height: 40px !important;
    display: flex !important;
    align-items: center !important;
    gap: 9px !important;
    padding: 10px 16px !important;
    min-height: 40px !important;
    box-sizing: border-box !important;
    border-radius: 999px !important;
    border: none !important;
    background: transparent !important;
    color: var(--pt-color-gray-700, #374151) !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    appearance: none !important;
    box-shadow: none !important;
    white-space: nowrap !important;
}
.pt-price-filters__dropdown-trigger:hover {
    background: var(--pt-color-gray-50, #f9fafb) !important;
}

.pt-price-filters__dropdown-trigger:focus-visible {
    outline: none !important;
    box-shadow: 0 0 0 2px rgba(17, 24, 39, 0.12) !important;
}

.pt-price-filters__dropdown-trigger-icon {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: var(--pt-color-gray-500, #6b7280) !important;
}

.pt-price-filters__dropdown-trigger-label {
    flex: 1 !important;
    text-align: left !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.pt-price-filters__dropdown-chevron {
    color: var(--pt-color-gray-500, #6b7280) !important;
    transition: transform 0.12s ease !important;
}

.pt-price-filters__dropdown.is-open .pt-price-filters__dropdown-chevron {
    transform: rotate(180deg);
}

.pt-price-filters__dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 60;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 6px;
    max-height: min(70vh, 320px);
    overflow-y: auto;
    background: #fff;
    border: 1px solid var(--pt-color-gray-200, #e5e7eb);
    border-radius: 14px;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.12);
}

.pt-price-filters__dropdown-option {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    padding: 9px 10px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--pt-color-gray-700, #374151);
    font-size: 14px;
    font-weight: 400;
    text-align: left;
    cursor: pointer;
}

.pt-price-filters__dropdown-option:hover {
    background: var(--pt-color-gray-50, #f9fafb);
}

.pt-price-filters__dropdown-option.is-active {
    background: var(--pt-color-gray-100, #f3f4f6);
    color: var(--pt-color-gray-900, #111827);
}

.pt-price-filters__dropdown-option-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: currentColor;
}

.pt-affiliate-notice {
    margin-top: 16px;
    margin-bottom: 0;
    padding: 0;
    font-size: 12px;
    line-height: 1.5;
    color: var(--pt-color-gray-500, #6b7280);
}

.pt-no-offers {
    padding: 40px;
    text-align: center;
    color: var(--pt-color-gray-500, #6b7280);
    background: var(--pt-color-gray-50, #f9fafb);
    border-radius: 8px;
}

.pt-loading-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 60px 20px;
    color: var(--pt-color-gray-500, #6b7280);
}


.feedtrackr-offer.pt-hidden-by-filter {
    display: none !important;
}

.pt-price-section .feedtrackr-lowest-banner {
    display: none !important;
}

.pt-price-section .feedtrackr-compset {
    margin-top: 0 !important;
    background: transparent !important;
}

.pt-price-section .feedtrackr-offers {
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    min-height: 0 !important;
}

.pt-price-section .feedtrackr-offers:empty {
    min-height: 220px !important;
}

.pt-price-section .feedtrackr-offer,
.pt-price-section .feedtrackr-offer:hover,
.pt-price-section .feedtrackr-offer:active,
.pt-price-section .feedtrackr-compset--allstores .feedtrackr-offer,
.pt-price-section .feedtrackr-compset--allstores .feedtrackr-offer:hover {
    background: #fff !important;
    box-shadow: none !important;
}

.pt-price-section .feedtrackr-compset--allstores .feedtrackr-offer--best,
.pt-price-section .feedtrackr-compset--allstores .feedtrackr-offer--best:hover,
.pt-price-section .feedtrackr-offer.feedtrackr-offer--best {
    border-color: var(--pt-color-gray-200, #e5e7eb) !important;
    border-width: 1px !important;
    box-shadow: none !important;
    background: #fff !important;
}

.pt-price-section .feedtrackr-compset--allstores .feedtrackr-offer--best::before {
    display: none !important;
}

@media (max-width: 768px) {
    .pt-price-filters {
        flex-wrap: nowrap;
        align-items: flex-start;
        gap: 8px;
        overflow: visible;
        padding-bottom: 4px;
    }

    .pt-price-filters__left {
        width: auto;
        flex: 1 1 auto;
        min-width: 0;
        flex-shrink: 1;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 0;
        gap: 8px;
    }

    .pt-price-filters__pill {
        flex: 0 0 auto;
    }

    .pt-price-filters__pill span {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .pt-price-filters__left::-webkit-scrollbar {
        display: none;
    }
    
    .pt-price-filters__right {
        width: auto;
        flex-shrink: 0;
        position: relative;
        z-index: 80;
    }
    
    .pt-price-filters__dropdown {
        /* 144px outer pill = 142px content + the two reserved 1px borders. */
        width: 144px !important;
        min-width: 144px !important;
        max-width: 144px !important;
        height: 42px !important;
        min-height: 42px !important;
    }

    .pt-price-filters__dropdown select,
    .pt-price-filters__dropdown-trigger {
        width: 100% !important;
        min-width: 0 !important;
        height: 40px !important;
        min-height: 40px !important;
    }

    .pt-price-filters__dropdown select,
    .pt-price-filters__dropdown-trigger {
        gap: 8px !important;
        padding: 8px 12px !important;
        font-size: 12px !important;
    }

    .pt-price-filters__dropdown select {
        padding-right: 30px !important;
    }

    .pt-price-filters__dropdown-menu {
        min-width: 210px;
        right: 0;
        left: auto;
    }
}

/* Product offer geometry must be final before the async shared skin arrives. */
.pt-price-section .feedtrackr-compset {
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 1.5rem;
}

.pt-price-section .feedtrackr-offers {
    gap: 0;
    overflow: hidden;
}

.pt-price-section .feedtrackr-offer {
    display: grid;
    padding: 16px 20px;
    gap: 16px;
}

/* Keep the existing show-more state stronger than the scoped row layout. */
.pt-price-section .feedtrackr-compset:not(.is-expanded) .feedtrackr-offer--hidden {
    display: none;
}

.pt-price-section .feedtrackr-offer__merchant {
    gap: 14px;
}

.pt-price-section .feedtrackr-offer__logo img {
    max-width: 40px;
    max-height: 32px;
}

.pt-price-section .feedtrackr-offer__logo-text {
    font-size: 10px;
    font-weight: 600;
    text-align: center;
    line-height: 1.2;
    padding: 4px;
    word-break: break-word;
}

.pt-price-section .feedtrackr-offer__name {
    font-size: 15px;
}

.pt-price-section .feedtrackr-offer__meta {
    gap: 10px;
    font-size: 13px;
}

.pt-price-section .feedtrackr-offer__stock,
.pt-price-section .feedtrackr-offer__rating {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.pt-price-section .feedtrackr-offer__stock {
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.pt-price-section .feedtrackr-offer__stock svg {
    flex-shrink: 0;
}

.pt-price-section .feedtrackr-offer__shipping,
.pt-price-section .feedtrackr-offer__delivery {
    font-size: 12px;
}

.pt-price-section .feedtrackr-offer__price {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.pt-price-section .feedtrackr-offer__price-current {
    font-size: 18px;
    order: 2;
}

.pt-price-section .feedtrackr-offer__price--sale .feedtrackr-offer__price-current {
    color: #dc2626;
}

.pt-price-section .feedtrackr-offer__price-old {
    font-size: 13px;
    order: 1;
}

.pt-price-section .feedtrackr-offer__price-badge {
    display: none;
}

@media (max-width: 640px) {
    .pt-price-section .feedtrackr-compset { margin-bottom: 1rem; }
    .pt-price-section .feedtrackr-offer { display: flex; }
    .pt-price-section .feedtrackr-offer__info { flex: 1; gap: 1px; }
    .pt-price-section .feedtrackr-offer__meta { gap: 4px 8px; font-size: 11px; }
    .pt-price-section .feedtrackr-offer__price { flex-shrink: 0; flex-wrap: nowrap; }
}

@media (max-width: 380px) {
    .pt-price-section .feedtrackr-offer__meta { font-size: 10px; }
}

/* Keep the accessible label out of layout even when theme CSS is async. */
.pt-price-filters__dropdown > .screen-reader-text {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(1px, 1px, 1px, 1px) !important;
    clip-path: inset(50%) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* SSR and enhanced mode share one visible shell. Before JS is ready, the
   transparent native select remains the actual pointer/keyboard control. */
.pt-price-filters__dropdown:not(.pt-price-filters__dropdown--enhanced) select {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 40px;
    margin: 0;
    opacity: 0;
    z-index: 2;
}

.pt-price-filters__dropdown:not(.pt-price-filters__dropdown--enhanced) .pt-price-filters__dropdown-trigger,
.pt-price-filters__dropdown--enhanced select {
    pointer-events: none;
}

.pt-price-filters__dropdown--enhanced .pt-price-filters__dropdown-trigger {
    pointer-events: auto;
}

.pt-price-filters__dropdown:focus-within {
    border-color: var(--pt-color-primary, #3b82f6) !important;
    box-shadow: 0 0 0 2px rgba(17, 24, 39, 0.12);
}
