/* ============================================
   EAP - Wallpapers Page (Professional)
   ============================================ */

/* --- Сброс и переменные --- */
.wallpapers-page,
.wallpapers-page *,
.wallpaper-modal,
.wallpaper-modal * {
    box-sizing: border-box;
}

:root {
    --wp-primary: #10b981;
    --wp-primary-dark: #059669;
    --wp-primary-glow: rgba(16, 185, 129, 0.25);
    --wp-surface: #ffffff;
    --wp-surface-alt: #f8fafc;
    --wp-text: #0f172a;
    --wp-text-muted: #64748b;
    --wp-border: #e2e8f0;
    --wp-radius: 16px;
    --wp-radius-lg: 24px;
    --wp-shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --wp-shadow: 0 10px 30px -5px rgba(0,0,0,0.08);
    --wp-shadow-hover: 0 20px 40px -5px rgba(0,0,0,0.12);
    --wp-transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.wallpapers-page {
    background: var(--wp-surface-alt);
    min-height: 100vh;
}

/* --- Hero Section с Mesh-градиентом --- */
.wallpapers-hero {
    position: relative;
    padding: 80px 24px 100px;
    text-align: center;
    color: #fff;
    overflow: hidden;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

.hero-mesh-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 15% 50%, rgba(16, 185, 129, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 85% 30%, rgba(99, 102, 241, 0.15) 0%, transparent 50%);
    z-index: 1;
}

.wallpapers-hero-content {
    position: relative;
    z-index: 2;
    max-width: 700px;
    margin: 0 auto;
}

.wallpapers-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 8px 20px;
    border-radius: 99px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 24px;
    border: 1px solid rgba(255,255,255,0.15);
    color: #fff;
}

.wallpapers-hero-title {
    font-size: clamp(32px, 5vw, 52px);
    font-weight: 800;
    line-height: 1.1;
    margin: 0 0 20px 0;
    letter-spacing: -0.02em;
    color: #fff;
}

.wallpapers-hero-subtitle {
    font-size: 18px;
    line-height: 1.6;
    color: rgba(255,255,255,0.85);
    max-width: 500px;
    margin: 0 auto;
}

/* --- Контейнер и Фильтры --- */
.wallpapers-container {
    max-width: 1320px;
    margin: -40px auto 0;
    padding: 0 24px 80px;
    position: relative;
    z-index: 10;
}

.filters-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 32px;
    flex-wrap: wrap;
    justify-content: center;
    background: var(--wp-surface);
    padding: 12px;
    border-radius: 99px;
    box-shadow: var(--wp-shadow);
    border: 1px solid var(--wp-border);
    max-width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

.filter-pill {
    padding: 10px 20px;
    background: transparent;
    border: none;
    border-radius: 99px;
    font-size: 14px;
    font-weight: 600;
    color: var(--wp-text-muted);
    cursor: pointer;
    transition: var(--wp-transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: 'Wix Madefor Display', sans-serif;
}

.filter-pill:hover {
    color: var(--wp-text);
    background: var(--wp-surface-alt);
}

.filter-pill.active {
    background: var(--wp-text);
    color: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.filter-pill i {
    font-size: 16px;
}

.filter-count {
    background: rgba(0,0,0,0.08);
    padding: 2px 8px;
    border-radius: 99px;
    font-size: 11px;
    font-weight: 700;
}

.filter-pill.active .filter-count {
    background: rgba(255,255,255,0.2);
}

.info-bar {
    display: flex;
    justify-content: center;
    margin-bottom: 32px;
}

.results-info {
    font-size: 14px;
    color: var(--wp-text-muted);
    font-weight: 500;
}

.results-info strong {
    color: var(--wp-text);
    font-weight: 700;
}

/* --- Сетка и Карточки --- */
.wallpapers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.wallpaper-card {
    position: relative;
    border-radius: var(--wp-radius);
    overflow: hidden;
    background: var(--wp-surface);
    box-shadow: var(--wp-shadow-sm);
    cursor: pointer;
    aspect-ratio: 4/3;
    opacity: 0;
    animation: fadeInUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.wallpaper-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    display: block;
}

.wallpaper-card:hover img {
    transform: scale(1.05);
}

.wallpaper-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.4) 40%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 24px;
    color: #fff;
}

.wallpaper-card:hover .wallpaper-overlay {
    opacity: 1;
}

.wallpaper-favorite {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: none;
    color: #fff;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--wp-transition);
    opacity: 0;
    transform: translateY(-10px);
}

.wallpaper-card:hover .wallpaper-favorite {
    opacity: 1;
    transform: translateY(0);
}

.wallpaper-favorite:hover {
    background: #fff;
    color: #ef4444;
}

.wallpaper-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 8px 0;
    line-height: 1.3;
    transform: translateY(10px);
    transition: transform 0.3s ease;
    color: #fff;
}

.wallpaper-card:hover .wallpaper-title {
    transform: translateY(0);
}

.wallpaper-meta {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: rgba(255,255,255,0.8);
    margin-bottom: 16px;
    transform: translateY(10px);
    transition: transform 0.3s ease 0.05s;
}

.wallpaper-card:hover .wallpaper-meta {
    transform: translateY(0);
}

.wallpaper-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.wallpaper-actions {
    display: flex;
    gap: 10px;
    transform: translateY(10px);
    transition: transform 0.3s ease 0.1s;
}

.wallpaper-card:hover .wallpaper-actions {
    transform: translateY(0);
}

.wallpaper-btn {
    flex: 1;
    padding: 10px 16px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--wp-transition);
    font-family: 'Wix Madefor Display', sans-serif;
}

.wallpaper-btn-view {
    flex: 0 0 44px;
    padding: 0;
    background: rgba(255,255,255,0.15);
    color: #fff;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.wallpaper-btn-view:hover {
    background: rgba(255,255,255,0.3);
}

.wallpaper-btn-download {
    background: #fff;
    color: var(--wp-text);
}

.wallpaper-btn-download:hover {
    background: var(--wp-primary);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--wp-primary-glow);
}

/* --- Премиальное Модальное Окно (Lightbox) --- */
.wallpaper-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.wallpaper-modal.active {
    display: flex;
    opacity: 1;
}

.wallpaper-modal-content {
    max-width: 900px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.wallpaper-modal.active .wallpaper-modal-content {
    transform: scale(1);
}

.modal-image-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}

.modal-image-wrapper img {
    max-width: 100%;
    max-height: 70vh;
    border-radius: var(--wp-radius);
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
    object-fit: contain;
}

.modal-info-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 20px 28px;
    border-radius: var(--wp-radius);
}

.modal-text {
    color: #fff;
}

.modal-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 6px 0;
    color: #fff;
}

.modal-meta {
    font-size: 14px;
    color: rgba(255,255,255,0.6);
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-meta .dot {
    width: 4px;
    height: 4px;
    background: rgba(255,255,255,0.4);
    border-radius: 50%;
}

.modal-download-btn {
    padding: 12px 28px;
    background: var(--wp-primary);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--wp-transition);
    font-family: 'Wix Madefor Display', sans-serif;
}

.modal-download-btn:hover {
    background: var(--wp-primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px var(--wp-primary-glow);
}

.modal-close {
    position: absolute;
    top: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 50%;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    transition: var(--wp-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 10001;
}

.modal-close:hover {
    background: rgba(255,255,255,0.2);
    transform: rotate(90deg);
}

/* --- Навигация (Overlay) --- */
.nav-overlay-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.nav-overlay-backdrop.active {
    opacity: 1;
    visibility: visible;
}

.nav-overlay {
    position: fixed;
    top: 20px;
    right: -340px;
    width: 320px;
    max-height: calc(100vh - 40px);
    background: var(--wp-surface);
    z-index: 9999;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    transition: right 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    border-radius: var(--wp-radius-lg);
    overflow: hidden;
}

.nav-overlay.active {
    right: 20px;
}

body.menu-open .bottom-nav-wrapper,
body.menu-open .site-footer {
    z-index: 9997 !important;
}

.nav-overlay-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--wp-border);
}

.nav-overlay-header .logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.nav-overlay-header .logo img {
    height: 28px;
}

.nav-overlay-header .logo span {
    font-size: 20px;
    font-weight: 800;
    color: var(--wp-text);
}

.nav-close-btn {
    background: none;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    font-size: 22px;
    color: var(--wp-text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.nav-close-btn:hover {
    background: var(--wp-surface-alt);
}

.nav-overlay-links {
    list-style: none;
    margin: 0;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
    flex: 1;
}

.nav-overlay-links a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 12px;
    color: var(--wp-text-muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    transition: var(--wp-transition);
}

.nav-overlay-links a:hover,
.nav-overlay-links a.active {
    background: #f0fdf4;
    color: var(--wp-primary);
}

/* --- Адаптивность --- */
@media (max-width: 768px) {
    .wallpapers-hero {
        padding: 60px 20px 80px;
    }

    .wallpapers-container {
        margin-top: -30px;
        padding: 0 16px 60px;
    }

    .filters-bar {
        justify-content: flex-start;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding: 8px;
        border-radius: 16px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .filters-bar::-webkit-scrollbar {
        display: none;
    }

    .filter-pill {
        white-space: nowrap;
        flex-shrink: 0;
    }

    .wallpapers-grid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        gap: 16px;
    }

    .wallpaper-overlay {
        opacity: 1;
        background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 60%);
    }

    .wallpaper-favorite {
        opacity: 1;
        transform: translateY(0);
    }

    .wallpaper-title,
    .wallpaper-meta,
    .wallpaper-actions {
        transform: translateY(0);
    }

    .modal-info-panel {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }

    .modal-meta {
        justify-content: center;
    }

    .modal-download-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .wallpapers-grid {
        grid-template-columns: 1fr;
    }

    .wallpaper-actions {
        flex-direction: row;
    }

    .wallpaper-btn-view {
        flex: 0 0 44px;
    }
}

/* ============================================
   ИСПРАВЛЕНИЕ: Белый текст на тёмном баннере
   (переопределяет глобальные стили из style.css)
   ============================================ */
.wallpapers-hero {
    color: #ffffff !important;
}

.wallpapers-hero .wallpapers-hero-badge {
    color: #ffffff !important;
}

.wallpapers-hero .wallpapers-hero-title,
.wallpapers-hero h1 {
    color: #ffffff !important;
}

.wallpapers-hero .wallpapers-hero-subtitle,
.wallpapers-hero p {
    color: rgba(255, 255, 255, 0.85) !important;
}