/* Catalogue refresh: focused UI improvements for archive-profile page only */

body.post-type-archive-profile {
    --catalog-header-height: 78px;
    --catalog-first-card-height: clamp(390px, calc(100svh - var(--catalog-header-height) - 210px), 452px);
}

/* Header favorites block */
body.post-type-archive-profile .selection-heart-btn,
body.single-profile .selection-heart-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.14);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.28s ease, background-color 0.28s ease, border-color 0.28s ease;
}

body.post-type-archive-profile .selection-heart-btn:hover,
body.post-type-archive-profile .selection-heart-btn:focus-visible,
body.single-profile .selection-heart-btn:hover,
body.single-profile .selection-heart-btn:focus-visible {
    background: rgba(0, 0, 0, 0.22);
    border-color: rgba(255, 255, 255, 0.35);
    transform: translateY(-1px);
}

body.post-type-archive-profile .selection-heart-btn .heart-text,
body.single-profile .selection-heart-btn .heart-text {
    display: inline-block;
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    letter-spacing: 1px;
}

body.post-type-archive-profile .selection-heart-btn .heart-icon,
body.single-profile .selection-heart-btn .heart-icon {
    width: 22px;
    height: 22px;
    fill: #ffffff;
}

body.post-type-archive-profile .selection-heart-btn .selection-count,
body.single-profile .selection-heart-btn .selection-count {
    display: none;
}

body.post-type-archive-profile .selection-heart-btn::after,
body.single-profile .selection-heart-btn::after {
    content: attr(data-count);
    position: absolute;
    top: -6px;
    right: -6px;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #c62828;
    color: #f8f8f8;
    border-radius: 50%;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    opacity: 0;
    transform: scale(0.85);
    transition: opacity 0.28s ease, transform 0.28s ease;
    z-index: 10;
}

body.post-type-archive-profile .selection-heart-btn[data-count]:not([data-count="0"])::after,
body.single-profile .selection-heart-btn[data-count]:not([data-count="0"])::after {
    opacity: 1;
    transform: scale(1);
}

body.post-type-archive-profile .selection-heart-btn .heart-icon,
body.post-type-archive-profile .selection-heart-btn.has-selection .heart-icon,
body.post-type-archive-profile .selection-heart-btn.heart-pulse .heart-icon,
body.single-profile .selection-heart-btn .heart-icon,
body.single-profile .selection-heart-btn.has-selection .heart-icon,
body.single-profile .selection-heart-btn.heart-pulse .heart-icon {
    animation: none !important;
}

/* Catalogue page layout */
body.post-type-archive-profile .catalogue-section {
    padding: calc(var(--catalog-header-height) + 10px) 12px 80px;
}

body.post-type-archive-profile .catalogue-header {
    position: sticky;
    top: var(--catalog-header-height);
    z-index: 999;
    width: 100vw;
    margin: 0 calc(50% - 50vw) 14px;
    padding: 0 10px;
}

body.post-type-archive-profile .age-filter-container--catalog {
    width: 100%;
    margin: 0;
    padding: 0;
}

body.post-type-archive-profile .age-filter-wrapper--catalog {
    width: 100%;
    min-height: 96px;
    padding: 12px 14px 10px;
    border-radius: 20px;
    border: 1px solid #886b5f;
    background: rgba(136, 107, 95, 0.1);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
}

body.post-type-archive-profile .age-filter-header {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0;
}

body.post-type-archive-profile .age-filter-label {
    color: #ffffff;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
}

body.post-type-archive-profile .age-years {
    margin-left: 4px;
}

body.post-type-archive-profile .age-slider-container {
    position: relative;
    width: 100%;
    height: 44px;
    padding-top: 8px;
}

body.post-type-archive-profile .age-slider-track {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 6px;
    transform: translateY(-50%);
    border-radius: 999px;
    background: #444444;
}

body.post-type-archive-profile .age-slider-track-active {
    position: absolute;
    top: 0;
    height: 100%;
    border-radius: 999px;
    background: #ccc0b2;
    box-shadow: 0 0 0 1px rgba(204, 192, 178, 0.35);
    transition: left 0.28s ease, width 0.28s ease;
}

body.post-type-archive-profile .age-slider-input {
    position: absolute;
    width: 100%;
    height: 44px;
    top: 0;
    left: 0;
    pointer-events: none;
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    margin: 0;
}

body.post-type-archive-profile .age-slider-min {
    z-index: 3;
}

body.post-type-archive-profile .age-slider-max {
    z-index: 4;
}

body.post-type-archive-profile .age-slider-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    pointer-events: auto;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 3px solid #ccc0b2;
    background: #ffffff;
    cursor: grab;
    transition: transform 0.28s ease, box-shadow 0.28s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

body.post-type-archive-profile .age-slider-input::-webkit-slider-thumb:active {
    cursor: grabbing;
    transform: scale(1.04);
}

body.post-type-archive-profile .age-slider-input::-moz-range-thumb {
    pointer-events: auto;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 3px solid #ccc0b2;
    background: #ffffff;
    cursor: grab;
    transition: transform 0.28s ease, box-shadow 0.28s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

body.post-type-archive-profile .age-slider-input::-moz-range-track {
    background: transparent;
    border: none;
}

body.post-type-archive-profile .age-filter-loading {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    display: none;
    align-items: center;
    justify-content: center;
}

body.post-type-archive-profile .age-filter-loading.active {
    display: inline-flex;
}

body.post-type-archive-profile .spinner {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.35);
    border-top-color: #ccc0b2;
    animation: ageSpinner 0.8s linear infinite;
}

@keyframes ageSpinner {
    to { transform: rotate(360deg); }
}

/* Profile cards: only height + gap tweaks */
body.post-type-archive-profile .profile-grid {
    position: relative;
    gap: 28px;
    margin-top: 8px;
}

body.post-type-archive-profile .profile-card {
    border-radius: 20px;
    border: 1px solid #886b5f;
}

body.post-type-archive-profile .profile-card--stub {
    cursor: default;
}

body.post-type-archive-profile .profile-card--stub:hover {
    transform: none;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.22);
}

body.post-type-archive-profile .profile-card--stub:active::after {
    animation: none;
}

body.post-type-archive-profile .profile-card--stub img {
    filter: saturate(0.74) brightness(0.7);
}

body.post-type-archive-profile .profile-card__image--stub {
    min-height: 478px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at center, rgba(204, 192, 178, 0.14) 0%, rgba(136, 107, 95, 0.08) 28%, rgba(87, 0, 9, 0.92) 100%);
}

body.post-type-archive-profile .profile-card__brand-mark {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 146px;
    height: 146px;
    border-radius: 999px;
    border: 1px solid rgba(229, 211, 179, 0.28);
    background: rgba(255, 255, 255, 0.03);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.26);
}

body.post-type-archive-profile .profile-card__brand-mark img {
    width: 84px;
    height: auto;
    filter: none;
    opacity: 0.92;
}

body.post-type-archive-profile .profile-card__overlay--stub {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 8px;
    padding: 22px 16px 18px;
    background: linear-gradient(to top, rgba(87, 0, 9, 0.96) 0%, rgba(87, 0, 9, 0.8) 54%, rgba(87, 0, 9, 0.28) 100%);
}

body.post-type-archive-profile .profile-card__eyebrow {
    margin: 0;
    color: #ccc0b2;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

body.post-type-archive-profile .profile-card--stub .profile-card__overlay h3 {
    margin-bottom: 6px;
}

body.post-type-archive-profile .profile-card--stub .profile-card__overlay p:not(.profile-card__eyebrow) {
    line-height: 1.5;
}

body.post-type-archive-profile .cta-button.profile-card__stub-cta {
    width: 100% !important;
    max-width: 360px !important;
    min-width: auto !important;
    margin-left: auto;
    margin-right: auto;
    margin-top: 12px;
    padding: 16px 20px !important;
    text-align: center;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
}

@media (max-width: 768px) {
    body.post-type-archive-profile .profile-card__image--stub {
        min-height: 420px;
    }

    body.post-type-archive-profile .profile-card__brand-mark {
        width: 126px;
        height: 126px;
    }

    body.post-type-archive-profile .profile-card__brand-mark img {
        width: 72px;
    }
}

body.post-type-archive-profile .profile-card img {
    height: 478px;
}

body.post-type-archive-profile .profile-grid.profile-grid--peek .profile-card:first-child {
    position: relative;
    z-index: 2;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

body.post-type-archive-profile .profile-grid.profile-grid--peek::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: calc(var(--catalog-first-card-height) - 10px);
    height: 110px;
    background: linear-gradient(to bottom, rgba(87, 0, 9, 0) 0%, rgba(87, 0, 9, 0.14) 48%, rgba(87, 0, 9, 0.46) 100%);
    pointer-events: none;
    z-index: 3;
}

body.post-type-archive-profile .profile-grid.profile-grid--peek > * {
    position: relative;
}

body.post-type-archive-profile .profile-grid.profile-grid--peek .profile-card:first-child img {
    height: var(--catalog-first-card-height);
}

@media (min-width: 769px) {
    body.post-type-archive-profile .profile-grid.profile-grid--peek::after {
        display: none;
    }

    body.post-type-archive-profile .profile-grid.profile-grid--peek .profile-card:first-child {
        box-shadow: 0 10px 26px rgba(0, 0, 0, 0.22);
    }

    body.post-type-archive-profile .profile-grid.profile-grid--peek .profile-card:first-child img {
        height: 478px;
    }
}

/* Scroll hint */
body.post-type-archive-profile .catalog-scroll-hint {
    width: 100%;
    margin: 10px 0 4px;
    text-align: center;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: opacity 0.3s ease, max-height 0.3s ease, margin 0.3s ease;
}

body.post-type-archive-profile .catalog-scroll-hint.is-visible {
    opacity: 0.75;
    max-height: 72px;
    margin: 10px 0 8px;
}

body.post-type-archive-profile .catalog-scroll-hint.is-hidden {
    opacity: 0;
    max-height: 0;
    margin: 0;
}

body.post-type-archive-profile .catalog-scroll-hint__arrow {
    color: rgba(255, 255, 255, 0.7);
    font-size: 28px;
    line-height: 1;
}

body.post-type-archive-profile .catalog-scroll-hint__text {
    margin-top: 2px;
    color: rgba(255, 255, 255, 0.75);
    font-size: 15px;
    line-height: 1.25;
}

@media (min-width: 769px) {
    body.post-type-archive-profile .catalog-scroll-hint {
        display: none !important;
    }
}

@media (max-width: 428px) {
    body.post-type-archive-profile .selection-heart-btn {
        padding: 8px 10px;
        gap: 6px;
    }

    body.post-type-archive-profile .selection-heart-btn .heart-text {
        font-size: 18px;
    }

    body.post-type-archive-profile .catalogue-section {
        padding: calc(var(--catalog-header-height) + 8px) 10px 72px;
    }

    body.post-type-archive-profile .catalogue-header {
        padding: 0 8px;
    }

    body.post-type-archive-profile .age-filter-wrapper--catalog {
        min-height: 94px;
        padding: 12px 12px 10px;
    }

    body.post-type-archive-profile .age-filter-label {
        font-size: 18px;
    }

    body.post-type-archive-profile .profile-grid {
        gap: 28px;
    }

    body.post-type-archive-profile .profile-card img {
        height: 470px;
    }

    body.post-type-archive-profile .catalog-scroll-hint__text {
        font-size: 15px;
    }
}

/* ========================= AD CARD COMPONENT ========================= */
body.post-type-archive-profile .ad-card {
    display: flex;
    flex-direction: column;
    height: 478px;
    background: #4A0404;
    border: 1px solid rgba(229, 211, 179, 0.4);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
}

body.post-type-archive-profile .ad-card__top {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    background: linear-gradient(to bottom, #5a0505, #4A0404);
    padding: 32px 20px;
}

body.post-type-archive-profile .ad-card__text-brand {
    margin: 0;
    font-family: var(--font-serif);
    font-size: 32px;
    font-weight: 700;
    letter-spacing: 0.5em;
    text-transform: uppercase;
    color: #E5D3B3;
    opacity: 0.2;
    text-align: center;
}

body.post-type-archive-profile .ad-card__bottom {
    display: flex;
    flex-direction: column;
    padding: 20px 16px;
    background: #4A0404;
}

body.post-type-archive-profile .ad-card__title {
    margin: 0 0 32px 0;
    font-family: var(--font-serif);
    font-size: 24px;
    font-weight: 900;
    color: #FFFFFF;
    line-height: 1.2;
}

body.post-type-archive-profile .ad-card__cta {
    padding: 22px 16px;
    background: #D9C5B2;
    color: #4A0404;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 18px;
    font-weight: 900;
    text-align: center;
    letter-spacing: -0.02em;
    border-radius: 8px;
    transition: background 0.2s ease, transform 0.2s ease;
    line-height: 1.3;
}

body.post-type-archive-profile .ad-card:hover .ad-card__cta {
    background: #E5D3B3;
}

body.post-type-archive-profile .ad-card:active .ad-card__cta {
    transform: scale(0.95);
}

@media (max-width: 768px) {
    body.post-type-archive-profile .ad-card {
        height: 470px;
        border-radius: 8px;
    }

    body.post-type-archive-profile .ad-card__text-brand {
        font-size: 28px;
        letter-spacing: 0.4em;
    }

    body.post-type-archive-profile .ad-card__title {
        font-size: 20px;
        margin-bottom: 26px;
    }

    body.post-type-archive-profile .ad-card__cta {
        font-size: 16px;
        font-weight: 900;
        padding: 20px 12px;
    }
}
