/* ============================================
   WR Plus - Navigation Bar Widget Styles
   ============================================ */

/* --- Base Nav Bar --- */
.wr-nav-wrapper {
    position: relative;
    width: 100%;
    visibility: visible !important;
    opacity: 1 !important;
}

.wr-nav-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    position: relative;
    z-index: 100;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    overflow: hidden;
}

.wr-nav-bar.wr-sticky {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
}

.wr-nav-bar.wr-sticky-hidden {
    transform: translateY(-100%);
    transition: transform 0.35s ease;
}

.wr-nav-bar.wr-sticky-visible {
    transform: translateY(0);
    transition: transform 0.35s ease;
}

.wr-nav-left,
.wr-nav-right {
    display: flex;
    align-items: center;
}

.wr-nav-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.wr-nav-logo img {
    display: block;
    max-width: 100%;
    height: auto;
}

.wr-nav-logo-text {
    text-decoration: none;
    font-weight: 600;
}

/* --- Icons --- */
.wr-nav-icon,
.wr-search-expand-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    position: relative;
    line-height: 1;
    transition: color 0.2s ease;
    text-decoration: none;
}

.wr-nav-icon:hover,
.wr-nav-icon:focus,
.wr-search-expand-icon:hover,
.wr-search-expand-icon:focus {
    text-decoration: none;
    background: none;
}

.wr-nav-icon svg,
.wr-nav-icon i,
.wr-search-expand-icon svg,
.wr-search-expand-icon i,
.wr-search-expand-icon img {
    width: 1em;
    height: 1em;
    display: block;
}

/* Ensure uploaded SVG path fills respond to CSS color controls */
.wr-nav-icon svg *,
.wr-search-expand-icon svg * {
    transition: fill 0.2s ease;
}

.wr-cart-icon {
    position: relative;
}

.wr-cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 10px;
    font-weight: 600;
    line-height: 1;
}

/* --- Search Expand (inline overlay within nav bar) --- */
.wr-search-expand {
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    gap: 15px;
    padding: inherit;
    z-index: 101;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.wr-search-expand.active {
    opacity: 1;
    pointer-events: auto;
}

.wr-search-expand-icon {
    flex-shrink: 0;
    transition: opacity 0.2s ease;
    max-width: 1em;
    max-height: 1em;
    overflow: hidden;
}

.wr-search-expand-icon.wr-search-loading {
    animation: wr-spin 0.8s linear infinite;
    opacity: 0.7;
}

@keyframes wr-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.wr-search-expand-input {
    flex: 1;
    border: none !important;
    outline: none;
    background: transparent !important;
    font-size: 16px;
    padding: 0 !important;
    min-width: 0;
    border-radius: 0 !important;
    line-height: 1;
    box-shadow: none !important;
    filter: none !important;
    appearance: none;
}

.wr-search-expand-input::placeholder {
    color: #999;
}

.wr-search-expand-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    flex-shrink: 0;
    color: inherit;
}

/* --- Nav bar search-active states --- */
.wr-nav-bar.search-active .wr-nav-left {
    opacity: 0;
    transform: translateX(-20px);
    pointer-events: none;
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.wr-nav-bar.search-active .wr-nav-right {
    opacity: 0;
    transform: translateX(20px);
    pointer-events: none;
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.wr-nav-bar.search-active .wr-nav-center {
    opacity: 0;
    transform: translateX(-50%) scale(0.95);
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Search Results --- */
.wr-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-top: none;
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.wr-search-results.wr-results-visible {
    display: block;
}

/* --- Search Results: List Layout --- */
.wr-search-results[data-layout="list"] .wr-result-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 20px;
    border-bottom: 1px solid #f0f0f0;
    text-decoration: none;
    transition: background 0.2s ease;
}

.wr-search-results[data-layout="list"] .wr-result-item:hover {
    background: #f9f9f9;
}

.wr-search-results[data-layout="list"] .wr-result-image {
    width: 50px;
    height: 50px;
    object-fit: cover;
    flex-shrink: 0;
    border-radius: 4px;
}

.wr-search-results[data-layout="list"] .wr-result-info {
    flex: 1;
    min-width: 0;
}

/* --- Search Results: Grid Layout --- */
.wr-search-results[data-layout="grid"] {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

.wr-search-results[data-layout="grid"] .wr-result-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    border-right: 1px solid #f0f0f0;
    text-decoration: none;
    transition: background 0.2s ease;
}

.wr-search-results[data-layout="grid"] .wr-result-item:hover {
    background: #f9f9f9;
}

.wr-search-results[data-layout="grid"] .wr-result-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    flex-shrink: 0;
    border-radius: 4px;
}

.wr-search-results[data-layout="grid"] .wr-result-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.wr-result-title {
    font-size: 14px;
    font-weight: 500;
    margin: 0 0 4px 0;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wr-result-price {
    font-size: 13px;
    margin: 0;
    line-height: 1.3;
}

.wr-search-no-results {
    padding: 20px;
    text-align: center;
    color: #999;
    font-size: 14px;
}

/* --- Sidebar --- */
.wr-sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.wr-sidebar-overlay.wr-overlay-active {
    opacity: 1;
    visibility: visible;
}

.wr-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    background: #ffffff;
    z-index: 999;
    transform: translateX(-100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.wr-sidebar.wr-sidebar-active {
    transform: translateX(0);
}

.wr-sidebar-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    color: inherit;
}

.wr-sidebar-content {
    padding: 60px 30px 40px;
    flex: 1;
}

.wr-sidebar-title {
    margin: 0 0 15px 0;
    font-size: 22px;
    font-weight: 600;
}

.wr-sidebar-divider {
    height: 1px;
    background: #e0e0e0;
    margin: 20px 0;
}

/* --- Custom Menu with Accordion --- */
.wr-sidebar-menu {
    margin: 10px 0;
}

.wr-menu-list,
.wr-sidebar-menu .menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.wr-menu-list li,
.wr-sidebar-menu .menu li {
    margin: 0;
    padding: 0;
}

.wr-menu-list a,
.wr-sidebar-menu .menu a {
    display: block;
    padding: 12px 0;
    text-decoration: none;
    font-size: 16px;
    transition: color 0.2s ease;
    border-bottom: 1px solid #f5f5f5;
}

.wr-menu-list li:last-child a,
.wr-sidebar-menu .menu li:last-child a {
    border-bottom: none;
}

/* Custom menu specific */
.wr-custom-menu .wr-menu-item {
    border-bottom: 1px solid #f5f5f5;
}

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

.wr-menu-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 0;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s ease;
}

.wr-menu-link:hover {
    text-decoration: none;
}

.wr-menu-item-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 18px;
    width: 24px;
}

.wr-menu-item-icon svg {
    width: 1em;
    height: 1em;
}

.wr-menu-item-text {
    flex: 1;
}

/* Submenu toggle icons */
.wr-submenu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.3s ease;
    cursor: pointer;
    padding: 4px;
}

.wr-submenu-toggle svg {
    width: 12px;
    height: 12px;
}

.wr-submenu-icon-open {
    display: none;
}
.wr-has-submenu.wr-submenu-open .wr-submenu-toggle .wr-submenu-icon-open {
    display: inline-flex;
}
.wr-has-submenu.wr-submenu-open .wr-submenu-toggle .wr-submenu-icon-closed {
    display: none;
}

.wr-submenu {
    list-style: none;
    margin: 0;
    padding: 0 0 0 36px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, padding 0.35s ease;
}

.wr-has-submenu.wr-submenu-open .wr-submenu {
    max-height: 500px;
    padding: 8px 0 12px 36px;
}

.wr-submenu li {
    margin: 0;
    padding: 0;
}

.wr-submenu li a {
    display: block;
    padding: 8px 0;
    text-decoration: none;
    font-size: 14px;
    opacity: 0.8;
    transition: opacity 0.2s ease, color 0.2s ease;
    border-bottom: none;
}

.wr-submenu li a:hover {
    opacity: 1;
    text-decoration: none;
}

/* --- Social Icons --- */
.wr-sidebar-social {
    display: flex;
    gap: 20px;
    margin: 10px 0;
}

.wr-sidebar-social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    text-decoration: none;
    transition: color 0.2s ease;
}

.wr-sidebar-social a:hover {
    text-decoration: none;
}

.wr-sidebar-social a svg {
    width: 20px;
    height: 20px;
}

/* --- Sidebar Button --- */
.wr-sidebar-button-wrap {
    margin-top: 20px;
}

.wr-sidebar-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    text-align: center;
    transition: all 0.2s ease;
}

.wr-sidebar-button:hover {
    text-decoration: none;
}

/* --- Responsive Visibility --- */
@media (max-width: 1024px) {
    .wr-hide-tablet {
        display: none !important;
    }
}

@media (max-width: 767px) {
    .wr-hide-mobile {
        display: none !important;
    }

    .wr-nav-center {
        position: relative;
        left: auto;
        transform: none;
        margin: 0 auto;
    }

    .wr-search-results[data-layout="grid"] {
        grid-template-columns: 1fr;
    }

    .wr-sidebar-content {
        padding: 50px 20px 30px;
    }
}

/* --- Body lock when sidebar open --- */
body.wr-sidebar-open {
    overflow: hidden;
}

/* ============================================
   Elementor Editor Preview Overrides
   ============================================ */

.elementor-editor-active .wr-sidebar-overlay {
    display: none;
}

.elementor-editor-active .wr-search-results {
    position: relative;
    display: block;
}

/* ============================================
   Prevents Flash opening on page load
   ============================================ */
.elementor-section-stretched {
    width: 100vw !important;
    margin-left: calc(50% - 50vw) !important;
    margin-right: calc(50% - 50vw) !important;
    max-width: 100vw !important;
    position: relative !important;
    left: auto !important;
}

/* Clip all slider tracks to their containers */
.wr-tic-wrapper,
.wcppe-mobile-slides,
.wcppe-mobile-slider,
[class*="wr-review"] > .swiper-wrapper,
.swiper-container,
.swiper {
    overflow: hidden !important;
}

/* Prevent sidebar flash on page load */
.wr-sidebar {
    transition: none !important;
}
.wr-sidebar.wr-sidebar-active {
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1) !important;
}
/* --- Cart count: hide when empty, show when items present --- */
.wr-cart-count-hidden {
    display: none !important;
}

/* --- SVG upload icon (media-library SVGs used as nav icons) --- */
.wr-icon-svg {
    width: 1em;
    height: 1em;
    display: block;
    object-fit: contain;
}