/*
 * Plan na Kasę — wspólna warstwa responsywna
 * Ładowana po style.css, aby zachować istniejący wygląd desktopowy.
 */

*, *::before, *::after { box-sizing: border-box; }

html {
    max-width: 100%;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

img, picture, video, canvas, svg {
    display: block;
    max-width: 100%;
}

input, select, textarea, button { font: inherit; }

.container {
    width: min(100% - 40px, 1760px);
    margin-inline: auto;
}

/* Nagłówek i nawigacja */
.main-header {
    position: sticky;
    top: 0;
    z-index: 900;
    background: #fff;
}

.nav-flex { position: relative; }

.mobile-menu-toggle {
    display: none;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid rgba(27, 24, 21, .15);
    border-radius: 50%;
    background: #fff;
    color: #1b1815;
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

.mobile-menu-toggle__lines,
.mobile-menu-toggle__lines::before,
.mobile-menu-toggle__lines::after {
    display: block;
    width: 18px;
    height: 1.5px;
    border-radius: 2px;
    background: currentColor;
    transition: transform .25s ease, opacity .25s ease;
}

.mobile-menu-toggle__lines { position: relative; }
.mobile-menu-toggle__lines::before,
.mobile-menu-toggle__lines::after { content: ""; position: absolute; left: 0; }
.mobile-menu-toggle__lines::before { top: -6px; }
.mobile-menu-toggle__lines::after { top: 6px; }
.mobile-menu-toggle[aria-expanded="true"] .mobile-menu-toggle__lines { background: transparent; }
.mobile-menu-toggle[aria-expanded="true"] .mobile-menu-toggle__lines::before { top: 0; transform: rotate(45deg); }
.mobile-menu-toggle[aria-expanded="true"] .mobile-menu-toggle__lines::after { top: 0; transform: rotate(-45deg); }

/* Elastyczne układy wspólne */
.products-grid,
.all-products-grid,
.category-products,
.shop-products-grid,
.search-results-grid,
.favourites-grid {
    align-items: stretch;
}

.product-card,
.all-product-card { min-width: 0; height: 100%; }

.product-card h2,
.product-card h3,
.all-product-card h2,
.all-product-card h3,
.product-card a,
.all-product-card a {
    overflow-wrap: anywhere;
}

.product-card-img img,
.all-product-card__visual img,
.category-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Produkt */
.product-page { width: 100%; }
.product-page__breadcrumbs { overflow-wrap: anywhere; }
.product-details { min-width: 0; }
.product-gallery,
.product-details__content { min-width: 0; }
.product-details__content h1 { text-wrap: balance; overflow-wrap: anywhere; }
.product-details__intro { max-width: 68ch; }

.birthday-carousel,
.challenge-carousel,
.product-carousel,
.product-gallery { max-width: 100%; }

.birthday-carousel__main,
.challenge-carousel__main,
.product-carousel__main { max-width: 100%; overflow: hidden; }

.birthday-carousel__main img,
.challenge-carousel__main img,
.product-carousel__main img,
.product-gallery img {
    display: block;
    width: 100%;
    height: auto;           /* Zamiast sztywnego 550px ustawiamy auto */
    max-height: 600px;      /* Maksymalna wysokość, żeby zdjęcie nie było za wysokie na komputerach */
    object-fit: contain;    /* Zapobiega przycinaniu i deformacji */
}

.birthday-carousel__thumbnails,
.challenge-carousel__thumbnails,
.product-carousel__thumbnails,
.product-thumbnails {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* Koszyk, wyszukiwanie i modale */
.cart-drawer,
.cart-panel { width: min(100%, 510px); }

.cart-item { min-width: 0; }
.cart-item__content,
.cart-item__details { min-width: 0; }
.cart-item__name { overflow-wrap: anywhere; }

.search-suggestions {
    width: min(440px, calc(100vw - 24px));
    max-width: calc(100vw - 24px);
}

.categories-modal__dialog,
.modal-content,
.image-lightbox__content {
    width: min(92vw, 780px);
    max-width: 92vw;
    max-height: min(90vh, 900px);
}

.categories-list { min-width: 0; }
.image-lightbox__content img { max-width: 100%; max-height: 82vh; object-fit: contain; }

/* Formularze i strony informacyjne */
.contact-form,
.auth-card,
.info-page__content,
.legal-page__content,
.profile-container,
.profile-content { max-width: 100%; }

table { display: block; max-width: 100%; overflow-x: auto; }

@media (max-width: 1180px) {
    .container { width: min(100% - 32px, 1120px); }

    .nav-flex { gap: 18px; }
    .nav-links { gap: 24px; }
    .search-input { width: 160px; }

    .products-grid,
    .all-products-grid,
    .category-products,
    .shop-products-grid,
    .search-results-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .product-details {
        gap: clamp(34px, 5vw, 68px);
    }
}

@media (max-width: 960px) {
    .top-bar { font-size: 12px; }

    .mobile-menu-toggle { display: inline-flex; order: 3; flex: 0 0 auto; }

    .main-header .nav-flex {
        min-height: 76px;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .logo-area { flex: 0 1 auto; min-width: 0; }
    .logo-text { white-space: nowrap; }
    
    .main-header .nav-links {
            display: none;
            position: absolute;
            inset: calc(100% + 1px) 0 auto 0;
            z-index: 950;
            padding: 16px;
            border: 1px solid #eadfce;
            border-radius: 0 0 18px 18px;
            background: #fff;
            box-shadow: 0 18px 40px rgba(27, 24, 21, .12);
            flex-direction: column;
            align-items: stretch;
            gap: 6px; /* Zmniejszamy odstępy między elementami */
        }

    .main-header .nav-links.is-open { 
        display: flex !important; 
    }

    .main-header .nav-links > a,
    .main-header .nav-links .dropdown > a {
        display: block;
        width: 100%;
        padding: 12px 14px;
        border-radius: 10px;
    }

    .main-header .nav-links a:hover,
    .main-header .nav-links a.active { background: #f7f1e8; }

    .main-header .dropdown { width: 100%; }
.main-header .dropdown-content {
        position: static !important; /* Usuwamy pozycjonowanie absolutne, które robiło pustkę */
        display: block !important;
        width: 100% !important;
        padding: 4px 0 4px 12px !important;
        border: 0 !important;
        box-shadow: none !important;
        background: transparent !important;
    }
.main-header .dropdown-content a { 
        padding: 8px 12px !important;
        font-size: 0.95rem;
    }

    .hero-section, .hero, .main-hero {
        position: relative;
        z-index: 1; /* Sprawiamy, że treść jest pod spodem i nie nakłada się dziwnie */
    }


    .nav-actions { margin-left: auto; }
    .nav-actions .search-input { display: none; }

    .product-details,
    .product-layout,
    .product-main-grid {
        grid-template-columns: minmax(0, 1fr);
        
    }

    .product-gallery,
    .product-details__content { width: min(100%, 760px); margin-inline: auto; }

    .product-description__grid,
    .features-grid,
    .info-cards-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

    .shop-layout,
    .category-layout {
        grid-template-columns: 210px minmax(0, 1fr);
        gap: 26px;
    }

    .products-grid,
    .all-products-grid,
    .category-products,
    .shop-products-grid,
    .search-results-grid,
    .favourites-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

    .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
    .container { width: min(100% - 24px, 680px); }

    .top-bar .container,
    .announcement-bar .container { gap: 8px; }
    .top-bar__socials,
    .top-bar .social-links { display: none; }

    .logo-circle { width: 38px; height: 38px; }
    .logo-text { font-size: clamp(19px, 5vw, 25px); }
    .nav-actions { gap: 6px; }
    .icon-btn { min-width: 34px; min-height: 34px; }

    .hero-section,
    .shop-hero,
    .all-products-hero,
    .category-hero,
    .info-page__hero { padding-block: 46px 32px; }

    .hero-content,
    .hero-section .container { padding-inline: 0; }

    h1,
    .product-details__content h1 { font-size: clamp(38px, 10.8vw, 58px); line-height: 1.02; }
    h2 { font-size: clamp(30px, 8vw, 44px); }

    .product-page { padding-inline: 12px; }
    .product-page__breadcrumbs { font-size: 12px; gap: 6px; margin-bottom: 24px; }
    .product-details { gap: 30px; }
    .product-gallery { padding: 0; border: 0; background: transparent; }

    .product-details__price { font-size: 27px; }
    .product-details__quantity { flex-wrap: wrap; }
    .product-details__add { width: 100%; }
    .product-details__benefits { grid-template-columns: minmax(0, 1fr); }

    .product-description__grid,
    .features-grid,
    .info-cards-grid,
    .footer-grid { grid-template-columns: minmax(0, 1fr); }

    .shop-layout,
    .category-layout { display: block; }
    .shop-sidebar,
    .category-sidebar {
        width: 100%;
        margin-bottom: 24px;
        position: static;
    }
    .shop-sidebar nav,
    .category-sidebar nav,
    .category-menu {
        display: flex;
        overflow-x: auto;
        gap: 8px;
        padding-bottom: 5px;
        scrollbar-width: thin;
    }
    .shop-sidebar a,
    .category-sidebar a,
    .category-menu a { flex: 0 0 auto; white-space: nowrap; }

    .products-grid,
    .all-products-grid,
    .category-products,
    .shop-products-grid,
    .search-results-grid,
    .favourites-grid { grid-template-columns: minmax(0, 1fr); }

    .all-products-filters {
        display: flex;
        overflow-x: auto;
        justify-content: flex-start;
        padding: 2px 2px 10px;
        gap: 8px;
    }
    .all-products-filters a { flex: 0 0 auto; white-space: nowrap; }

    .categories-list { grid-template-columns: minmax(0, 1fr); }
    .categories-modal__dialog,
    .modal-content {
        width: calc(100vw - 20px);
        max-width: calc(100vw - 20px);
        padding: 24px 16px 16px;
        border-radius: 18px;
    }
    .categories-modal__footer { flex-direction: column; align-items: stretch; gap: 12px; }
    .categories-modal__footer button { width: 100%; }

    .cart-drawer,
    .cart-panel { width: 100vw; max-width: 100vw; }
    .cart-item { grid-template-columns: 74px minmax(0, 1fr); }
    .cart-item__image { width: 74px; height: 96px; }

    .contact-form,
    .auth-card,
    .legal-page__content,
    .info-page__content,
    .profile-container { padding: 24px 18px; }

    .search-page__form { display: flex; width: 100%; }
    .search-page__form input { min-width: 0; flex: 1; }

    .birthday-carousel__arrow,
    .challenge-carousel__arrow,
    .product-carousel__arrow { width: 38px; height: 38px; }
}

@media (max-width: 430px) {
    .container { width: min(100% - 18px, 410px); }
    .logo-text { font-size: 19px; }
    .logo-area { gap: 6px !important; }
    .logo-circle { width: 34px; height: 34px; font-size: 13px; }
    .nav-actions .favourite-nav-icon { display: none; }
    .main-header .nav-flex { min-height: 68px; }

    .product-page { padding-inline: 9px; }
    .product-details__content h1 { font-size: clamp(34px, 11vw, 46px); }
    .product-details__eyebrow,
    .section-subtitle { letter-spacing: .15em; }

    .product-card,
    .all-product-card { border-radius: 15px; }
    .product-card-img { min-height: 220px; }

    .cart-item { grid-template-columns: 62px minmax(0, 1fr); gap: 10px; }
    .cart-item__image { width: 62px; height: 82px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}

/* --- OSTATECZNA NAPRAWA DROPDOWN W MENU MOBILNYM --- */
@media (max-width: 960px) {
    /* Upewniamy się, że kontener dropdown zachowuje się jak zwykły blok */
    .main-header .dropdown {
        display: block !important;
        width: 100% !important;
    }

    /* Wymuszenie widoczności elementów w rozwijanym menu sklepu na mobile */
    .main-header .dropdown-content {
        position: static !important;
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        max-height: none !important;
        opacity: 1 !important;
        visibility: visible !important;
        background: #fdfbf7 !important; /* Delikatne tło, żeby odróżnić podkategorie */
        border-radius: 8px !important;
        padding: 4px 8px 8px 16px !important;
        margin-top: 4px !important;
        box-shadow: none !important;
    }

    .main-header .dropdown-content a {
        font-size: 0.9rem !important;
        padding: 8px 10px !important;
        color: #444 !important;
        border-bottom: 1px solid rgba(0,0,0,0.03) !important;
    }
    
    .main-header .dropdown-content a:last-child {
        border-bottom: none !important;
    }
}

/* --- OSTATECZNE UCYWILIZOWANIE DROPDOWN W MENU MOBILNYM --- */
@media (max-width: 960px) {
    .main-header .dropdown {
        position: relative !important;
        width: 100% !important;
    }

    .main-header .dropdown-content {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
        transform: none !important;
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        max-width: 100% !important;
        background: #f7f3ec !important;
        border-radius: 12px !important;
        padding: 8px 12px !important;
        margin: 6px 0 10px 0 !important;
        box-shadow: none !important;
        border: 1px solid #e6decb !important;
        opacity: 1 !important;
        visibility: visible !important;
    }

    .main-header .dropdown-content a {
        display: block !important;
        width: 100% !important;
        padding: 10px 12px !important;
        font-size: 0.95rem !important;
        color: #2c2723 !important;
        border-bottom: 1px solid rgba(0,0,0,0.05) !important;
        text-align: left !important;
    }

    .main-header .dropdown-content a:last-child {
        border-bottom: none !important;
    }
}

/* --- POPRAWKA SEKCJI HERO NA TELEFONIE --- */
@media (max-width: 960px) {
    /* Zamiana siatki z 2 kolumn na 1 kolumnę (tekst nad, zdjęcie pod spodem) */
    .hero-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 2rem !important;
        width: 100% !important;
        padding: 1rem 0 !important;
    }

    /* Zawartość tekstowa i zdjęcie na pełną szerokość */
    .hero-content, 
    .hero-image-area {
        width: 100% !important;
        max-width: 100% !important;
        text-align: left !important; /* Wyrównanie tekstów do lewej wygląda profesjonalnie */
    }

    /* Zdjęcie planera ładnie dopasowane do szerokości ekranu */
    .hero-planner-img {
        width: 100% !important;
        height: auto !important;
        object-fit: contain !important;
        border-radius: 12px;
    }

    /* Przyciski w sekcji hero trzymają ładny układ flex */
    .hero-buttons {
        display: flex !important;
        flex-direction: column !important; /* Na małym ekranie przyciski jeden pod drugim są wygodniejsze do kliknięcia */
        gap: 10px !important;
        width: 100% !important;
    }

    .hero-buttons a {
        width: 100% !important;
        text-align: center !important;
        box-sizing: border-box !important;
    }

    /* Siatka z ikonami cech (Premium, Szybka wysyłka itp.) */
    .hero-features {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important; /* 2 kolumny dla oszczędności miejsca */
        gap: 12px !important;
        margin-top: 1.5rem !important;
    }
}

/* --- OGRANICZENIE SZEROKOŚCI STRON PRODUKTÓW --- */

.product-page {
    width: calc(100% - 40px);
    max-width: 1280px;
    margin-left: auto;
    margin-right: auto;
}

@media (max-width: 720px) {
    .product-page {
        width: 100%;
        max-width: 100%;
        padding-left: 12px;
        padding-right: 12px;
    }
}

@media (max-width: 1024px) {
    /* Przekształcenie siatki statystyk/haseł w pionową kolumnę */
    .stats-section .stats-grid,
    .stats-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 1.5rem !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 2rem 1rem !important;
        box-sizing: border-box !important;
        text-align: center !important;
    }

    /* Wyraźne zmniejszenie nagłówków, żeby pasowały do telefonu */
    .stats-section h2,
    .stats-section h3,
    .stats-grid h2,
    .stats-grid h3 {
        font-size: 1.15rem !important; /* Zmniejszona czcionka nagłówków */
        letter-spacing: 1px !important;
        line-height: 1.2 !important;
        margin-bottom: 0.25rem !important;
    }

    /* Mniejszy, czytelny tekst pod nagłówkami */
    .stats-section p,
    .stats-grid p {
        font-size: 0.95rem !important; /* Zmniejszona czcionka tekstu */
        line-height: 1.4 !important;
        margin: 0 !important;
    }

    .stats-section {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }
}

@media (max-width: 1024px) {
    /* Nadpisujemy dokładny selektor ze style.css, żeby wyeliminować flex: 48% */
    .hero-section .hero-grid {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .hero-section .hero-content {
        display: block !important;
        flex: none !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 2rem 1.2rem 3.5rem 1.2rem !important;
        text-align: center !important;
        background-color: var(--bg-color) !important;
        box-sizing: border-box !important;
        float: none !important;
    }

    .hero-content h1, 
    .hero-content p, 
    .hero-content div {
        text-align: center !important;
        margin-left: auto !important;
        margin-right: auto !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .hero-buttons {
        display: flex !important;
        flex-direction: column !important;
        gap: 12px !important;
        width: 100% !important;
        margin-top: 1.5rem !important;
    }

    .hero-buttons a, 
    .hero-buttons button {
        width: 100% !important;
        text-align: center !important;
        box-sizing: border-box !important;
    }

    .hero-image-area {
        display: block !important;
        position: relative !important;
        width: 100% !important;
        height: 380px !important;
        margin: 0 !important;
        padding: 0 !important;
        clear: both !important;
    }

    .hero-planner-img {
        width: 100% !important;
        height: 100% !important;
        min-height: 380px !important;
        object-fit: cover !important;
        -webkit-mask-image: linear-gradient(
            to bottom,
            transparent 0%,
            #000 15%
        );
        mask-image: linear-gradient(
            to bottom,
            transparent 0%,
            #000 15%
        );
    }
}

@media (max-width: 1024px) {
    /* Uporządkowanie kontenera modalu na mobile */
    .interior-modal,
    #interiorModal,
    .modal-overlay {
        padding: 5px !important;
        box-sizing: border-box !important;
    }

    .interior-modal-content,
    .modal-content {
        width: 95% !important;
        max-width: 100% !important;
        padding: 10px 8px !important;
        margin: auto !important;
        box-sizing: border-box !important;
        max-height: 98vh !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: space-between !important;
    }

    /* Konkretne powiększenie zdjęcia wewnątrz modalu */
    .interior-modal-content img,
    .modal-content img,
    .interior-modal-image {
        max-height: 48vh !important; /* Zdjęcie zajmuje prawie połowę wysokości ekranu */
        width: auto !important;
        max-width: 100% !important;
        object-fit: contain !important;
        margin: 0 auto !important;
    }

    /* Delikatne zmniejszenie tekstów i nagłówka, żeby oszczędzić miejsce */
    .interior-modal-content h2,
    .modal-content h2 {
        font-size: 1.15rem !important;
        margin: 2px 0 !important;
        line-height: 1.2 !important;
    }

    .interior-modal-content p,
    .modal-content p {
        font-size: 0.8rem !important;
        margin: 2px 0 !important;
        line-height: 1.25 !important;
    }

    /* Zmniejszenie miniaturek na samym dole */
    .interior-thumbnails,
    .modal-thumbnails {
        gap: 4px !important;
        margin-top: 4px !important;
    }

    .interior-thumbnails img,
    .modal-thumbnails img {
        width: 38px !important;
        height: 38px !important;
        object-fit: cover !important;
    }
}

/* ===== NAPRAWA UCINANIA KARUZELI ===== */

.birthday-carousel,
.challenge-carousel,
.product-carousel {
    height: auto !important;
    max-height: calc(100dvh - 20px) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
    overscroll-behavior: contain;
}

/* główne zdjęcie nie może zabierać prawie całego ekranu */
.birthday-carousel__main,
.challenge-carousel__main,
.product-carousel__main {
    height: auto !important;
    max-height: 58dvh !important;
    flex-shrink: 0 !important;
}

/* samo zdjęcie */
.birthday-carousel__main img,
.challenge-carousel__main img,
.product-carousel__main img {
    width: auto !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: 58dvh !important;
    object-fit: contain !important;
    margin-inline: auto !important;
}

/* tekst pod zdjęciem musi zachować swoją wysokość */
.birthday-carousel h2,
.birthday-carousel h3,
.birthday-carousel p,
.challenge-carousel h2,
.challenge-carousel h3,
.challenge-carousel p,
.product-carousel h2,
.product-carousel h3,
.product-carousel p {
    flex-shrink: 0 !important;
}

/* telefon / niski ekran */
@media (max-width: 720px), (max-height: 800px) {
    .birthday-carousel,
    .challenge-carousel,
    .product-carousel {
        max-height: calc(100dvh - 12px) !important;
    }

    .birthday-carousel__main,
    .challenge-carousel__main,
    .product-carousel__main,
    .birthday-carousel__main img,
    .challenge-carousel__main img,
    .product-carousel__main img {
        max-height: 48dvh !important;
    }
}

/* Naprawa proporcji zdjęć w karuzeli */
#plannerMainImage {
    width: 100%;
    height: auto;          /* Pozwala zachować naturalną wysokość wynikającą z proporcji */
    max-height: 70vh;      /* Opcjonalnie ogranicza wysokość na wyższych ekranach */
    object-fit: contain;   /* Dba o to, by grafika nigdy się nie rozciągała */
    display: block;
    margin: 0 auto;
}

/* Poprawka bloku "Kategorie" na urządzeniach mobilnych */
@media (max-width: 768px) {
    /* Główny kontener kategorii – wyrównanie i oddechy */
    .categories-box, 
    .sidebar-categories, 
    .category-filter-container { /* Dopasuj do swojej klasy kontenera */
        padding: 16px !important;
        margin: 10px auto !important;
        width: 100% !important;
        box-sizing: border-box;
    }

    /* Nagłówek sekcji w boksie */
    .categories-box h2, 
    .categories-box h3 {
        font-size: 1.25rem !important;
        margin-bottom: 12px !important;
        text-align: left;
    }

    /* Układ linków/przycisków kategorii w jednej kolumnie na telefonie */
    .categories-list-mobile,
    .categories-box nav,
    .category-links {
        display: flex;
        flex-direction: column;
        gap: 8px; /* Równe, estetyczne odstępy między opcjami */
    }

    /* Styl pojedynczego odnośnika/przycisku kategorii */
    .categories-box a, 
    .category-item {
        display: block;
        width: 100%;
        padding: 10px 14px;
        background-color: #faf9f6; /* Delikatne tło nawiązujące do beżu/bieli */
        border-radius: 8px;
        font-size: 0.95rem;
        color: #333;
        text-decoration: none;
        box-sizing: border-box;
        transition: background-color 0.2s ease;
    }

    /* Wyróżniona/aktywna kategoria (np. "Akcesoria" z czarnym tłem) */
    .categories-box a.active, 
    .category-item.active,
    .categories-box a[aria-current="page"] {
        background-color: #222 !important;
        color: #fff !important;
        font-weight: 500;
    }
}

/* Zmiana układu kategorii z dwóch kolumn na jedną na urządzeniach mobilnych */
@media (max-width: 800px) {
    aside.category-nav,
    .category-nav {
        display: flex !important;
        flex-direction: column !important;
        gap: 8px !important;
    }

    /* Opcjonalnie: rozciągnięcie przycisków/linków ładnie na całą szerokość */
    .category-nav a {
        display: block !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
}

/* Zmniejszenie i uporządkowanie boksu kategorii na urządzeniach mobilnych */
@media (max-width: 800px) {
    aside.category-nav,
    .category-nav {
        display: flex !important;
        flex-direction: column !important;
        gap: 4px !important;       /* Jeszcze mniejsze odstępy między elementami */
        padding: 10px !important;  /* Węższe marginesy wewnątrz całego boksu */
        max-width: 260px;          /* Opcjonalnie: możesz ograniczyć szerokość, żeby nie rozciągał się na całe okno */
        margin: 0 auto 15px auto;  /* Wyśrodkowanie boksu */
    }

    /* Nagłówek "Kategorie" wewnątrz boksu */
    .category-nav h2 {
        font-size: 1.1rem !important;
        margin-bottom: 6px !important;
    }

    /* Pojedyncze linki – mniejsze, zgrabniejsze przyciski */
    .category-nav a {
        display: block !important;
        width: 100% !important;
        box-sizing: border-box !important;
        padding: 6px 10px !important; /* Mniejszy padding wewnątrz linków */
        font-size: 0.88rem !important;  /* Nieco mniejsza, delikatna czcionka */
    }
}