/* ========================================
   CATEGORIES DROPDOWN STYLES
   ======================================== */

/* Kontener kategorii */
.category-wrapper {
    position: relative;
    z-index: 999999;
    display: flex;
    align-items: center;
    gap: 0;
}

/* Kontener przycisków */
.category-buttons {
    display: flex;
    gap: 0;
    align-items: center;
}

/* Przycisk Kategorie */
#category-toggle {
    color: rgb(37, 199, 224);
    background-color: transparent;
    border: 2px solid rgb(37, 199, 224);
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    padding: 0.4rem 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Recursive', sans-serif;
}

#category-toggle:hover,
#category-toggle:focus {
    background-color: rgb(37, 199, 224);
    color: white;
    transform: scale(1.05);
}

/* Dropdown menu kategorii */
.category-dropdown {
    position: relative;
    display: none;
    flex-direction: column;
    width: 780px;
    max-height: 500px;
    overflow-y: auto;
    background: rgba(241, 240, 245, 0.98);
    opacity: 0.98;
    backdrop-filter: blur(20px);
    border-radius: 20px;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.35);
    padding: 25px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    z-index: 999999;
    pointer-events: auto;
}

.category-dropdown-container {

    position: fixed;

    top: 80px;

    left: 0;

    width: 100%;

    display: flex;

    justify-content: center;

    pointer-events: none;

    z-index: 999999;

}

.category-dropdown.active {
    display: block;
}

/* Główna kategoria */
.main-category {
    position: relative;
    padding: 14px 18px;
    margin-bottom: 8px;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.main-category:hover {
    background: linear-gradient(135deg, rgba(37, 199, 224, 0.1), rgba(24, 160, 251, 0.1));
    transform: translateX(8px);
    box-shadow: 0 4px 15px rgba(37, 199, 224, 0.2);
}

.main-category-link {
    font-weight: 600;
    color: #2d3748;
    text-decoration: none;
    display: block;
    font-size: 1.15rem;
    letter-spacing: 0.5px;
}

.main-category-link:hover {
    color: rgb(37, 199, 224);
}

/* Podkategorie */
.subcategory-list {
    position: absolute;
    top: 0;
    left: 100%;
    margin-left: 15px;
    background: rgba(255, 255, 255, 0.95);
    min-width: 280px;
    max-height: 420px;
    overflow-y: auto;
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.25);
    display: none;
    border: 1px solid rgba(0, 0, 0, 0.08);
    z-index: 50001;
    animation: slideRight 0.25s ease-out;
}

.main-category:hover .subcategory-list {
    display: block;
}

.subcategory-list li {
    margin: 10px 0;
    list-style: none;
}

.subcategory-list a {
    color: #4a5568;
    text-decoration: none;
    font-size: 0.98rem;
    padding: 8px 14px;
    border-radius: 8px;
    display: block;
    transition: all 0.2s ease;
    position: relative;
}

.subcategory-list a:hover {
    color: rgb(37, 199, 224);
    background: rgba(37, 199, 224, 0.08);
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(37, 199, 224, 0.15);
}

/* Animacje */
@keyframes slideDown {

    from {
        opacity: 0;
        transform: translateY(-12px) scale(0.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

}

@keyframes slideRight {
    from {
        opacity: 0;
        transform: translateX(15px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Scrollbar */
.category-dropdown::-webkit-scrollbar,
.subcategory-list::-webkit-scrollbar {
    width: 8px;
}

.category-dropdown::-webkit-scrollbar-track,
.subcategory-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
}

.category-dropdown::-webkit-scrollbar-thumb,
.subcategory-list::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, rgb(37, 199, 224), #18a0fb);
    border-radius: 10px;
}

.category-dropdown::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #18a0fb, rgb(37, 199, 224));
}

/* RESPONSYWNOŚĆ */
/* Tablets: 2-column subcategories */
@media (max-width: 768px) {
    .category-dropdown {
        width: 92vw;
        left: 4vw;
        max-height: 70vh;
        padding: 20px;
        border-radius: 16px;
    }
    
    #category-toggle {
        padding: 0.55rem 1.1rem;
        font-size: 0.85rem;
        border-radius: 6px;
    }
    
    .mega-row {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 12px 0;
    }
    
    .mega-category-title {
        margin-bottom: 8px;
    }
    
    .mega-sub-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Phones: Stacked layout */
@media (max-width: 480px) {
    #category-toggle {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }
    
    .category-dropdown {
        width: 95vw;
        left: 2.5vw;
        padding: 15px;
        max-height: 80vh;
    }
    
    .mega-row {
        grid-template-columns: 1fr;
        border-bottom: 2px solid rgba(37, 199, 224, 0.2);
        padding: 12px 0;
        margin-bottom: 8px;
    }
    
    .mega-category-title {
        padding: 10px 12px;
        font-size: 1rem;
    }
    
    .mega-icon {
        font-size: 1.3rem;
    }
    
    .mega-sub-grid {
        grid-template-columns: 1fr;
        gap: 6px;
    }
    
    .mega-sub-grid a {
        padding: 10px 12px;
        font-size: 0.95rem;
        border-left: 3px solid transparent;
        transition: all 0.2s ease;
    }
    
    .mega-sub-grid a:hover {
        background: rgba(37, 199, 224, 0.15);
        transform: none;
        border-left-color: rgb(37, 199, 224);
    }
}

/* Very small phones */
@media (max-width: 360px) {
    .mega-category-title {
        font-size: 0.95rem;
    }
    
    .mega-icon {
        font-size: 1.2rem;
    }
    
    .category-dropdown {
        padding: 12px;
    }
    
    .mega-row {
        padding: 10px 0;
        margin-bottom: 6px;
    }
}

/* Dark mode kompatybilność */
@media (prefers-color-scheme: dark) {
    .category-dropdown,
    .subcategory-list {
        background: rgba(30, 41, 59, 0.98);
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    .main-category-link {
        color: #e2e8f0;
    }
    
    .subcategory-list a {
        color: #cbd5e1;
    }
}


/* Overlay to close dropdown when clicking outside */
.category-backdrop {
    position: fixed;
    inset: 0;
    background: transparent;
    display: none;
    z-index: 49999;
    pointer-events: none;
}

.category-backdrop.active {
    display: block;
    
}


/* ================================
   MEGA MENU PRO
================================ */

.mega-menu {
    width: 780px;
    padding: 30px;
    animation: megaFade 0.25s ease;
}

/* jeden blok kategorii */
.mega-row {

    display: grid;

    grid-template-columns: 200px 1fr;

    padding: 14px 0;

    border-bottom: 4px solid rgba(37, 199, 224, 0.25);

}

/* lewa kolumna */
.mega-category-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.05rem;
    background: linear-gradient(135deg, rgba(37, 199, 224, 0.08), rgba(24, 160, 251, 0.06));
    padding: 12px 15px;
    border-radius: 10px;
    border-left: 4px solid rgb(37, 199, 224);
}

/* ikona */
.mega-icon {

    font-size: 1.2rem;

}

/* prawa kolumna */
.mega-sub-grid {

    display: grid;

    grid-template-columns: repeat(3, 1fr);

    gap: 8px 20px;

    list-style: none;

    margin: 0;

    padding: 0;

}

/* link */
.mega-sub-grid a {
    display: block;
    padding: 6px 10px;
    border-radius: 8px;
    color: #4a5568;
    text-decoration: none;
    transition: all 0.2s ease;
    background: transparent;
}

/* hover highlight */

.mega-sub-grid a:hover {

    background: rgba(37,199,224,0.12);

    color: rgb(37,199,224);

    transform: translateX(4px);

}

/* hover na całej kategorii */

.mega-row:hover {

    background: rgba(37,199,224,0.05);

}

/* animacja */

@keyframes megaFade {

    from {

        opacity: 0;

        transform: translateY(-10px) scale(0.98);

    }

    to {

        opacity: 1;

        transform: translateY(0) scale(1);

    }

}