/* Floating Navigation Styles */

/* =========================================================================
   Scoped resets — targeted only at the nav and search overlay.
   Nothing here touches WooCommerce, theme grids, or global elements.
   ========================================================================= */

/* Box-sizing scoped to nav elements only */
.floating-nav-header *,
.floating-nav-header *::before,
.floating-nav-header *::after,
.search-overlay *,
.search-overlay *::before,
.search-overlay *::after {
    box-sizing: border-box;
}

/* Logo image: explicit size lock so theme img resets can't blow it up */
.floating-nav-logo img {
    height: 35px !important;
    width: auto !important;
    max-width: none !important;
    display: block;
}

/* Ensure the nav container is always a flex row regardless of theme interference */
.floating-nav-container {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between;
    max-width: 1360px;
    margin: 0 auto;
    padding: 0 30px;
    height: 80px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
}

/* Dropdown: hidden by default, shown via JS adding .show */
.floating-nav-menu .dropdown-menu {
    display: none;
}
.floating-nav-menu .dropdown-menu.show {
    display: block;
}

/* =========================================================================
   Header Container
   ========================================================================= */

.floating-nav-header {
    position: fixed;
    top: 20px;
    left: 20px;
    right: 20px;
    z-index: 1002;
    transition: transform 0.3s ease, top 0.3s ease;
}

/* WordPress Admin Bar Adjustment */
.admin-bar .floating-nav-header {
    top: 52px; /* 32px admin bar + 20px margin */
}

@media screen and (max-width: 782px) {
    .admin-bar .floating-nav-header {
        top: 66px; /* 46px admin bar + 20px margin */
    }
}

.floating-nav-header.hidden {
    transform: translateY(-150%);
}

.floating-nav-header.scrolled {
    top: 10px;
}

.admin-bar .floating-nav-header.scrolled {
    top: 42px; /* 32px admin bar + 10px margin */
}

@media screen and (max-width: 782px) {
    .admin-bar .floating-nav-header.scrolled {
        top: 56px; /* 46px admin bar + 10px margin */
    }
}

/* =========================================================================
   Logo
   ========================================================================= */

.floating-nav-logo {
    flex-shrink: 0;
}

.floating-nav-logo a {
    display: block;
    text-decoration: none;
}

/* =========================================================================
   Main Navigation
   ========================================================================= */

.floating-nav-navigation {
    flex: 1;
    display: flex;
    justify-content: center;
    margin: 0 40px;
}

.floating-nav-menu {
    display: flex;
    align-items: center;
    margin: 0;
    padding: 0;
    list-style: none;
    gap: 5px;
}

.floating-nav-menu > li {
    position: relative;
}

.floating-nav-menu > li > a {
    display: flex;
    align-items: center;
    padding: 10px 18px;
    color: #2c3e50;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.2s ease;
    border-radius: 4px;
}

.floating-nav-menu > li > a:hover {
    color: #2196F3;
    background: rgba(33, 150, 243, 0.05);
}

/* Dropdown arrow */
.floating-nav-menu .dropdown-toggle::after {
    display: inline-block;
    margin-left: 6px;
    vertical-align: middle;
    content: "";
    border-top: 5px solid;
    border-right: 4px solid transparent;
    border-left: 4px solid transparent;
    transition: transform 0.2s ease;
}

.floating-nav-menu .dropdown:hover .dropdown-toggle::after {
    transform: rotate(180deg);
}

.floating-nav-menu .nav-link .menu-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
    margin-right: 8px;
}

/* =========================================================================
   Actions (right side)
   ========================================================================= */

.floating-nav-actions {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-shrink: 0;
}

.location-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #2c3e50;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    padding: 8px 12px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.location-indicator:hover {
    color: #2196F3;
    background: rgba(33, 150, 243, 0.05);
}

.location-icon {
    width: 18px;
    height: 18px;
    fill: #2196F3;
}

.search-toggle,
.cart-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: #2c3e50;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.search-toggle:hover,
.cart-toggle:hover {
    color: #2196F3;
    background: rgba(33, 150, 243, 0.05);
}

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

.cart-toggle {
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    gap: 8px;
}

.cart-amount {
    margin: 0;
}

.cta-button {
    background: #2196F3;
    color: #fff !important;
    border: none;
    padding: 10px 24px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    display: inline-block;
}

.cta-button:hover {
    background: #1976D2;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

/* =========================================================================
   Mega Menu
   ========================================================================= */

.floating-nav-menu .dropdown-menu {
    position: absolute !important;
    top: calc(100% + 20px) !important;
    left: 0 !important;
    right: auto !important;
    transform: none !important;
    border: none;
    border-radius: 16px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.15);
    padding: 20px;
    min-width: 800px;
    background: #f5f5f7;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 1001;
}

.floating-nav-menu .dropdown-menu.show {
    opacity: 1;
    visibility: visible;
}

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

/* Two Column Container */
.mega-menu-container {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 0;
    min-height: 400px;
}

/* Left Column */
.mega-menu-column-left {
    background: #fff;
    border-radius: 12px;
    padding: 24px 0;
}

.mega-menu-title {
    font-size: 12px;
    font-weight: 600;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin: 0 0 16px 24px;
}

.mega-menu-item {
    margin: 0;
    padding: 0;
    border-bottom: 1px solid #f0f0f0;
}

.mega-menu-item:last-child {
    border-bottom: none;
}

.mega-menu-item a {
    display: flex;
    align-items: center;
    padding: 18px 24px;
    color: #1a1a1a;
    text-decoration: none;
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 16px;
    background: transparent;
    gap: 16px;
    position: relative;
    border-left: 3px solid transparent;
    border-bottom: 1px solid transparent;
    margin-bottom: -1px;
}

.mega-menu-item.active a,
.mega-menu-item:hover a {
    border-bottom-color: #2196F3;
}

.mega-menu-item.has-submenu a::after {
    content: '›';
    position: absolute;
    right: 24px;
    font-size: 22px;
    color: #2196F3;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.mega-menu-item.active a::after,
.mega-menu-item:hover a::after {
    opacity: 1;
}

.mega-menu-item .menu-icon {
    width: 48px;
    height: 48px;
    object-fit: contain;
    flex-shrink: 0;
}

.mega-menu-item span {
    flex: 1;
}

.mega-menu-item .submenu-data {
    display: none;
}

/* Right Column */
.mega-menu-column-right {
    padding: 24px 32px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.mega-menu-column-right.active {
    opacity: 1;
}

.mega-menu-subtitle {
    font-size: 12px;
    font-weight: 600;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin: 0 0 20px 0;
}

.mega-menu-subcategories {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.mega-menu-subitem {
    margin: 0;
    padding: 0;
}

.mega-menu-subitem a {
    display: block;
    padding: 14px 0;
    font-size: 15px;
    font-weight: 400;
    color: #2c3e50;
    text-decoration: none;
    transition: color 0.2s ease;
}

.mega-menu-subitem a:hover {
    color: #2196F3;
}

/* =========================================================================
   Backdrop
   ========================================================================= */

body.dropdown-active::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 999;
    pointer-events: none;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* =========================================================================
   Search Overlay
   ========================================================================= */

.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    z-index: 9999;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding-top: 120px;
    animation: fadeIn 0.3s ease;
}

.search-overlay.active {
    display: flex;
}

.search-overlay-content {
    width: 100%;
    max-width: 1200px;
    padding: 0 40px;
}

.search-overlay h2 {
    font-size: 56px;
    font-weight: 600;
    margin-bottom: 40px;
    color: #2c3e50;
    letter-spacing: -1px;
}

.search-overlay-close {
    position: absolute;
    top: 40px;
    right: 40px;
    width: 50px;
    height: 50px;
    border: 2px solid #2c3e50;
    border-radius: 50%;
    background: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 300;
    color: #2c3e50;
    transition: all 0.3s ease;
    line-height: 1;
    padding: 0;
}

.search-overlay-close:hover {
    background: #2c3e50;
    color: #fff;
    transform: rotate(90deg);
}

.search-form {
    margin-bottom: 60px;
}

.search-form input[type="text"] {
    width: 100%;
    padding: 20px 0;
    font-size: 20px;
    border: none;
    border-bottom: 2px solid #e0e0e0;
    background: transparent;
    outline: none;
    color: #2c3e50;
    transition: border-color 0.3s ease;
}

.search-form input[type="text"]::placeholder {
    color: #95a5a6;
}

.search-form input[type="text"]:focus {
    border-bottom-color: #2196F3;
}

.recently-viewed {
    margin-top: 60px;
}

.recently-viewed-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.recently-viewed h3 {
    font-size: 28px;
    font-weight: 600;
    margin: 0;
    color: #2c3e50;
}

.recently-viewed-nav {
    display: flex;
    gap: 10px;
}

.recently-viewed-nav button {
    width: 40px;
    height: 40px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.2s ease;
}

.recently-viewed-nav button:hover {
    background: #2196F3;
    color: #fff;
    border-color: #2196F3;
}

.recently-viewed-items {
    display: flex;
    gap: 24px;
    overflow-x: auto;
    padding-bottom: 10px;
    scrollbar-width: thin;
    scrollbar-color: #ddd transparent;
}

.recently-viewed-items::-webkit-scrollbar {
    height: 6px;
}

.recently-viewed-items::-webkit-scrollbar-track {
    background: transparent;
}

.recently-viewed-items::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 3px;
}

.recently-viewed-category {
    flex: 0 0 auto;
    width: 320px;
    background: #f8f9fa;
    padding: 24px;
    border-radius: 12px;
}

.recently-viewed-category h4 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #2c3e50;
}

.recently-viewed-item {
    display: flex;
    gap: 16px;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid #e9ecef;
}

.recently-viewed-item:last-child {
    border-bottom: none;
}

.recently-viewed-item img {
    width: 90px;
    height: 90px;
    object-fit: contain;
    flex-shrink: 0;
}

.recently-viewed-item-info {
    flex: 1;
}

.recently-viewed-item-info h5 {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 6px 0;
    color: #2c3e50;
}

.recently-viewed-item-info .price {
    color: #2196F3;
    font-weight: 600;
    font-size: 14px;
    margin: 0;
}

.view-results-btn {
    width: 100%;
    padding: 14px;
    background: #B3E5FC;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    margin-top: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #0277BD;
}

.view-results-btn:hover {
    background: #81D4FA;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(129, 212, 250, 0.4);
}

/* =========================================================================
   Responsive
   ========================================================================= */

@media (max-width: 1200px) {
    .floating-nav-container {
        padding: 0 20px;
    }

    .floating-nav-navigation {
        margin: 0 20px;
    }

    .floating-nav-menu {
        gap: 2px;
    }

    .floating-nav-menu > li > a {
        padding: 10px 14px;
        font-size: 14px;
    }
}

@media (max-width: 992px) {
    .floating-nav-navigation {
        display: none;
    }

    .floating-nav-actions {
        gap: 12px;
    }

    .mega-menu {
        min-width: 90vw !important;
        left: 5vw !important;
        transform: none !important;
    }
}

@media (max-width: 768px) {
    .floating-nav-header {
        top: 10px;
        left: 10px;
        right: 10px;
    }

    .admin-bar .floating-nav-header {
        top: 56px;
    }

    .floating-nav-container {
        height: 70px;
        padding: 0 16px;
        border-radius: 12px;
    }

    .floating-nav-logo img {
        height: 28px !important;
    }

    .location-indicator span {
        display: none;
    }

    .cart-toggle {
        font-size: 12px;
    }

    .cta-button {
        padding: 8px 16px;
        font-size: 13px;
    }

    .search-overlay {
        padding-top: 80px;
    }

    .search-overlay h2 {
        font-size: 36px;
    }

    .search-overlay-content {
        padding: 0 20px;
    }

    .recently-viewed-items {
        flex-direction: column;
    }

    .recently-viewed-category {
        width: 100%;
    }
}
