/* ===== Bottom nav, footer, search modal ===== */

.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(13, 4, 21, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid rgba(188, 19, 254, 0.28);
    box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.45);
    z-index: 900;
    padding-bottom: var(--safe-bottom, env(safe-area-inset-bottom, 0px));
}

.nav-container {
    display: flex;
    justify-content: space-around;
    align-items: stretch;
    max-width: var(--site-frame, 1040px);
    width: 100%;
    margin: 0 auto;
    min-height: var(--bottom-nav-h, 65px);
    padding: 4px 6px;
    box-sizing: border-box;
}

.nav-item {
    flex: 1 1 0;
    min-width: 0;
    max-width: 72px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.78);
    transition: color 0.2s ease, opacity 0.2s ease;
    position: relative;
    gap: 3px;
    padding: 4px 2px;
    border-radius: 10px;
}

.nav-item i {
    font-size: 19px;
    line-height: 1;
}

.nav-item span {
    font-size: 9px;
    font-weight: 700;
    line-height: 1.1;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.nav-item:hover,
.nav-item:active,
.nav-item.is-active {
    color: #fff;
}

.nav-item.is-active {
    color: var(--accent, #bc13fe);
}

.nav-item.is-active i {
    text-shadow: 0 0 12px rgba(188, 19, 254, 0.45);
}

.nav-badge {
    position: absolute;
    top: 2px;
    right: 8px;
    background: #fff;
    color: #5a2ea6;
    font-size: 9px;
    font-weight: 900;
    padding: 2px 5px;
    border-radius: 8px;
    min-width: 16px;
    text-align: center;
    line-height: 1.2;
}

/* ── Footer ── */
.main-footer {
    background:
        linear-gradient(180deg, rgba(14, 5, 24, 0.98) 0%, rgba(8, 3, 14, 1) 100%);
    border-top: 1px solid rgba(188, 19, 254, 0.16);
    padding: 24px 0 20px;
    color: rgba(255, 255, 255, 0.62);
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.footer-container {
    max-width: var(--site-frame, 1040px);
    margin: 0 auto;
    padding: 0 16px;
    box-sizing: border-box;
}

.footer-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) minmax(140px, 180px);
    align-items: center;
    gap: 20px 24px;
    margin-bottom: 18px;
}

.footer-brand-section {
    min-width: 0;
}

.brand-name {
    display: block;
    font-size: 20px;
    font-weight: 900;
    color: #fff;
    letter-spacing: 0.02em;
}

.brand-name span {
    color: var(--accent, #bc13fe);
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 10px;
    justify-content: center;
    min-width: 0;
}

.footer-links a {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 6px 12px;
    border-radius: 999px;
    color: rgba(255, 255, 255, 0.88);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.footer-links a:hover {
    color: #fff;
    background: rgba(188, 19, 254, 0.12);
    border-color: rgba(188, 19, 254, 0.28);
}

.site-selector-container {
    display: flex;
    justify-content: flex-end;
    min-width: 0;
}

.site-selector {
    width: 100%;
    max-width: 180px;
    padding: 9px 12px;
    border-radius: 10px;
    border: 1px solid rgba(188, 19, 254, 0.22);
    background: rgba(255, 255, 255, 0.05);
    color: #f2ebff;
    font-size: 13px;
    font-family: inherit;
    outline: none;
    cursor: pointer;
}

.site-selector:focus {
    border-color: rgba(188, 19, 254, 0.45);
    box-shadow: 0 0 0 3px rgba(188, 19, 254, 0.12);
}

.age-badge-mini {
    display: inline-block;
    margin-top: 8px;
    padding: 2px 7px;
    border-radius: 6px;
    border: 1px solid rgba(255, 61, 0, 0.65);
    color: #ff6b45;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.footer-copyright {
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-top: 16px;
    font-size: 12px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.48);
}

/* ── Search modal ── */
.filter-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    padding-bottom: calc(16px + var(--safe-bottom, env(safe-area-inset-bottom, 0px)));
}

.filter-modal.is-open {
    display: flex;
}

.filter-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(5, 2, 10, 0.88);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.filter-content {
    position: relative;
    width: 100%;
    max-width: 440px;
    max-height: min(calc(100dvh - 32px), calc(100vh - 32px));
    display: flex;
    flex-direction: column;
    background: #150a21;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(188, 19, 254, 0.25);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), 0 0 30px rgba(188, 19, 254, 0.15);
}

.filter-head {
    padding: 14px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
}

.filter-head h3 {
    margin: 0;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
}

.filter-close {
    background: rgba(255, 255, 255, 0.05);
    border: 0;
    color: #fff;
    font-size: 14px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
}

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

.filter-form {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.filter-form input,
.filter-form select {
    width: 100%;
    padding: 10px 12px;
    background: #201133;
    border: 1px solid rgba(188, 19, 254, 0.15);
    border-radius: 10px;
    color: #fff;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.filter-form select option {
    background: #1c0d2b;
    color: #fff;
}

.filter-form input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.filter-form input:focus,
.filter-form select:focus {
    border-color: var(--accent, #bc13fe);
    box-shadow: 0 0 10px rgba(188, 19, 254, 0.3);
    background: #25143a;
}

.grid-2,
.age-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.field-group label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.55);
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 5px;
    display: block;
    letter-spacing: 0.04em;
}

.filter-check-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid rgba(188, 19, 254, 0.18);
    background: rgba(255, 255, 255, 0.03);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    text-transform: none;
    cursor: pointer;
}

.filter-check-label.is-disabled {
    opacity: 0.72;
    cursor: not-allowed;
}

.filter-check-label input {
    width: auto;
    margin-top: 3px;
    accent-color: var(--accent, #bc13fe);
}

.filter-check-label em.filter-verify-hint {
    display: block;
    margin-top: 4px;
    color: rgba(255, 255, 255, 0.55);
    font-style: normal;
    font-size: 12px;
    font-weight: 600;
}

.filter-online-note {
    margin: 8px 0 0;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.55);
    line-height: 1.45;
}

.filter-online-note a {
    color: #00e676;
    font-weight: 800;
    text-decoration: none;
}

#filter_purpose:disabled {
    opacity: 0.65;
}

.filter-actions {
    display: flex;
    gap: 10px;
    margin-top: 6px;
    flex-shrink: 0;
}

.btn-ui {
    flex: 1;
    padding: 11px;
    border-radius: 10px;
    border: none;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: opacity 0.2s, transform 0.1s;
    box-sizing: border-box;
}

.btn-ui:active {
    transform: scale(0.98);
}

.btn-primary {
    background: linear-gradient(135deg, #bc13fe, #7a0cb5);
    color: #fff;
    box-shadow: 0 4px 12px rgba(188, 19, 254, 0.3);
}

.btn-primary:hover {
    opacity: 0.92;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* ── Responsive ── */
@media (max-width: 1199px) {
    .bottom-nav {
        display: block;
    }

    .main-footer {
        scroll-margin-bottom: calc(var(--bottom-nav-h, 65px) + var(--safe-bottom, env(safe-area-inset-bottom, 0px)));
    }
}

@media (max-width: 900px) {
    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 16px;
    }

    .footer-links {
        justify-content: center;
    }

    .site-selector-container {
        justify-content: center;
    }

    .site-selector {
        max-width: 240px;
    }
}

@media (max-width: 520px) {
    .nav-container {
        justify-content: flex-start;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x proximity;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        gap: 2px;
        padding: 4px 8px;
    }

    .nav-container::-webkit-scrollbar {
        display: none;
    }

    .nav-item {
        flex: 0 0 auto;
        min-width: 54px;
        max-width: none;
        scroll-snap-align: start;
    }
}

@media (max-width: 420px) {
    .nav-item i {
        font-size: 18px;
    }

    .nav-item span {
        font-size: 8px;
    }

    .mobile-grid-2 {
        grid-template-columns: 1fr 1fr !important;
    }

    .filter-content {
        border-radius: 16px;
        max-height: calc(100dvh - 24px);
    }

    .filter-form {
        gap: 10px;
        padding: 12px;
    }

    .filter-form input,
    .filter-form select {
        padding: 8px 10px;
        font-size: 13px;
    }

    .footer-links a {
        font-size: 12px;
        min-height: 34px;
        padding: 5px 10px;
    }
}
