/* ============================================================
   Load More Redesign — shared across all Gallagher listing pages
   Replaces oval "See More" with rectangular "LOAD MORE" + progress bar
   ============================================================ */

/* --- Parent container reset --- */
.tps-diamonds-parent-load-more,
.tps-ringbuilder-load-more-container,
.tps-earringbuilder-load-more-container,
.tps-pendantbuilder-load-more-container,
.tps-rtw-result-viewed-and-load-more {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 40px 20px 50px !important;
    margin: 0 !important;
    row-gap: 0 !important;
    background: transparent !important;
}

/* --- Hide old elements --- */
/* Old "You've viewed X of Y diamonds/rings/products" text */
.tps-diamonds-parent-load-more > .tps-count-view,
.tps-ringbuilder-load-more-container > .tps-count-view,
.tps-earringbuilder-load-more-container > .tps-count-view,
.tps-pendantbuilder-load-more-container > .tps-count-view,
.tps-rtw-result-viewed-and-load-more > .tps-rtw-you-have-viewed {
    display: none !important;
}

/* Old "Use filters to refine your results" */
.tps-visited-diamonds-scroll-top-txt,
.tps-ringbuilder-refine-filters-span,
.tps-earringbuilder-refine-filters-span,
.tps-pendantbuilder-refine-filters-span,
.tps-rtw-refined-your-search {
    display: none !important;
}

/* Old down-arrow ::before on button */
.load-more-container button#load-more::before,
.tps-rtw-result-viewed-and-load-more button::before {
    display: none !important;
    content: none !important;
}

/* Old decorative ::before on .load-more-container */
.load-more-container::before {
    display: none !important;
    content: none !important;
}

/* --- New count display (injected by JS) --- */
.tps-lm-redesign-count {
    font-family: 'Noto Sans', sans-serif;
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 0.15em;
    color: #555;
    text-align: center;
    margin-bottom: 10px;
    text-transform: uppercase;
}

/* --- Progress bar --- */
.tps-lm-redesign-progress {
    width: 200px;
    max-width: 80%;
    height: 1px;
    background: #d4d4d4;
    margin-bottom: 20px;
    position: relative;
}

.tps-lm-redesign-progress-bar {
    height: 100%;
    background: #333;
    position: absolute;
    left: 0;
    top: 0;
    min-width: 2px;
    transition: width 0.4s ease;
}

/* --- Redesigned Load More button --- */
.load-more-container button#load-more,
.tps-rtw-load-more-button button,
.tps-rtw-result-viewed-and-load-more button {
    background: transparent !important;
    border: 1px solid #555 !important;
    border-radius: 0 !important;
    color: #333 !important;
    padding: 12px 40px !important;
    cursor: pointer;
    display: inline-block !important;
    margin: 0 auto !important;
    position: relative !important;
    left: auto !important;
    right: auto !important;
    width: auto !important;
    height: auto !important;
    top: auto !important;
    font-family: 'Noto Sans', sans-serif !important;
    font-size: 12px !important;
    font-weight: 400 !important;
    letter-spacing: 0.18em !important;
    line-height: 1 !important;
    text-transform: uppercase !important;
    transition: background 0.2s ease, color 0.2s ease;
}

/* Dark fill is only for the bordered pill button (diamond/gemstone listings).
   The RTW listings use .tps-loadmore-btn, which stays transparent in every
   state - see "Load more: thin progress line" in common.css. */
.load-more-container button#load-more:hover,
.load-more-container button#load-more:focus {
    background: #333 !important;
    color: #fff !important;
    outline: none;
}

/* Every listing that uses the pill markup keeps a transparent background in all
   interactive states, matching the RTW listings. Scoped by body class so no
   other button on the site is affected.
     tps-page-ringbuilder-setting_listing    - Engagement Ring Settings
     tps-page-pendantbuilder-setting_listing - Pendant Settings
     tps-page-earringbuilder-setting_listing - Earring Settings
     tps-page-ringbuilder-diamond_listing    - all 5 Diamond & Gemstone listings */
body.tps-page-ringbuilder-setting_listing .load-more-container button#load-more:hover,
body.tps-page-ringbuilder-setting_listing .load-more-container button#load-more:focus,
body.tps-page-ringbuilder-setting_listing .load-more-container button#load-more:active,
body.tps-page-pendantbuilder-setting_listing .load-more-container button#load-more:hover,
body.tps-page-pendantbuilder-setting_listing .load-more-container button#load-more:focus,
body.tps-page-pendantbuilder-setting_listing .load-more-container button#load-more:active,
body.tps-page-earringbuilder-setting_listing .load-more-container button#load-more:hover,
body.tps-page-earringbuilder-setting_listing .load-more-container button#load-more:focus,
body.tps-page-earringbuilder-setting_listing .load-more-container button#load-more:active,
body.tps-page-ringbuilder-diamond_listing .load-more-container button#load-more:hover,
body.tps-page-ringbuilder-diamond_listing .load-more-container button#load-more:focus,
body.tps-page-ringbuilder-diamond_listing .load-more-container button#load-more:active {
    background: transparent !important;
    color: #333 !important;
}

/* Keyboard focus ring */
.load-more-container button#load-more:focus-visible,
.tps-rtw-load-more-button button:focus-visible,
.tps-rtw-result-viewed-and-load-more button:focus-visible {
    outline: 2px solid #333 !important;
    outline-offset: 3px;
}

/* --- Loading spinner state --- */
.load-more-container button#load-more.tps-lm-loading,
.tps-rtw-load-more-button button.tps-lm-loading,
.tps-rtw-result-viewed-and-load-more button.tps-lm-loading {
    pointer-events: none;
    opacity: 0.6;
}

/* --- .load-more-container itself — reset any old layout --- */
.load-more-container {
    text-align: center !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    position: static !important;
    background: transparent !important;
}

/* RTW button wrapper */
.tps-rtw-load-more-button {
    text-align: center !important;
}

/* --- The whole Load More section is hidden by JS scroll-tracking
       and revealed only after 5 scroll gestures + reaching end --- */
.tps-lm-scroll-gated {
    opacity: 0 !important;
    visibility: hidden !important;
    /* No transition on the hidden state — avoids stuck-animation browser bug.
       The reveal transition lives on .tps-lm-revealed instead. */
}
.tps-lm-scroll-gated.tps-lm-revealed {
    opacity: 1 !important;
    visibility: visible !important;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

/* --- tps-count-container class (used when load-more hidden to style count) --- */
.tps-count-view.tps-count-container {
    display: none !important;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 768px) {
    .tps-diamonds-parent-load-more,
    .tps-ringbuilder-load-more-container,
    .tps-earringbuilder-load-more-container,
    .tps-pendantbuilder-load-more-container,
    .tps-rtw-result-viewed-and-load-more {
        padding: 30px 15px 40px !important;
    }

    .tps-lm-redesign-progress {
        width: 160px;
    }

    .load-more-container button#load-more,
    .tps-rtw-load-more-button button,
    .tps-rtw-result-viewed-and-load-more button {
        padding: 11px 32px !important;
        font-size: 11px !important;
    }
}

@media (max-width: 480px) {
    .tps-lm-redesign-progress {
        width: 140px;
    }

    .load-more-container button#load-more,
    .tps-rtw-load-more-button button,
    .tps-rtw-result-viewed-and-load-more button {
        padding: 10px 28px !important;
    }
}

/* --- Nothing left to load (current >= total): the Load More section is
       removed from the layout entirely, on every listing page. display:none
       rather than the visibility-based gating above, so it reserves no height
       in front of the footer. --- */
.tps-lm-complete {
    display: none !important;
}

/* ============================================================
   Consistent spacing + button treatment on every listing family
   ------------------------------------------------------------
   The base rules above are specificity (0,1,1); several plugin
   stylesheets carry equally specific or heavier rules for the same
   buttons (e.g. rtw-products.css .tps-rtw-result-viewed-and-load-more
   button, pendantbuilder-settings.css .load-more-container
   button#load-more, and a media-query rule scoped to
   .tps-pendantbuilder-item-listing-wrapper-div). Re-asserting the
   treatment here with a body-level prefix keeps the section identical
   across the ringbuilder, pendant, earring and RTW listings whatever
   order the stylesheets happen to print in.
   ============================================================ */

body .tps-diamonds-parent-load-more,
body .tps-ringbuilder-load-more-container,
body .tps-earringbuilder-load-more-container,
body .tps-pendantbuilder-load-more-container,
body .tps-rtw-result-viewed-and-load-more {
    padding: 32px 20px 36px !important;   /* was 40px 20px 50px - trims the gap before the footer */
}

body .tps-lm-redesign-count {
    margin-bottom: 10px !important;
}

body .tps-lm-redesign-progress {
    width: 200px !important;
    max-width: 80% !important;
    height: 1px !important;
    margin: 0 auto 20px !important;
}

body .load-more-container button#load-more,
body .tps-pendantbuilder-item-listing-wrapper-div .load-more-container button#load-more,
body .tps-ringbuilder-item-listing-wrapper-div .load-more-container button#load-more,
body .tps-rtw-load-more-button button,
body .tps-rtw-result-viewed-and-load-more button {
    display: inline-block !important;
    width: auto !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 auto !important;
    padding: 12px 40px !important;
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    border: 1px solid #555 !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: #333 !important;
    font-family: 'Noto Sans', sans-serif !important;
    font-size: 12px !important;
    font-weight: 400 !important;
    letter-spacing: 0.18em !important;
    line-height: 1 !important;
    text-transform: uppercase !important;
}
