/**
 * PyziTheme - megamenu.css (pyzitheme/assets/css/megamenu.css)
 * 
 * Styl dla megamenu - zarządzalny z kodu, nie z wordpressa
 *
 * @package     PyziTheme
 * @subpackage  Assets/CSS
 * @author      Patryk Kowalski <p.kowalski@kamikstudio.pl>
 * @copyright   2025 KamikStudio & PyziPyzi
 * @license     Proprietary
 * @version     1.0.0
 * @since       1.0.0
 * 
 * Client: PyziPyzi - Domowe wyroby cukiernicze
 * Website: https://pyzipyzi.pl
 * 
 * This file is part of PyziTheme.
 * Unauthorized copying or distribution is prohibited.
 */

.menu-item {
    position: relative;
}

.menu-item > a {
    display: flex;
    align-items: center;
    padding: 25px 18px;
    text-decoration: none;
    color: #333;
    font-size: 15px;
    font-weight: 500;
    transition: color 0.3s;
    cursor: pointer;
    white-space: nowrap;
}

.menu-item > a:hover {
    color: #ef6341;
}

.menu-item.current-menu-item > a,
.menu-item.current-menu-ancestor > a {
    color: #ef6341;
}

.menu-item .dropdown-icon {
    margin-left: 5px;
    font-size: 12px;
    transition: transform 0.3s;
}

/* ==========================================================================
   NAVBAR - BASE STYLES
   ========================================================================== */

.navbar {
    background-color: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    position: relative;
    z-index: 1000;
    font-size: 14px;
    line-height: 1.2;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 200px 1fr 200px;
    align-items: center;
    gap: 20px;
}

.logo {
    padding: 15px 0;
}

.logo a {
    display: block;
}

.logo img {
    height: 70px;
    width: auto;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 5px;
    align-items: center;
    justify-content: center;
}

.nav-item {
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 25px 18px;
    text-decoration: none;
    color: #333;
    font-size: 15px;
    font-weight: 500;
    transition: color 0.3s;
    cursor: pointer;
    white-space: nowrap;
}

.nav-link:hover {
    color: #ef6341;
}

.nav-link.active {
    color: #ef6341;
}

.dropdown-icon {
    margin-left: 5px;
    font-size: 12px;
    transition: transform 0.3s;
}

.mobile-toggle {
    display: none;
    background: none !important;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #333;
    padding: 8px;
    transition: color 0.2s ease;
}

.mobile-toggle:hover {
    color: #ef6341;
}

.mobile-toggle:active,
.mobile-toggle:focus,
.mobile-toggle.active {
    background: none !important;
    outline: none;
}

/* ==========================================================================
   SEARCH BAR
   ========================================================================== */

.search-bar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    background: #fff;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-100%);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s;
    z-index: 1001;
}

.search-bar.active {
    transform: translateY(0);
    opacity: 1;
}

.search-bar-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 15px;
}

.search-form {
    flex: 1;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 15px 60px 15px 20px;
    font-size: 16px;
    border: 2px solid #e3e3e3;
    border-radius: 50px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    outline: none;
    transition: border-color 0.3s;
}

.search-input:focus {
    border-color: #ef6341;
}

.search-submit {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: #ef6341;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
    padding: 0;
    flex-shrink: 0;
    line-height: 1;
    vertical-align: middle;
}

.search-submit:hover {
    background: #d94f2e;
}

.search-submit svg {
    width: 18px;
    height: 18px;
    fill: #fff;
}

.search-close {
    background: none;
    border: none;
    color: #333;
    font-size: 32px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s, color 0.3s;
    flex-shrink: 0;
}

.search-close:hover {
    transform: rotate(90deg);
    color: #ef6341;
}

/* ==========================================================================
   DESKTOP NAV ACTIONS - Search + Account + Social
   ========================================================================== */

.nav-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.search-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    transition: color 0.2s ease;
    width: 32px;
    height: 32px;
}

.search-toggle:hover {
    color: #ef6341;
}

.search-toggle svg {
    width: 20px;
    height: 20px;
}

.account-link {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #333;
    transition: color 0.2s ease;
    border-radius: 50%;
    text-decoration: none;
    padding: 0;
}

.account-link:hover {
    color: #ef6341;
}

.account-link.active {
    color: #ef6341;
}

.account-link svg {
    width: 20px;
    height: 20px;
    transition: color 0.2s ease;
}

.logged-in-dot {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 6px;
    height: 6px;
    background: #4CAF50;
    border-radius: 50%;
    border: 1.5px solid #fff;
    box-shadow: 0 0 0 1px rgba(76, 175, 80, 0.3);
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% {
        box-shadow: 0 0 0 1px rgba(76, 175, 80, 0.3);
    }
    50% {
        box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
    }
}

.desktop-social {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
}

.desktop-social-icon {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #ef6341;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-decoration: none;
    transition: background 0.2s ease;
}

.desktop-social-icon:hover {
    background: #d94f2e;
}

.desktop-social-icon svg {
    width: 12px;
    height: 12px;
    fill: currentColor;
}

/* ==========================================================================
   MEGA DROPDOWN - Desktop
   ========================================================================== */

@media (min-width: 1025px) {
    .nav-item:hover .dropdown-icon {
        transform: rotate(180deg);
    }

    .mega-dropdown {
        position: absolute;
        top: 100%;
        left: 50%;
        transform: translateX(-50%) translateY(8px);
        background: rgba(255, 255, 255, 0.96);
        backdrop-filter: blur(6px);
        border-radius: 12px;
        box-shadow: 0 10px 28px rgba(0,0,0,0.12);
        padding: 30px;
        min-width: 600px;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s, visibility 0.3s, transform 0.3s;
        margin-top: 10px;
    }

    .nav-item:hover .mega-dropdown {
        opacity: 1;
        visibility: visible;
        transform: translateX(-50%) translateY(0);
    }

    .mega-dropdown.wide {
        min-width: 900px;
    }

    .nav-item:nth-last-child(-n+3) .mega-dropdown.wide {
        left: auto;
        right: 0;
        transform: translateY(8px);
    }
    
    .nav-item:nth-last-child(-n+3) .mega-dropdown:not(.wide) {
        left: auto;
        right: 0;
        transform: translateY(8px);
    }
    
    .nav-item:nth-last-child(-n+3):hover .mega-dropdown {
        transform: translateY(0);
    }

    .dropdown-content {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 50px;
        margin-bottom: 25px;
    }

    .dropdown-content.four-columns {
        grid-template-columns: repeat(4, 1fr);
        gap: 35px;
    }

    .dropdown-column h3 {
        position: relative;
        color: #5e341c;
        font-size: 20px;
        margin-bottom: 18px;
        font-weight: 600;
        letter-spacing: 0.3px;
        padding-bottom: 6px;
    }

    .dropdown-column h3::after {
        content: "";
        position: absolute;
        bottom: 0;
        left: 0;
        width: 35px;
        height: 2px;
        background: #ef6341;
        border-radius: 2px;
    }

    .dropdown-item {
        margin-bottom: 8px;
    }

    .dropdown-item-title {
        position: relative;
        color: #333;
        font-weight: 600;
        font-size: 14px;
        margin-bottom: 4px;
        cursor: pointer;
        transition: color 0.3s;
        text-decoration: none;
        display: inline-block;
    }

    .dropdown-item-title:hover {
        color: #ef6341;
    }

    .dropdown-item-title::after {
        content: "";
        position: absolute;
        left: 0;
        bottom: -2px;
        width: 0;
        height: 1px;
        background: #ef6341;
        transition: width 0.3s;
    }

    .dropdown-item-title:hover::after {
        width: 100%;
    }

    .dropdown-item a.dropdown-item-title {
        text-decoration: none;
    }

    .dropdown-item-desc {
        color: #666;
        font-size: 13px;
        line-height: 1.5;
    }

    .dropdown-footer {
        padding-top: 20px;
        text-align: left;
        background: #f1f1f1;
        margin: 0 -30px -30px -30px;
        padding: 20px 30px;
        border-radius: 0 0 12px 12px;
    }

    .dropdown-footer a {
        color: #333;
        font-weight: 600;
        font-size: 15px;
        text-decoration: none;
        display: inline-flex;
        align-items: center;
        transition: color 0.3s, transform 0.2s;
    }

    .dropdown-footer a:hover {
        color: #ef6341;
        transform: translateX(4px);
    }

    .dropdown-footer strong {
        color: #333;
        font-size: 15px;
    }
    
    .menu-item:hover .dropdown-icon {
        transform: rotate(180deg);
    }
    
    .menu-item:hover .mega-dropdown {
        opacity: 1;
        visibility: visible;
        transform: translateX(-50%) translateY(0);
    }
    
    .menu-item:nth-last-child(-n+3):hover .mega-dropdown {
        transform: translateY(0);
    }
    
    /* UKRYJ MOBILE ACTIONS NA DESKTOP */
    .mobile-actions {
        display: none !important;
    }
}

/* ==========================================================================
   MOBILE RESPONSIVE - KOMPAKTOWE
   ========================================================================== */

@media (max-width: 1024px) {
    .mobile-toggle {
        display: block;
        position: absolute;
        right: 20px;
        z-index: 10001;
        background: none !important;
        padding: 8px;
    }

    .nav-container {
        grid-template-columns: 1fr;
        justify-items: center;
        position: relative;
    }

    .logo {
        text-align: center;
    }

    .nav-actions {
        display: none !important;
    }

    .site-header {
        position: sticky;
        top: 0;
        z-index: 10000;
        background: #fff;
    }

    .nav-menu {
        position: fixed;
        left: -100%;
        top: 0;
        flex-direction: column;
        background-color: #fff;
        width: 100%;
        height: 100vh;
        text-align: left;
        transition: left 0.3s ease-in-out;
        box-shadow: 0 10px 27px rgba(0,0,0,0.15);
        overflow-y: auto;
        overflow-x: hidden;
        gap: 0;
        z-index: 9999;
        padding-top: 80px;
        padding-bottom: 20px;
    }

    .nav-menu.active {
        left: 0;
    }

    .mobile-actions {
        display: flex !important;
        flex-direction: column;
        gap: 12px;
        padding: 15px 20px;
        border-top: 2px solid #f0f0f0;
        background: #fff;
        position: sticky;
        bottom: 0;
        left: 0;
        z-index: 10;
        width: 100%;
    }
    
    /* Przyciski Search i Konto w jednej linii */
    .mobile-actions-buttons {
        display: flex !important;
        gap: 10px;
        width: 100%;
    }

    .mobile-search-btn,
    .mobile-account-btn {
        display: flex !important;
        align-items: center;
        justify-content: center;
        gap: 8px;
        padding: 12px 20px;
        border: none;
        border-radius: 8px;
        font-size: 14px;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.3s ease;
        text-decoration: none;
        position: relative;
        flex: 1;
    }

    .mobile-search-btn {
        background: linear-gradient(135deg, #ef6341 0%, #d94e2a 100%);
        color: #fff;
        box-shadow: 0 2px 8px rgba(239, 99, 65, 0.25);
    }

    .mobile-search-btn:hover {
        background: linear-gradient(135deg, #d94e2a 0%, #c23d1a 100%);
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(239, 99, 65, 0.35);
    }

    .mobile-search-btn svg {
        width: 18px;
        height: 18px;
        fill: currentColor;
    }

    .mobile-account-btn {
        background: #fff;
        color: #333;
        border: 2px solid #e0e0e0;
    }

    .mobile-account-btn:hover {
        border-color: #ef6341;
        color: #ef6341;
        background: #fff9f7;
    }

    .mobile-account-btn svg {
        width: 18px;
        height: 18px;
        stroke: currentColor;
    }

    .mobile-account-btn .logged-in-dot {
        position: absolute;
        top: 8px;
        right: 8px;
        width: 6px;
        height: 6px;
        background: #4CAF50;
        border-radius: 50%;
        border: 1.5px solid #fff;
    }

    .mobile-social-icons {
        display: flex !important;
        gap: 8px;
        margin-bottom: 12px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .social-icon {
        width: 36px;
        height: 36px;
        border-radius: 50%;
        background: #ef6341;
        display: flex !important;
        align-items: center;
        justify-content: center;
        color: #fff;
        text-decoration: none;
        transition: background 0.2s ease;
    }

    .social-icon:hover {
        background: #d94f2e;
    }

    .social-icon svg {
        width: 16px;
        height: 16px;
        fill: currentColor;
    }

    .mobile-phone {
        display: flex !important;
        align-items: center;
        justify-content: center;
        gap: 6px;
        font-size: 13px;
        font-weight: 600;
        color: #333;
        padding: 8px;
        background: #f9f9f9;
        border-radius: 8px;
    }

    .mobile-phone a {
        color: #ef6341;
        text-decoration: none;
        transition: color 0.2s ease;
    }

    .mobile-phone a:hover {
        color: #d94f2e;
    }

    .mobile-phone svg {
        width: 16px;
        height: 16px;
        fill: #ef6341;
    }
    
    .nav-item,
    .menu-item {
        width: 100%;
        border-bottom: 1px solid #f0f0f0;
        background: #fff;
    }

    .nav-link,
    .menu-item > a {
        padding: 14px 20px;
        width: 100%;
        justify-content: space-between;
        font-size: 15px;
        font-weight: 500;
        background: #fff;
        display: flex;
        align-items: center;
    }

    .nav-item.mobile-active .nav-link,
    .menu-item.mobile-active > a {
        font-weight: 600;
        background: #fff9f7;
        color: #ef6341;
    }

    .mega-dropdown {
        position: static;
        transform: none;
        box-shadow: none;
        border-radius: 0;
        min-width: auto;
        padding: 0;
        background: #fafafa;
        display: none;
        margin-top: 0;
        opacity: 1;
        visibility: visible;
    }

    .nav-item.mobile-active .mega-dropdown,
    .menu-item.mobile-active .mega-dropdown {
        display: block;
    }

    .dropdown-content {
        grid-template-columns: 1fr;
        gap: 0;
        margin-bottom: 0;
        padding-left: 0;
        background: #fafafa;
        display: block;
    }

    .dropdown-content.four-columns {
        grid-template-columns: 1fr;
    }

    .dropdown-column {
        border-bottom: 1px solid #e8e8e8;
        background: #fafafa;
    }

    .dropdown-column:last-child {
        border-bottom: none;
    }

    .dropdown-column h3 {
        padding: 12px 20px 12px 30px;
        margin-bottom: 0;
        cursor: pointer;
        display: flex;
        justify-content: space-between;
        align-items: center;
        font-size: 14px;
        font-weight: 600;
        color: #5e341c;
        background: #fafafa;
    }

    .dropdown-column h3::after {
        content: '▼';
        font-size: 10px;
        color: #ef6341;
        transition: transform 0.3s;
    }

    .dropdown-column.mobile-expanded h3::after {
        transform: rotate(180deg);
    }

    .dropdown-column .dropdown-items-wrapper {
        display: none;
        padding: 8px 20px 12px 40px;
        background: #f5f5f5;
    }

    .dropdown-column.mobile-expanded .dropdown-items-wrapper {
        display: block;
    }

    .dropdown-item {
        display: block;
        padding: 8px 0;
        font-size: 14px;
        color: #666;
        text-decoration: none;
        transition: color 0.2s ease;
        line-height: 1.4;
    }

    .dropdown-item:hover {
        color: #ef6341;
    }

    .dropdown-item strong {
        color: #333;
        font-weight: 600;
        display: block;
        margin-bottom: 2px;
    }

    .dropdown-item-desc {
        color: #999;
        font-size: 12px;
        line-height: 1.4;
    }

    .dropdown-footer {
        padding: 12px 20px;
        text-align: left;
        background: #f1f1f1;
        margin: 0;
        border-radius: 0;
    }

    .dropdown-footer a {
        color: #333;
        font-weight: 600;
        font-size: 14px;
        text-decoration: none;
        display: inline-flex;
        align-items: center;
        transition: color 0.3s, transform 0.2s;
    }

    .dropdown-footer a:hover {
        color: #ef6341;
        transform: translateX(4px);
    }

    .dropdown-footer {
        display: none !important;
    }

    .search-bar {
        padding: 12px 15px;
        top: 0;
        z-index: 10001;
    }
    
    .search-input {
        padding: 12px 50px 12px 16px;
        font-size: 15px;
    }
    
    .search-submit {
        width: 36px;
        height: 36px;
    }
    
    .search-close {
        font-size: 26px;
        width: 36px;
        height: 36px;
    }
}

@media (max-width: 375px) {
    .nav-link,
    .menu-item > a {
        padding: 12px 16px;
        font-size: 14px;
    }
    
    .dropdown-column h3 {
        padding: 10px 16px 10px 26px;
        font-size: 13px;
    }
    
    .dropdown-item {
        padding: 6px 0;
        font-size: 13px;
    }
    
    .mobile-search-btn,
    .mobile-account-btn {
        padding: 10px 16px;
        font-size: 13px;
    }
}