@import url('https://fonts.googleapis.com/css2?family=Red+Hat+Display:wght@300;400;500;600;700;800;900&display=swap');

:root {
    --primary: #2D68FF;
    --primary-light: #E9F0FF;
    --text-main: #1A1D1E;
    --text-muted: #6A6D7C;
    --white: #FFFFFF;
    --bg-light: #F7F9FC;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Red Hat Display', sans-serif; }

body {
    background-color: var(--bg-light);
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    position: fixed;
    width: 100%;
    display: flex;
    justify-content: center;
}

.app-container {
    width: 100%;
    max-width: 430px;
    background: var(--bg-light);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.explore-header {
    background: var(--white);
    padding: calc(env(safe-area-inset-top, 25px) + 20px) 20px 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.03);
    z-index: 10;
}

.search-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.back-btn, .filter-btn {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: var(--bg-light);
    border: none;
    display: flex;
    justify-content: center;
    align-items: center;
}

.search-box {
    flex: 1;
    background: var(--bg-light);
    height: 44px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    padding: 0 16px;
}

.search-box i { color: var(--text-muted); width: 18px; margin-right: 10px; }
.search-box input { background: none; border: none; outline: none; width: 100%; font-size: 14px; font-weight: 600; }

.filter-chips {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 10px;
    scrollbar-width: none;
}
.filter-chips::-webkit-scrollbar { display: none; }

.f-chip {
    padding: 8px 16px;
    background: var(--bg-light);
    color: var(--text-muted);
    border-radius: 12px;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}
.f-chip.active { background: var(--primary); color: var(--white); }

.content-wrapper { flex: 1; overflow-y: auto; padding: 20px 20px 100px; }
.results-count { font-size: 13px; font-weight: 700; color: var(--text-muted); margin-bottom: 20px; }

/* List Item */
.list-item {
    background: var(--white);
    border-radius: 24px;
    overflow: hidden;
    display: flex;
    margin-bottom: 20px;
    position: relative;
    text-decoration: none;
    box-shadow: 0 10px 25px rgba(0,0,0,0.04);
}

.list-item img { width: 110px; height: 110px; object-fit: cover; }
.item-info { padding: 16px; flex: 1; min-width: 0; }
.item-price { font-size: 18px; font-weight: 900; color: var(--primary); }
.item-info h3 { font-size: 15px; font-weight: 800; color: var(--text-main); margin: 4px 0; }
.item-loc { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }
.item-stats { font-size: 11px; font-weight: 700; color: var(--text-light); }

.fav-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 5;
    padding: 8px; /* Easier touch target */
}

.fav-btn:active {
    transform: scale(0.8);
}

.fav-btn.active svg {
    fill: url(#blueBlackGradient) #2D68FF;
    stroke: none;
    animation: heartBurst 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes heartBurst {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* Bottom Nav */
.bottom-nav {
    position: absolute;
    bottom: 0;
    width: 100%;
    background: var(--white);
    display: flex;
    justify-content: space-around;
    padding: 12px 10px calc(12px + env(safe-area-inset-bottom, 12px));
    box-shadow: 0 -10px 30px rgba(0,0,0,0.08);
    z-index: 100;
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--text-muted);
    text-decoration: none;
}

.nav-item.active { color: var(--primary); }
.nav-item i { font-size: 20px; }
.nav-item span { font-size: 11px; font-weight: 600; }

/* Filter Modal */
.filter-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    z-index: 1000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.filter-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.filter-bottom-sheet {
    width: 100%;
    max-width: 430px;
    background: var(--white);
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1);
    padding: 24px 20px calc(24px + env(safe-area-inset-bottom, 0px));
    display: flex;
    flex-direction: column;
    gap: 24px;
    box-shadow: 0 -10px 40px rgba(0,0,0,0.1);
}

.filter-overlay.active .filter-bottom-sheet {
    transform: translateY(0);
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.filter-header h3 {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-main);
}

.close-filter-btn {
    background: var(--bg-light);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-muted);
}

.filter-section h4 {
    font-size: 15px;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 16px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 12px;
}

.radio-label input[type="radio"] {
    accent-color: var(--primary);
    width: 18px;
    height: 18px;
}

.filter-select {
    width: 100%;
    padding: 14px 16px;
    border: 1.5px solid #E2E8F0;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-main);
    background: var(--white);
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236A6D7C' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
}

.filter-select:focus {
    border-color: var(--primary);
}

.filter-footer {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.btn-reset {
    flex: 1;
    padding: 16px;
    background: var(--bg-light);
    color: var(--text-main);
    border: none;
    border-radius: 16px;
    font-weight: 800;
    font-size: 15px;
}

.btn-apply {
    flex: 2;
    padding: 16px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 16px;
    font-weight: 800;
    font-size: 15px;
    box-shadow: 0 4px 15px rgba(45, 104, 255, 0.3);
}
