/* ============================================================
   EURO-DREWNO MEGA MENU — mega-menu.css
   Wklej do: Elementor > Site Settings > Custom CSS
   lub do pliku custom-styles.css swojego motywu
   ============================================================ */

/* ----------------------------------------------------------------
   0. HEADER REFINEMENT (Stay on top)
   ---------------------------------------------------------------- */
.elementor-location-header,
header.site-header,
.elementor-sticky--active {
    z-index: 10002 !important;
    /* Highest layer */
}

.euro-mega-parent>a {
    position: relative;
}

/* Indicator arrow */
.euro-mega-parent>a::after {
    content: '▾';
    display: inline-block;
    margin-left: 5px;
    font-size: 11px;
    transition: transform 0.2s ease;
}

.euro-mega-parent.is-open>a::after {
    transform: rotate(180deg);
}

/* ----------------------------------------------------------------
   2. MEGA MENU CONTAINER
   ---------------------------------------------------------------- */
.euro-mega-menu {
    display: none;
    position: fixed;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    width: 1440px;
    z-index: 10001;
    background: #fff;
    border-radius: 0 0 40px 40px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
    padding: 40px 60px;
    top: 130px;
    /* Fallback */
    font-family: 'Inter', sans-serif;
    overflow: hidden;

    /* animacja */
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease, top 0.2s ease;
}

/* "Bridge" - niewidoczny obszar łączący nagłówek z menu, zapobiegający migotaniu */
.euro-mega-menu::before {
    content: '';
    position: absolute;
    top: -80px;
    /* Przykrywa lukę między pillem a menu plus zapas */
    left: 0;
    right: 0;
    height: 80px;
    background: transparent;
    z-index: 10002;
    /* Nad wszystkim żeby łapać hover */
}

.euro-mega-menu.is-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ----------------------------------------------------------------
   3. LAYOUT: LEWA (Sidebar) / PRAWA (Content)
   ---------------------------------------------------------------- */
.euro-mega-layout {
    display: flex;
    gap: 32px;
}

/* ----------------------------------------------------------------
   4. SIDEBAR KATEGORII
   ---------------------------------------------------------------- */
.euro-mega-sidebar {
    flex: 0 0 260px;
    border-right: 1px solid #EAEAEA;
    padding-right: 24px;
    display: flex;
    flex-direction: column;
}

.euro-mega-cat-list {
    list-style: none;
    margin: 0;
    padding: 0;
    flex-grow: 1;
}

.euro-mega-cat-item {
    margin-bottom: 4px;
}

.euro-mega-cat-item a {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    text-decoration: none;
    color: #1A1A1A;
    font-weight: 500;
    font-size: 15px;
    border-radius: 6px;
    transition: background 0.2s ease, color 0.2s ease;
}

.euro-mega-cat-item.is-active a,
.euro-mega-cat-item a:hover {
    background: #F5EFE6;
    color: #C4956A;
}

.euro-cat-icon {
    width: 24px;
    height: 24px;
    margin-right: 12px;
    object-fit: contain;
}

.euro-cat-arrow {
    margin-left: auto;
    font-size: 18px;
    color: #999;
    opacity: 0;
    transform: translateX(-5px);
    transition: opacity 0.2s, transform 0.2s;
}

.euro-mega-cat-item.is-active .euro-cat-arrow,
.euro-mega-cat-item a:hover .euro-cat-arrow {
    opacity: 1;
    transform: translateX(0);
    color: #C4956A;
}

.euro-mega-sidebar-footer {
    padding-top: 20px;
    margin-top: 10px;
}

.euro-mega-cta-all {
    display: inline-block;
    padding: 10px 0;
    font-size: 14px;
    font-weight: 700;
    color: #1A1A1A;
    text-decoration: none;
    border-bottom: 1px solid currentColor;
    transition: color 0.2s;
}

.euro-mega-cta-all:hover {
    color: #C4956A;
}

/* ----------------------------------------------------------------
   5. PRAWA STRONA (PRODUKTY)
   ---------------------------------------------------------------- */
.euro-mega-content {
    flex: 1;
    position: relative;
    min-height: 280px;
}

.euro-mega-pane {
    display: none;
    animation: edFadeIn 0.3s ease;
}

.euro-mega-pane.is-active {
    display: block;
}

@keyframes edFadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.euro-mega-pane-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #EAEAEA;
}

.euro-mega-pane-title {
    font-size: 20px;
    font-weight: 700;
    color: #1A1A1A;
    margin: 0;
}

.euro-mega-pane-link {
    font-size: 13px;
    font-weight: 600;
    color: #C4956A;
    text-decoration: none;
}

.euro-mega-pane-link:hover {
    text-decoration: underline;
}

/* Siatka produktów */
.euro-mega-products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.euro-mega-product-card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s;
}

.euro-mega-product-card:hover {
    transform: translateY(-3px);
}

.euro-mega-product-img {
    aspect-ratio: 1 / 1;
    background: #F8F8F8;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 12px;
    border: 1px solid #EAEAEA;
}

.euro-mega-product-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.euro-mega-product-placeholder {
    width: 100%;
    height: 100%;
    background: #EEE;
}

.euro-mega-product-title {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.euro-mega-empty {
    grid-column: 1 / -1;
    color: #888;
    font-size: 14px;
    padding: 20px 0;
}

/* ----------------------------------------------------------------
   8. OVERLAY (ściemnienie tła)
   ---------------------------------------------------------------- */
/* Overlay removed as per user request */
.euro-mega-overlay {
    display: none !important;
}

/* ----------------------------------------------------------------
   6. PANEL PRODUKTÓW (nowy layout — bez sidebara kategorii)
   ---------------------------------------------------------------- */
.euro-mega-menu--products .euro-mega-products-panel {
    width: 100%;
}

.euro-mega-menu--products .euro-mega-products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 28px;
}

.euro-mega-menu--products .euro-mega-product-card {
    position: relative;
}

.euro-mega-product-price {
    font-size: 12px;
    font-weight: 600;
    color: #C4956A;
    margin-top: 4px;
}

.euro-mega-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    background: #E8F5E9;
    color: #2e7d32;
    pointer-events: none;
}

.euro-mega-footer {
    text-align: center;
    padding-top: 16px;
    border-top: 1px solid #EAEAEA;
}

/* ----------------------------------------------------------------
   9. RESPONSIVE — TABLET (2 kolumny)
   ---------------------------------------------------------------- */
@media (max-width: 1024px) {
    .euro-mega-menu {
        padding: 30px 30px 24px;
    }

    .euro-mega-grid,
    .euro-mega-menu--products .euro-mega-products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
}

/* ----------------------------------------------------------------
   10. RESPONSIVE — MOBILE (accordion, ≤768px)
   ---------------------------------------------------------------- */
@media (max-width: 768px) {

    /* Menu staje się statyczne, nie fixed */
    .euro-mega-menu {
        position: static;
        display: none !important;
        /* ukryte domyślnie, JS zarządza */
        box-shadow: none;
        padding: 0 16px 16px;
        border-top: 2px solid #EDE5D8;
    }

    /* Accordion — widoczność przez klasę */
    .euro-mega-menu.accordion-open {
        display: block !important;
        opacity: 1;
        transform: none;
    }

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

    .euro-mega-card {
        opacity: 1;
        transform: none;
        padding: 14px 16px;
    }

    .euro-mega-card__icon {
        width: 32px;
        height: 32px;
        margin-bottom: 8px;
    }

    .euro-mega-footer {
        margin-top: 16px;
    }

    /* Overlay niewidoczny na mobile */
    .euro-mega-overlay {
        display: none !important;
    }
}

/* ══════════════════════════════════════════════════════════════
   LANGUAGE SWITCHER — Connect Polylang Elementor (cpel)
   ══════════════════════════════════════════════════════════════ */

/* ── Toggle: pill button z aktywnym językiem ── */
.cpel-switcher--layout-dropdown .cpel-switcher__toggle {
    display: inline-flex !important;
    align-items: center;
    padding: 5px 10px 5px 8px;
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.cpel-switcher--layout-dropdown .cpel-switcher__toggle:hover,
.cpel-switcher--layout-dropdown .cpel-switcher__toggle--on {
    background: rgba(255, 255, 255, 0.20);
    border-color: rgba(255, 255, 255, 0.42);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

/* Link wewnątrz toggle — flex row */
.cpel-switcher--layout-dropdown .cpel-switcher__toggle a {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    text-decoration: none !important;
}

/* ── Flagi ── */
.cpel-switcher__flag img {
    display: block;
    width: 22px;
    height: 16px;
    border-radius: 3px;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.40);
    object-fit: cover;
    flex-shrink: 0;
}

/* ── Kody językowe (na linku, bez konfliktu z flagą) ── */
/* W dropdown: a[lang] ::after — lista items nie mają ikony, więc ::after ląduje obok flagi */
.cpel-switcher__list .cpel-switcher__lang a[lang^="pl"]::after { content: "PL"; }
.cpel-switcher__list .cpel-switcher__lang a[lang^="en"]::after { content: "EN"; }
.cpel-switcher__list .cpel-switcher__lang a[lang^="de"]::after { content: "DE"; }
.cpel-switcher__list .cpel-switcher__lang a[lang^="fr"]::after { content: "FR"; }

.cpel-switcher__list .cpel-switcher__lang a::after {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: #5C3D1E;
    line-height: 1;
}

/* ── Caret (strzałka) ── */
.cpel-switcher__icon {
    font-size: 10px !important;
    color: rgba(255, 255, 255, 0.65) !important;
    transition: transform 0.22s ease;
}

.cpel-switcher__toggle--on .cpel-switcher__icon {
    transform: rotate(180deg);
}

/* ── Dropdown lista: tylko wygląd, NIE ruszamy max-height/overflow/position ──
   Plugin animuje przez max-height 0 → auto, overflow:hidden — musimy to zostawić */
.cpel-switcher--layout-dropdown .cpel-switcher__list {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.16), 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 5px;
    border: 1px solid rgba(92, 61, 30, 0.10);
    margin-top: 6px;
}

/* ── Elementy listy ── */
.cpel-switcher--layout-dropdown .cpel-switcher__list .cpel-switcher__lang a {
    display: inline-flex !important;
    align-items: center;
    gap: 9px;
    width: 100%;
    box-sizing: border-box;
    padding: 8px 14px 8px 10px !important;
    border-radius: 7px;
    color: #3a2508 !important;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-decoration: none !important;
    transition: background 0.15s;
    background: transparent !important;
}

.cpel-switcher--layout-dropdown .cpel-switcher__list .cpel-switcher__lang a:hover {
    background: #f5ede2 !important;
    color: #5C3D1E !important;
}

/* Separator między językami */
.cpel-switcher--layout-dropdown .cpel-switcher__list .cpel-switcher__lang + .cpel-switcher__lang {
    margin-top: 2px;
}