/* Base Styles */
.box {
    margin: 5vh auto;
    width: 90%;
    max-width: 1400px;
}

.box h1 {
    text-align: center;
    margin-bottom: 3rem;
    font-size: 2.2rem;
    color: rgb(var(--htext_color));
}

.category_catalog {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    justify-content: center;
    margin: 0 auto;
}

.category_card {
    height: 180px;
    background-color: rgb(var(--backgroundcolor));
    border: 1px solid rgb(var(--secbackgroundcolor));
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    animation: appear both;
    animation-timeline: view(80% 0%);
}

/* Dropdown Styles */
.category_card .dropdown {
    width: 50%;
    padding: 0 1rem;
    z-index: 2;
}

.category_card .dropdown > a {
    color: rgb(var(--htext_color));
    font-size: 1.4rem;
    font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
    transition: all 0.3s ease;
    text-decoration: none;
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.dropdown_menu {
    display: none;
    flex-direction: column;
    gap: 0.5rem;
    padding-top: 0.5rem;
}

.dropdown_menu a {
    color: rgb(var(--text_color));
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    display: block;
    padding: 0.2rem 0;
}

.dropdown_menu a:hover {
    color: rgb(var(--primarycolor));
    transform: translateX(5px);
}

/* Image Container */
.image_container {
    width: 45%;
    height: 100%;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    transition: all 0.4s ease;
    position: relative;
    z-index: 1;
}

/* Hover Effects */
.category_card:hover {
    border-color: rgb(var(--primarycolor));
    box-shadow: 0 5px 15px rgba(var(--primarycolor), 0.2);
    transform: translateY(-5px);
}

.category_card:hover > .dropdown > a {
    color: rgb(var(--primarycolor));
}

.category_card:hover .image_container {
    transform: scale(1.05);
}

.category_card:hover .dropdown_menu {
    display: flex;
    animation: fadeIn 0.3s ease forwards;
}

/* Animations */
@keyframes appear {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Responsive Adjustments */
@media (max-width: 1024px) {
    .category_catalog {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
    
    .category_card .dropdown > a {
        font-size: 1.3rem;
    }
}

@media (max-width: 768px) {
    .box h1 {
        font-size: 1.8rem;
        margin-bottom: 2rem;
    }
    
    .category_card {
        height: 150px;
    }
    
    .category_card .dropdown > a {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .category_catalog {
        grid-template-columns: 1fr;
    }
    
    .category_card {
        height: 130px;
    }
    
    .box {
        width: 95%;
        margin: 3vh auto;
    }
}