/* Advanced Header Plugin Styles */

/* Reset and base styles */
* {
    box-sizing: border-box;
}

/* Header container */
.advanced-header-nav {
    position: sticky;
    top: 0;
    z-index: 999;
    background-color: #18181b;
    border-bottom: 1px solid #27272a;
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.advanced-header-nav .container {
    max-width: 1920px;
    margin: 0 auto;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Header sections */
.header-left {
    display: flex;
    align-items: center;
    gap: 50px;
}

.header-center {
    flex: 5;
    display: flex;
    justify-content: flex-start;
}

.header-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 1.8rem;
    gap: 12px;
    color: #f4f4f5;
}


/* Logo */
.header-logo img {
    display: flex;
    align-items: center;
    width: 80px;
}

.header-logo span {
    color: white;
    font-size: 1.25rem;
    font-weight: bold;
}

/* Mobile menu button */
#mobile-menu-btn {
    font-size: 1.5rem;
    color: white;
    background: none;
    border: none;
    cursor: pointer;
    display: none;
}

/* Desktop menu */
.desktop-menu {
    display: flex;
    gap: 16px;
    color: #f4f4f5;
    position: relative;
}

.desktop-menu a {
    display: flex;
    align-items: center;
    color: #f4f4f5;
    text-decoration: none;
    transition: color 0.2s;
}

.desktop-menu a:hover {
    color: #e4e4e7;
}

/* Dropdown container */
.dropdown-container {
    position: relative;
}

.dropdown-trigger {
    background: none;
    padding: 0;
    border: none;
    color: #f4f4f5;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: color 0.2s;
}

.dropdown-trigger:hover {
    color: #e4e4e7;
}

.dropdown-trigger:focus,
.dropdown-trigger:hover {
    background-color: transparent;
}

/* Dropdown menu */
.dropdown-menu {
    position: absolute;
    left: 0;
    margin-top: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: all 0.2s;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 24px;
    background-color: rgba(31, 32, 32, 0.60);
    backdrop-filter: blur(20px);
    color: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);
    width: 1024px;
    z-index: 1000;
}

.dropdown-menu.show {
    display: grid !important;
    grid-template-columns: repeat(6, 1fr);

    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-category h4 {
    font-size: 1rem;
    white-space: nowrap;
    font-weight: 600;
    margin-bottom: 8px;
    color: #e4e4e7;
}

.dropdown-category ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.dropdown-category ul li {
    margin-bottom: 4px;
}

.dropdown-category ul li a {
    color: #a1a1aa;
    /* Cor mais suave para os links */
    text-decoration: none;
    font-size: 14px;
    padding: 4px 0;
    display: block;
    transition: color 0.2s;
}

.dropdown-category ul li a:hover {
    color: #ffffff;
    /* Cor ao passar o mouse */
    text-decoration: none;
}

/* Search button */
.search-button {
    width: 100%;
    max-width: 1024px;
    display: flex;
    align-items: center;
    gap: 12px;
    background-color: rgba(39, 39, 42, 0.6);
    color: #e4e4e7;
    border-radius: 8px;
    padding: 8px 16px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
}

.search-button:hover {
    background-color: rgba(39, 39, 42, 0.8);
    border-color: #3f3f46;
}

.search-button:focus {
    background-color: rgba(39, 39, 42, 0.8);
    border-color: #3f3f46;
}

.search-button span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Header icons */
.header-icons {
    display: flex;
    gap: 12px;
    color: #f4f4f5;
    position: relative;
}

.header-icons a {
    color: inherit;
    text-decoration: none;
    transition: all 200ms;
}

.header-icons a:hover {
    transition: all 200ms;
    color: #b6b6b6;
}

.header-icons i {
    font-size: 1.9rem;
}

/* Account dropdown */
.account-dropdown {
    position: relative;
}

.account-dropdown-trigger {
    background: none;
    border: none;
    color: #f4f4f5;
    cursor: pointer;
    font-size: 1.25rem;
    transition: color 0.2s;
    padding: 0;
}

.account-dropdown-trigger:hover {
    color: #b6b6b6;
    background-color: transparent;
}

.account-dropdown-trigger:focus {
    background-color: transparent;
}

.account-dropdown-menu {
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 8px;
    min-width: 200px;
    background-color: #18181b;
    border: 1px solid #27272a;
    border-radius: 8px;
    box-shadow: 0 10px 25px -5px rgb(0 0 0 / 0.25);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s;
    z-index: 1000;
    overflow: hidden;
}

.account-dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.logout-btn:focus {
    background-color: transparent;
}

.account-dropdown-menu a,
.account-dropdown-menu button {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 12px 16px;
    color: #f4f4f5;
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
    text-align: left;
}

.account-dropdown-menu a:hover,
.account-dropdown-menu button:hover {
    background-color: #27272a;
    color: #ffffff;
}

.account-dropdown-menu .separator {
    height: 1px;
    background-color: #27272a;
    margin: 8px 0;
}

/* Mobile menu overlay */
#mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
}

/* Mobile menu */
.mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    width: 320px;
    background-color: rgba(31, 32, 32, 0.60);
    backdrop-filter: blur(20px);
    color: white;
    z-index: 999;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
}

.mobile-menu.open {
    transform: translateX(0);
}

.mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding: 16px;
}

.mobile-menu-header img {
    width: 96px;
}

.mobile-menu-header span {
    color: white;
    font-size: 1.125rem;
    font-weight: bold;
}

#mobile-menu-close {
    font-size: 1.5rem;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
}

/* Mobile menu navigation */
.mobile-nav {
    height: 100vh;
    padding: 0 16px;
}

.mobile-nav>* {
    margin-bottom: 16px;
}

.mobile-nav a {
    display: block;
    padding: 8px 12px;
    border-radius: 6px;
    color: white;
    text-decoration: none;
    transition: background-color 0.2s;
}

.mobile-nav a:hover {
    background-color: #27272a;
    color: white;
}

.mobile-nav a i {
    margin-right: 12px;
}

/* Mobile submenu */
.mobile-menu-item {
    margin-bottom: 10px;
}

.mobile-submenu-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-radius: 6px;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    transition: background-color 0.2s;
}

.mobile-submenu-toggle:hover {
    background-color: #27272a;
}

.mobile-submenu-toggle:focus {
    background-color: #27272a;
}

.mobile-submenu-toggle i.ri-arrow-down-s-line {
    transform: rotate(0);
    transition: transform 0.2s;
}

.mobile-submenu-toggle i.ri-arrow-down-s-line.rotate-180 {
    transform: rotate(180deg);
}

.mobile-submenu {
    margin-left: 16px;
    margin-top: 8px;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition:
        /*max-height*/
        all 0.3s ease-in-out;
}

.mobile-submenu.open {
    overflow: visible;
    opacity: 1;
}

.mobile-submenu a {
    display: block;
    padding: 4px 12px;
    font-size: 14px;
    color: #a1a1aa;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.2s;
}

.mobile-submenu a:hover {
    color: white;
    background-color: #27272a;
}

.mobile-submenu-category h4 {
    color: #a1a1aa;
    font-size: 0.8rem;
    text-transform: uppercase;
    padding: 10px 12px 4px;
    font-weight: 500;
}

.mobile-submenu-category ul {
    list-style: none;
    padding: 0;
}

.mobile-submenu-category ul a {
    padding-left: 24px !important;
}

a.mobile-submenu-direct-link {
    font-weight: 500;
}

/* Search Modal */
#search-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    backdrop-filter: blur(0px);
    transition: backdrop-filter 0.3s ease-in-out;
}

#search-modal.show {
    display: flex;
    backdrop-filter: blur(4px);
}

#search-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

#search-modal.show #search-modal-backdrop {
    opacity: 1;
}

.modal-content {
    position: relative;
    width: 100%;
    max-width: 672px;
    background-color: rgba(24, 24, 27, 0.95);
    color: white;
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);
    border: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0;
    transform: scale(0.95) translateY(-10px);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#search-modal.show .modal-content {
    opacity: 1;
    transform: scale(1) translateY(0);
}

.modal-inner {
    padding: 16px;
}

/* Search input section */
.search-input-section {
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-input-section i {
    font-size: 1.25rem;
    color: #d4d4d8;
}

#search-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: white;
    font-size: 1.125rem;
}

#search-input::placeholder {
    color: #a1a1aa;
}

#search-close {
    background: none;
    border: none;
    color: #a1a1aa;
    cursor: pointer;
    transition: color 0.2s;
}

#search-close:hover {
    color: white;
}

/* Search results section */
.search-results-section {
    margin-top: 16px;
    border-top: 1px solid #27272a;
    padding-top: 16px;
}

.search-results-label {
    color: #a1a1aa;
    font-size: 12px;
    margin-bottom: 8px;
}

#search-results {
    max-height: 256px;
    overflow-y: auto;
    padding-right: 8px;
    /* Remove wheel scrolling from affecting individual items */
    scroll-behavior: smooth;
}

/* CORREÇÃO: Prevenir scroll do mouse nos itens individuais */
.search-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s;
    margin-bottom: 8px;
    /* Importante: remover qualquer scroll individual */
    pointer-events: auto;
}

.search-result-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

.search-result-item.selected {
    background-color: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.5);
}

.search-result-image {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    object-fit: cover;
    background-color: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a1a1aa;
}

.search-result-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
}

.search-result-content {
    flex: 1;
    min-width: 0;
}

.search-result-title {
    font-weight: 500;
    color: white;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-meta {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

.search-result-type {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.search-result-type.product {
    background-color: rgba(34, 197, 94, 0.2);
    color: rgb(34, 197, 94);
}

.search-result-type.category {
    background-color: rgba(168, 85, 247, 0.2);
    color: rgb(168, 85, 247);
}

/* Loading animation */
.search-loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Scrollbar customization */
#search-results::-webkit-scrollbar {
    width: 8px;
}

#search-results::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.06);
    border-radius: 8px;
}

/* Banner */
body .banner-header {
    /* background-color: #18181b; */
    display: flex;
}

body .banner-header img {
    width: 100% !important;
    height: 130px !important;
    /* object-fit: cover; */
}

@media (max-width: 350px) {
    .header-logo {
        display: none;
    }
}

/* Responsive styles */
@media (max-width: 640px) {
    #mobile-menu-btn {
        display: block;
    }

    .header-logo {
        width: min-content;
    }

    .header-logo a {
        display: flex;
        width: 60px;
    }

    .header-logo img {
        width: 70px;
    }

    .header-right {
        padding-right: 0;
    }

    .header-icons {
        gap: 0.2rem;
    }

    .header-icons i {
        font-size: 1.25rem;
    }

    .desktop-menu {
        display: none;
    }

    #mobile-menu-overlay.show {
        display: block;
    }

    .dropdown-menu {
        width: 100vw !important;
        left: -16px !important;
        grid-template-columns: 1fr !important;
    }

    .search-result-item {
        padding: 8px;
    }

    .search-result-image {
        width: 32px;
        height: 32px;
    }

    body .banner-header img {
        height: auto !important;
    }

    #search-modal {
        align-items: flex-start;
        padding: 16px;
    }

    #mobile-menu-btn {
        padding: 0;
    }

    .advanced-header-nav .container {
        padding: 8px 8px;
        gap: 8px;
    }

    .header-left {
        gap: 5px;
    }

    .account-dropdown-menu {
        right: -8px;
    }

}

@media (min-width: 641px) {
    .desktop-menu {
        display: flex;
    }
}

/* Focus states for accessibility */
.search-result-item:focus,
button:focus,
input:focus {
    outline: 2px solid rgba(59, 130, 246, 0.5);
    outline-offset: 2px;
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .search-result-item:hover {
        background-color: rgba(255, 255, 255, 0.15);
    }

    .search-result-item.selected {
        background-color: rgba(59, 130, 246, 0.4);
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {

    .mobile-menu,
    .mobile-submenu,
    #search-modal,
    #search-modal .modal-content,
    #search-modal-backdrop,
    .search-result-item,
    .dropdown-menu,
    .account-dropdown-menu {
        transition: none;
    }

    .search-loading {
        animation: none;
    }
}

.mundom-header-cart {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
}

.mundom-header-cart:hover {
    transform: translateY(-2px);
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.mundom-header-cart svg {
    width: 24px;
    height: 24px;
    transition: all 0.3s ease;
}

.mundom-header-cart-count {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #667eea;
    color: white;
    font-size: 12px;
    font-weight: 600;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transform: scale(1);
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

.mundom-header-cart-count.empty,
.mundom-header-cart-count:empty {
    transform: scale(0);
    opacity: 0;
}

.mundom-header-cart-count.updated {
    animation: pulseCount 0.4s ease-in-out;
}

@keyframes pulseCount {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.3);
        background: #2ed573;
    }

    100% {
        transform: scale(1);
    }
}

.mundom-header-cart:hover .mundom-header-cart-count {
    background: #2ed573;
    box-shadow: 0 4px 12px rgba(46, 213, 115, 0.4);
}

.mundom-header-cart.cart-updated {
    animation: cartBounce 0.6s ease-in-out;
}

@keyframes cartBounce {

    0%,
    100% {
        transform: translateY(0) scale(1);
    }

    25% {
        transform: translateY(-5px) scale(1.05);
    }

    50% {
        transform: translateY(-2px) scale(1.02);
    }

    75% {
        transform: translateY(-3px) scale(1.03);
    }
}

/* Responsivo */
@media (max-width: 768px) {
    .mundom-header-cart svg {
        width: 20px;
        height: 20px;
    }

    .mundom-header-cart-count {
        font-size: 11px;
        min-width: 18px;
        height: 18px;
        top: -6px;
        right: -6px;
    }
}

/* Utility classes */
.hidden {
    display: none !important;
}

.show {
    display: block !important;
}

.flex {
    display: flex !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}