@font-face {
    font-family: 'DejaVu Sans';
    src: local('DejaVu Sans'),
         url('/fonts/DejaVuSans.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}
@font-face {
    font-family: 'DejaVu Sans';
    src: url('/fonts/DejaVuSans-Bold.ttf') format('truetype');
    font-weight: bold;
    font-style: normal;
}

:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --text-main: #0f172a;
    --text-muted: #64748b;

    --bg-page: #cbd5e1;

    --radius: 16px;
    --success: #16a34a;
    --danger: #dc2626;
}

body {
    font-family: 'DejaVu Sans', sans-serif;
    background-color: var(--bg-page);
    color: var(--text-main);
    margin: 0;
    padding: 0;
    position: relative;
    overflow-x: hidden;
}

.container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 20px;
}

.content-layer { position: relative; z-index: 1; }

.hero-section {
    position: relative;
    background-image: url('/static/img/main/12323123123.png');
    background-size: cover;
    background-position: center;
    height: 400px;
    border-radius: 0 0 24px 24px;
    overflow: hidden;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.hero-overlay {
    background: linear-gradient(to bottom, rgba(0,0,0,0.3), rgba(0,0,0,0.6));
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center; text-align: center;
}

.hero-content { color: white; }
.hero-title { font-family: 'DejaVu Sans', sans-serif; font-size: 3.5rem; font-weight: 800; margin: 0 0 10px 0; text-shadow: 0 4px 10px rgba(0,0,0,0.3); }
.hero-slogan { font-size: 1.25rem; font-weight: 500; margin: 0 0 30px 0; opacity: 0.9; text-shadow: 0 2px 4px rgba(0,0,0,0.3); }

.hero-buttons { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

.hero-btn {
    display: inline-block;
    padding: 12px 32px;
    border-radius: 99px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    text-decoration: none;
}

.secondary-btn {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.4);
}
.secondary-btn:hover { background-color: rgba(255, 255, 255, 0.4); }

@media (max-width: 768px) {
    .hero-section { height: 350px; }
    .hero-title { font-size: 2.2rem; }
    .hero-slogan { font-size: 1rem; }
    .hero-btn { padding: 10px 24px; font-size: 0.9rem; }
}

#paw-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.paw {
    position: absolute;
    width: 40px; height: 40px;
    object-fit: contain;

    filter: brightness(0);

    opacity: 0;
    animation: floatPaw 10s linear forwards;
}

@keyframes floatPaw {
    0% {
        transform: translateY(0) rotate(0deg) scale(0.8);
        opacity: 0;
    }

    10% { opacity: 0.2; }
    90% { opacity: 0.2; }

    100% {
        transform: translateY(-120vh) rotate(45deg) scale(1.1);
        opacity: 0;
    }
}

.categories-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.reset-filter-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    flex-shrink: 0;
    width: 72px;
    margin-right: 4px;
    padding-right: 12px;
    border-right: 1px solid #e2e8f0;
    margin-top: 0;
    padding-top: 0;
}

.reset-circle {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #fff1f2;
    color: #f43f5e;
    border: 2px solid #fecaca;

    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease-in-out;
    margin-bottom: 6px;
    box-shadow: 0 2px 4px rgba(220, 38, 38, 0.1);
    box-sizing: border-box;
}

.reset-filter-box:hover .reset-circle {
    background: #ffe4e6;
    color: #e11d48;
    border-color: #fb7185;
    transform: scale(1.05) rotate(90deg);
}

.reset-filter-box:hover .story-name {
    color: #e11d48;
}

.reset-filter-box .story-name {
    color: #f43f5e;
    font-weight: 600;
}

.stories-scroll {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 5px;
    scrollbar-width: none;
    width: 100%;
}

.story-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    flex-shrink: 0;
    width: 72px;
    transition: transform 0.2s;
}

.story-circle {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #fff;
    overflow: hidden;
    margin-bottom: 6px;
    border: 2px solid transparent;
    box-shadow: 0 2px 4px rgba(0,0,0,0.03);
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
}

.story-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    background-color: #f1f5f9;
}
.story-item.active .story-circle { border-color: var(--primary); }
.story-name { font-size: 0.75rem; font-weight: 500; text-align: center; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.story-item.active .story-name { color: var(--primary); font-weight: 600; }

.subcategory-section { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 2rem; padding-bottom: 1.5rem; border-bottom: 1px solid #e2e8f0; display: none; }
.subcategory-section.show { display: flex; }
.sub-chip { display: flex; align-items: center; gap: 10px; padding: 4px 16px 4px 4px; background: #fff; border: 1px solid #e2e8f0; border-radius: 99px; cursor: pointer; transition: all 0.2s; user-select: none; box-shadow: 0 1px 2px rgba(0,0,0,0.02); }
.sub-chip:hover { background: #f8fafc; border-color: #cbd5e1; }
.sub-chip-img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; background-color: #e2e8f0; }
.sub-chip-text { font-size: 0.9rem; font-weight: 500; color: var(--text-main); }
.sub-chip.active { background: var(--text-main); border-color: var(--text-main); }
.sub-chip.active .sub-chip-text { color: white; }

.content-header { margin-bottom: 1.5rem; display: flex; align-items: baseline; gap: 10px; }
.page-title { margin: 0; font-size: 1.5rem; font-weight: 700; }
.product-count { color: var(--text-muted); font-size: 0.9rem; }

/* --- GRID --- */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px 16px;
}

.card {
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px -6px rgba(0, 0, 0, 0.1);
    border-color: var(--primary);
}

.card-image-box {
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    height: 260px;
    margin: 10px 10px 0 10px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
}

.card-image {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.card-body {
    padding: 16px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0 0 16px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-bottom {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 12px;
    border-top: 1px solid #f8fafc;
    min-height: 40px;
}

.price-wrapper {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.card-price {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary);
}

.price-old {
    font-size: 0.85rem;
    color: #94a3b8;
    text-decoration: line-through;
    font-weight: 500;
    margin-bottom: 2px;
}

.price-new {
    font-size: 1.2rem;
    font-weight: 800;
    color: #dc2626;
}

.status-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--success);
}

.status-badge.out { color: var(--danger); }

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: currentColor;
}

.pagination { display: flex; justify-content: center; gap: 6px; margin: 3rem 0; align-items: center; }

.page-btn {
    width: 40px; height: 40px;
    border: 1px solid #e2e8f0;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s ease;
    font-weight: 600;
    color: var(--text-main);
}

.page-btn:hover:not(:disabled) {
    border-color: var(--primary);
    color: var(--primary);
    background-color: #eff6ff;
    transform: translateY(-2px);
}

.page-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.3);
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: default;
    background-color: #f1f5f9;
}

.loader { width: 100%; text-align: center; color: var(--text-muted); padding: 40px; }

.footer {
    background: #94a3b8;
    color: #f1f5f9;
    text-align: center;
    padding: 20px;
    font-size: 0.9rem;
    margin-top: auto;
}

.hero-buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    justify-content: center;
}

.hero-buttons-row {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.hero-btn {
    display: inline-block;
    padding: 12px 32px;
    border-radius: 99px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    text-decoration: none;
}

.primary-news-btn {
    background-color: rgba(37, 99, 235, 0.9);
    color: white;
    backdrop-filter: blur(5px);
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
    padding: 14px 44px;
}

.primary-news-btn:hover {
    background-color: rgba(37, 99, 235, 1);
    border-color: rgba(255, 255, 255, 0.7);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.5);
}

.secondary-btn {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.4);
}
.secondary-btn:hover {
    background-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
}


@media (max-width: 600px) {
    :root {
        --radius: 12px;
    }

    body {
        background-color: #f1f5f9;
    }

    .page-wrapper, main {
        overflow: visible !important;
    }

    .container {
        padding: 0 12px;
    }

    .hero-section {
        height: 240px;
        margin-bottom: 12px;
        border-radius: 0 0 20px 20px;
    }

    .hero-title { font-size: 1.8rem; margin-bottom: 5px; }
    .hero-slogan { display: block; font-size: 0.9rem; margin-bottom: 15px; }
    .hero-buttons { display: flex; gap: 8px; }
    .hero-btn { padding: 8px 16px; font-size: 0.85rem; }

    .search-wrapper {
        margin-top: -25px;
        margin-bottom: 20px;
        position: relative;
        z-index: 10;
    }

    .categories-wrapper {
        display: flex;
        align-items: flex-start;
        gap: 8px;
        margin-bottom: 1.5rem;
        overflow: visible;
    }

    .stories-scroll {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
        gap: 12px 4px;
        padding: 0;
        width: 100%;
    }

    .reset-filter-box {
        flex-direction: column;
        align-items: center;
        flex-shrink: 0;
        width: 70px;
        padding-right: 8px;
        border-right: 2px solid #cbd5e1;
    }

    .reset-circle { width: 56px; height: 56px; margin-bottom: 4px; }
    .story-item { width: 70px; margin: 0 auto; }
    .story-circle { width: 56px; height: 56px; margin-bottom: 4px; }
    .story-name { font-size: 0.65rem; height: 2.4em; line-height: 1.1; }

    .product-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .card-image-box { height: 160px; margin: 6px; }
    .card-title { font-size: 0.85rem; height: 2.8em; margin-bottom: 10px; }

    .card-bottom {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        padding-top: 8px;
        min-height: auto;
    }

    .price-wrapper, .card-price {
        order: 1;
    }

    .status-badge {
        order: 2;
        font-size: 0.7rem;
        margin-top: 2px;
    }

    .content-header-row {
        display: block;
        width: 100%;
        margin-bottom: 20px;
        overflow: visible !important;
        height: auto !important;
    }

    .title-block {
        margin-bottom: 12px;
    }

    .sort-container {
        width: 100%;
        position: relative;
        overflow: visible !important;
    }

    .sort-select {
        width: 100%;
        height: 44px;
        font-size: 0.9rem;
        padding: 0 35px 0 12px;
        background-color: #fff;
        border: 1px solid #cbd5e1;
        border-radius: 10px;
        display: block;
        appearance: none;
        -webkit-appearance: none;
        position: relative;
        z-index: 5;
    }

    .sort-icon {
        position: absolute;
        right: 12px;
        top: 50%;
        transform: translateY(-50%);
        z-index: 6;
        pointer-events: none;
    }
}

.page-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    color: var(--text-muted);
    font-weight: 600;
}

@media (max-width: 600px) {
    .page-btn {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }
    .page-dots {
        width: 20px;
    }
}