/* user-profile.php — точная копия макета (фото-референс) */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

body.up-photo-body {
    background: #f5f5fa;
}

.up-photo {
    --up-bg: #f5f5fa;
    --up-surface: #ffffff;
    --up-primary: #6a0dad;
    --up-primary-hover: #5a0b94;
    --up-primary-soft: #f3ebff;
    --up-text: #1e1b2e;
    --up-muted: #7a7f8f;
    --up-border: #e8e8f0;
    --up-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    --up-radius: 20px;
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    color: var(--up-text);
    background: var(--up-bg);
    padding: 1.25rem 0 3rem;
}

.up-photo *,
.up-photo *::before,
.up-photo *::after {
    box-sizing: border-box;
}

.up-photo__container {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* —— Хлебные крошки —— */
.up-photo__crumbs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 0.9rem 1.15rem;
    background: var(--up-surface);
    border-radius: var(--up-radius);
    box-shadow: var(--up-shadow);
    font-size: 0.9rem;
}

.up-photo__crumbs a {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--up-primary);
    text-decoration: none;
    font-weight: 600;
}

.up-photo__crumbs a:hover {
    color: var(--up-primary-hover);
}

.up-photo__crumbs a i {
    font-size: 0.95rem;
}

.up-photo__crumbs span {
    color: var(--up-muted);
    font-weight: 600;
}

/* —— Сетка —— */
.up-photo__grid {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
}

.up-photo__side,
.up-photo__main {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 0;
}

/* —— Карточка —— */
.up-photo__card {
    background: var(--up-surface);
    border-radius: var(--up-radius);
    box-shadow: var(--up-shadow);
    overflow: hidden;
}

.up-photo__card-pad {
    padding: 1.35rem 1.25rem 1.25rem;
}

/* —— Профиль (сайдбар) —— */
.up-photo__profile {
    text-align: center;
}

.up-photo__avatar {
    width: 96px;
    height: 96px;
    margin: 0 auto 0.85rem;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid #e9dff8;
    box-shadow: 0 4px 14px rgba(106, 13, 173, 0.12);
}

.up-photo__avatar img,
.up-photo__avatar .up-photo__avatar-fallback {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.up-photo__avatar-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 2.25rem;
    font-weight: 800;
}

.up-photo__name {
    margin: 0 0 1rem;
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--up-primary);
    line-height: 1.2;
}

.up-photo__loyalty {
    margin-bottom: 1rem;
    padding: 0.85rem 0.95rem;
    border: 1px solid var(--up-border);
    border-radius: 14px;
    background: #fafafa;
    text-align: left;
}

.up-photo__loyalty-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.45rem;
    font-size: 0.82rem;
}

.up-photo__loyalty-top span:first-child {
    color: var(--up-muted);
    font-weight: 500;
}

.up-photo__loyalty-level {
    color: var(--up-primary);
    font-weight: 800;
}

.up-photo__loyalty-coin {
    color: #d4a017;
    font-size: 0.9rem;
    margin-right: 0.25rem;
}

.up-photo__loyalty-metrics {
    font-size: 0.82rem;
    color: var(--up-text);
    line-height: 1.45;
}

.up-photo__loyalty-metrics strong {
    color: var(--up-text);
    font-weight: 700;
}

.up-photo__loyalty-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.55rem;
}

.up-photo__badge-grad {
    display: inline-flex;
    align-items: center;
    padding: 0.22rem 0.55rem;
    border-radius: 999px;
    background: #e8f0ff;
    color: #2563eb;
    font-size: 0.72rem;
    font-weight: 700;
}

.up-photo__phone-block {
    text-align: left;
    margin-bottom: 0.85rem;
}

.up-photo__phone-label {
    margin: 0 0 0.4rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--up-text);
}

.up-photo__phone-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.55rem 0.65rem;
    border: 1px solid #d8d8e2;
    border-radius: 10px;
    background: #fff;
    min-height: 42px;
}

.up-photo__phone-mask {
    font-size: 0.88rem;
    font-weight: 600;
    color: #4b5563;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.up-photo__phone-btn {
    border: none;
    background: transparent;
    padding: 0;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--up-primary);
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
}

.up-photo__phone-btn:hover {
    color: var(--up-primary-hover);
}

.up-photo__phone-revealed {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 700;
    color: var(--up-primary);
    text-decoration: none;
    font-size: 0.9rem;
}

.up-photo__since {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0;
    font-size: 0.82rem;
    color: var(--up-muted);
    text-align: left;
}

.up-photo__since i {
    color: var(--up-primary);
    width: 16px;
    text-align: center;
}

/* Статистика */
.up-photo__stats-head {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 1rem 1.25rem 0.5rem;
    font-size: 1rem;
    font-weight: 800;
    color: var(--up-text);
}

.up-photo__stats-head i {
    color: var(--up-primary);
}

.up-photo__stats-body {
    padding: 0 1.25rem 1.25rem;
}

.up-photo__visibility {
    margin-bottom: 0.85rem;
}

.up-photo__visibility-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.up-photo__visibility-label {
    font-size: 0.82rem;
    color: var(--up-muted);
    line-height: 1.35;
    max-width: 11rem;
}

.up-photo__visibility-num {
    font-size: 1.75rem;
    font-weight: 800;
    color: #2563eb;
    line-height: 1;
}

.up-photo__progress {
    height: 6px;
    margin-top: 0.55rem;
    border-radius: 999px;
    background: #ececf4;
    overflow: hidden;
}

.up-photo__progress > span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #6a0dad 0%, #8b5cf6 100%);
}

.up-photo__visibility-sub {
    margin: 0.45rem 0 0;
    font-size: 0.78rem;
    color: var(--up-muted);
}

.up-photo__stat-duo {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
}

.up-photo__stat-box {
    padding: 0.85rem 0.65rem;
    border-radius: 14px;
    background: var(--up-primary-soft);
    text-align: center;
}

.up-photo__stat-box strong {
    display: block;
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--up-primary);
    line-height: 1;
}

.up-photo__stat-box span {
    display: block;
    margin-top: 0.3rem;
    font-size: 0.75rem;
    color: var(--up-muted);
    line-height: 1.3;
}

/* —— Отзывы —— */
.up-photo__reviews-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.15rem 1.25rem 0.75rem;
}

.up-photo__reviews-title {
    margin: 0 0 0.25rem;
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--up-text);
}

.up-photo__reviews-title i {
    color: #f59e0b;
    margin-right: 0.35rem;
}

.up-photo__reviews-sub {
    margin: 0;
    font-size: 0.84rem;
    color: var(--up-muted);
}

.up-photo__btn-review {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 38px;
    padding: 0.45rem 0.95rem;
    border: none;
    border-radius: 10px;
    background: var(--up-primary);
    color: #fff;
    font-family: inherit;
    font-size: 0.84rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    flex-shrink: 0;
}

.up-photo__btn-review:hover {
    background: var(--up-primary-hover);
    color: #fff;
}

.up-photo__reviews-body {
    padding: 0 1.25rem 1.15rem;
}

.up-photo__reviews-empty {
    margin: 0;
    font-size: 0.84rem;
    color: var(--up-muted);
}

/* —— Поиск —— */
.up-photo__search-pad {
    padding: 1.15rem 1.25rem;
}

.up-photo__search-label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--up-text);
}

.up-photo__search-combo {
    display: flex;
    align-items: stretch;
    border: 1px solid var(--up-border);
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}

.up-photo__search-input {
    flex: 1 1 auto;
    min-width: 0;
    border: none;
    outline: none;
    padding: 0.75rem 1rem;
    font-family: inherit;
    font-size: 0.92rem;
    color: var(--up-text);
    background: transparent;
}

.up-photo__search-input::placeholder {
    color: #a8adb8;
}

.up-photo__search-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-width: 108px;
    padding: 0 1.1rem;
    border: none;
    background: var(--up-primary);
    color: #fff;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    flex-shrink: 0;
}

.up-photo__search-btn:hover {
    background: var(--up-primary-hover);
}

.up-photo__search-filter {
    margin: 0.55rem 0 0;
    font-size: 0.8rem;
    color: var(--up-muted);
}

/* —— Заголовок списка —— */
.up-photo__list-head {
    padding: 0 0.15rem;
}

.up-photo__list-head h2 {
    margin: 0 0 0.15rem;
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--up-text);
}

.up-photo__list-head p {
    margin: 0;
    font-size: 0.88rem;
    color: var(--up-muted);
}

/* —— Карточка объявления —— */
.up-photo__listing {
    display: flex;
    align-items: stretch;
    background: var(--up-surface);
    border-radius: var(--up-radius);
    box-shadow: var(--up-shadow);
    overflow: hidden;
}

.up-photo__listing-media {
    position: relative;
    width: 220px;
    min-width: 220px;
    max-width: 220px;
    min-height: 160px;
    max-height: 180px;
    flex-shrink: 0;
    background: #f0f0f5;
    overflow: hidden;
}

.up-photo__listing-media a {
    display: block;
    width: 100%;
    height: 100%;
}

.up-photo__listing-media img {
    display: block;
    width: 100%;
    height: 100%;
    max-height: 180px;
    object-fit: cover;
}

.up-photo__listing-fav {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    color: #9ca3af;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    z-index: 2;
    text-decoration: none;
}

.up-photo__listing-fav.is-active,
.up-photo__listing-fav:hover {
    color: #ef4444;
}

.up-photo__listing-body {
    flex: 1;
    min-width: 0;
    padding: 1rem 1.15rem 1.1rem;
    display: flex;
    flex-direction: column;
}

.up-photo__listing-title {
    margin: 0 0 0.35rem;
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.35;
}

.up-photo__listing-title a {
    color: var(--up-primary);
    text-decoration: none;
}

.up-photo__listing-title a:hover {
    color: var(--up-primary-hover);
}

.up-photo__listing-city {
    margin: 0 0 0.5rem;
    font-size: 0.86rem;
    color: var(--up-muted);
}

.up-photo__listing-price {
    margin: 0 0 auto;
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--up-primary);
    line-height: 1.2;
}

.up-photo__listing-price small {
    font-size: 0.95rem;
    font-weight: 700;
}

.up-photo__listing-foot {
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 0.35rem;
    flex-wrap: wrap;
}

.up-photo__listing-type {
    font-size: 0.8rem;
    color: var(--up-muted);
    margin-left: auto;
    text-align: right;
}

.up-photo__listing-phone {
    width: 100%;
    margin-top: 0.65rem;
}

.up-photo__listing-phone .listing-phone-reveal {
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
}

.up-photo__listing-phone .listing-phone-reveal__cta,
.up-photo__listing-phone .btn.listing-phone-reveal__cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    width: 100%;
    min-height: 42px;
    padding: 0.55rem 1rem;
    border: 2px solid var(--up-primary) !important;
    border-radius: 10px !important;
    background: transparent !important;
    color: var(--up-primary) !important;
    font-family: inherit;
    font-size: 0.82rem !important;
    font-weight: 800 !important;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    text-decoration: none;
}

.up-photo__listing-phone .listing-phone-reveal__cta:hover {
    background: var(--up-primary-soft) !important;
}

/* Пустое состояние */
.up-photo__empty {
    padding: 2.5rem 1.5rem;
    text-align: center;
}

.up-photo__empty i {
    font-size: 2.5rem;
    color: #c4b5fd;
    margin-bottom: 0.75rem;
}

.up-photo__empty h4 {
    margin: 0 0 0.35rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--up-muted);
}

.up-photo__empty p {
    margin: 0;
    font-size: 0.88rem;
    color: var(--up-muted);
}

/* Вторичные секции */
.up-photo__section-title {
    margin: 0 0 0.35rem;
    font-size: 1.15rem;
    font-weight: 800;
}

.up-photo__section-title i {
    color: var(--up-primary);
    margin-right: 0.35rem;
}

.up-photo__mini-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.up-photo__mini-item {
    padding: 0.95rem 1rem;
    background: var(--up-surface);
    border-radius: 14px;
    box-shadow: var(--up-shadow);
}

.up-photo__mini-item h6 {
    margin: 0 0 0.3rem;
    font-size: 0.92rem;
    font-weight: 800;
}

.up-photo__mini-item h6 a {
    color: var(--up-text);
    text-decoration: none;
}

.up-photo__mini-item h6 a:hover {
    color: var(--up-primary);
}

.up-photo__mini-item p {
    margin: 0;
    font-size: 0.8rem;
    color: var(--up-muted);
}

/* Доп. блоки (компания, статус продавца) */
.up-photo .seller-status-titles {
    text-align: left;
    margin: 0 0 0.85rem;
}

.up-photo .seller-status-plaque {
    border-radius: 12px;
    border: 1px solid var(--up-border);
    background: #fafafa;
    padding: 0.75rem;
}

.up-photo .profile-description {
    text-align: left;
    margin-bottom: 0.85rem;
    padding: 0.85rem;
    border: 1px solid var(--up-border);
    border-radius: 12px;
    background: #fafafa;
    font-size: 0.86rem;
}

.up-photo .alert-success {
    border-radius: 12px;
    font-size: 0.86rem;
}

body:has(.up-photo) > footer {
    position: relative;
    z-index: 20;
    clear: both;
    margin-top: 0 !important;
}

@media (max-width: 991.98px) {
    .up-photo__grid {
        grid-template-columns: 1fr;
    }

    .up-photo__listing {
        flex-direction: column;
    }

    .up-photo__listing-media {
        width: 100%;
        min-width: 0;
        aspect-ratio: 16 / 10;
    }
}

@media (max-width: 575.98px) {
    .up-photo__stat-duo,
    .up-photo__mini-grid {
        grid-template-columns: 1fr;
    }

    .up-photo__reviews-head {
        flex-direction: column;
        align-items: stretch;
    }

    .up-photo__btn-review {
        width: 100%;
        justify-content: center;
    }
}
