/**
 * Header and Navigation Styles
 * All styles related to header layout, search, navigation and mobile responsiveness
 */

/* --- AJAX Search Core Styles --- */
.incom-ajax-search-list {
    list-style: none !important;
    list-style-type: none !important;
    margin: 0;
    padding: 0;
    background: #fff;
    border-radius: 0 0 6px 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    position: absolute;
    width: 100%;
    z-index: 1000;
}
#carrinho-login, #busca-carrinho-login{
    display:flex;
    flex-direction:row!important;
    align-items:center;
    gap: 15px!important;
}
#incom-header{
    gap:5px!important;
}
.incom-ajax-search-list li {
    list-style: none !important;
    list-style-type: none !important;
    border-bottom: 1px solid var(--gcid-secondary-color, #eee);
}
.incom-ajax-search-list li:last-child {
    border-bottom: none;
}
.incom-ajax-search-list a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    color: var(--gcid-secondary-color, #333);
    text-decoration: none;
    transition: background 0.2s;
}
.incom-ajax-search-list a:hover {
    background: var(--gcid-secondary-color, #f5f5f5);
    color: #fff!important;
}
#incom-ajax-search-form {
    position: relative;
    width: 100%;
    margin: 0 auto;
}
#incom-ajax-search-input {
    width: 100%;
    padding: 10px 14px;
    /* Decompose the variable into RGB channels and apply 50% alpha */
    border: 2px solid;
    border-color: rgb(from var(--gcid-secondary-color, #ccc) r g b / 0.5);
    border-radius: 6px;
    font-size: 16px;
    outline: none;
    box-sizing: border-box;
}
.incom-ajax-search-no-results {
    padding: 10px 16px;
    color: #888;
    background: #fff;
    border-radius: 0 0 6px 6px;
}
.incom-ajax-search-thumb {
    width: 32px;
    height: 32px;
    object-fit: cover;
    border-radius: 4px;
    margin-right: 10px;
    vertical-align: middle;
    box-shadow: 0 1px 3px rgba(0,0,0,0.07);
    background: #f8f8f8;
}
.incom-ajax-search-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 12px;
    color: #888;
    margin-left: 42px;
    margin-top: 2px;
}
.incom-ajax-search-sku {
    background: #f2f2f2;
    border-radius: 3px;
    padding: 1px 6px;
    color: var(--gcid-secondary-color, #888);
}
.incom-ajax-search-categories {
    background: #f9f9f9;
    border-radius: 3px;
    padding: 1px 6px;
    color: #666;
}

#incom-ajax-search-submit {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    width: 24px; /* Adjust size as needed */
    height: 24px; /* Adjust size as needed */
    padding: 0;
}

/* Header Responsive Design */
.et-l--header .et_pb_section {
    padding: 0;
}

.et_pb_row_0_tb_header {
    align-items: center;
    min-height: 60px;
    padding: 10px 0;
}

.et-db #et-boc header.et-l .et_pb_section{
    padding:0!important;
    --vertical-gap:20px;
}

#menu-menu-principal{
    justify-content:space-between!important;
}

.et-db #et-boc .et-l .et_pb_image{
    margin:0!important
}

/* Logo Column */
.et_pb_column_0_tb_header {
    display: flex;
    align-items: center;
}

.et_pb_column_0_tb_header .et_pb_image {
    margin-bottom: 0;
}

.et_pb_column_0_tb_header .et_pb_image img {
    max-height: 80px;
    width: auto;
}

/* Search Column */
.et_pb_column_1_tb_header {
    display: flex;
    align-items: center;
}

.incom-search-container {
    position: relative;
    width: 100%;
    max-width: 100%;
}

.incom-search-container input[type="text"] {
    width: 100%;
    padding: 10px 50px 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 14px;
    background-color: #f8f9fa;
    transition: all 0.3s ease;
}

.incom-search-container input[type="text"]:focus {
    outline: none;
    border-color: var(--gcid-primary-color, #007cba);
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

.incom-search-container button {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--gcid-primary-color, #007cba);
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.incom-search-container button:hover {
    background: var(--gcid-secondary-color, #005a8b);
    transform: translateY(-50%) scale(1.05);
}

.incom-search-container button svg {
    width: 18px;
    height: 18px;
}

/* User Actions Column */
.et_pb_column_2_tb_header {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.et_pb_column_2_tb_header .et_pb_code {
    margin-bottom: 0;
}

/* Account Dropdown */
.incom-account-dropdown {
    position: relative;
    display: inline-block;
}

.incom-account-dropdown-toggle {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 20px;
    transition: all 0.3s ease;
    font-size: 14px;
    color: var(--gcid-primary-color, #007cba);
}

.incom-account-dropdown-toggle:hover {
    background: var(--incom-hover-bg);
}

.incom-account-dropdown-toggle svg {
    width: 20px;
    height: 20px;
}

/* Cart Widget */
.incom-cart-widget a {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--gcid-primary-color, #007cba);
    padding: 8px 12px;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.incom-cart-widget a:hover {
    background: var(--incom-hover-bg);
    transform: translateY(-1px);
}

.cart-count-circle {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 11px;
}

/* Navigation Row */
.et_pb_row_1_tb_header {
    border-top: 1px solid #e0e0e0;
    padding: 5px 0;
}

.et_pb_menu_0_tb_header {
    margin-bottom: 0;
}

.et_pb_menu_0_tb_header .et-menu {
    margin: 0;
}

.et_pb_menu_0_tb_header #menu-menu-principal.et-menu li a {
    padding: 10px 15px;
    color: var(--gcid-primary-color, #007cba)!important;
    font-weight: 500;
    transition: all 0.3s ease;
}

.et_pb_menu_0_tb_header .et-menu li a:hover {
    background: var(--incom-hover-bg);
    border-radius: 5px;
}

.et_pb_menu--without-logo .et_pb_menu__menu > nav > ul{
    margin:0!important;
}

/* Mobile Responsive Design */
@media (max-width: 980px) {
    .et_pb_row_0_tb_header {
        flex-direction: column;
        gap: 15px;
        padding: 15px 0;
    }

    .et_pb_column_2_tb_header .et_pb_group {
        margin-left: 0;
    }
    
    .et_pb_column_0_tb_header,
    .et_pb_column_1_tb_header,
    .et_pb_column_2_tb_header {
        width: 100%;
        max-width: 100%;
        flex-basis: 100%;
    }
    
    .et_pb_column_0_tb_header {
        justify-content: center;
        order: 1;
    }
    
    .et_pb_column_1_tb_header {
        order: 3;
        position: absolute;
        top: -9999px;
        left: -9999px;
        width: 1px;
        height: 1px;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }
    
    .et_pb_column_2_tb_header {
        justify-content: center;
        order: 2;
        display: flex !important;
        align-items: center;
        gap: 15px;
    }
    
    /* Mobile Search States */
    .incom-search-container.collapsed {
        display: none !important;
    }
    
    .incom-search-container.expanded {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        z-index: 9999 !important;
        background: rgba(255, 255, 255, 0.98) !important;
        backdrop-filter: blur(10px) !important;
        padding: 20px !important;
        box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1) !important;
        display: block !important;
        width: 100% !important;
        max-width: none !important;
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
    }
    
    /* Override parent column positioning when search is expanded */
    .incom-search-container.expanded {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
    }
    
    .et_pb_column_1_tb_header:has(.incom-search-container.expanded) {
        position: static !important;
        top: auto !important;
        left: auto !important;
        width: auto !important;
        height: auto !important;
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
    }
    
    .incom-search-container.expanded #incom-ajax-search-form {
        position: relative !important;
        width: 100% !important;
        display: block !important;
    }
    
    .incom-search-container.expanded input[type="text"] {
        width: 100% !important;
        padding: 15px 60px 15px 20px !important;
        font-size: 16px !important;
        border: 2px solid var(--gcid-primary-color, #007cba) !important;
        border-radius: 30px !important;
        background: #fff !important;
        box-shadow: 0 4px 20px rgba(0, 124, 186, 0.1) !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .incom-search-container.expanded button {
        position: absolute;
        right: 25px;
        top: 50%;
        transform: translateY(-50%);
        background: var(--gcid-primary-color, #007cba);
        color: white;
        width: 40px;
        height: 40px;
        border-radius: 20px;
    }
    
    .incom-search-container.expanded button svg {
        stroke: white;
    }
    
    /* Enhanced positioning for AJAX search results on mobile */
    .incom-search-container.expanded .incom-ajax-search-list {
        position: fixed !important;
        width: calc(100vw - 40px) !important;
        max-width: calc(100vw - 40px) !important;
        max-height: calc(100vh - 120px) !important; /* Prevent overflow */
        background: #fff !important;
        z-index: 10002 !important; /* Higher than search container */
        border-radius: 0 0 20px 20px !important;
        box-shadow: 0 6px 30px rgba(0,0,0,0.15) !important;
        overflow-y: auto !important;
        border: 1px solid #ddd !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    /* Close button for expanded search */
    .incom-search-container.expanded::before {
        content: "✕";
        position: absolute;
        top: 20px;
        right: 80px;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: #f0f0f0;
        border-radius: 20px;
        cursor: pointer;
        font-size: 18px;
        color: #666;
        transition: all 0.3s ease;
        z-index: 10000;
    }
    
    .incom-search-container.expanded::before:hover {
        background: #e0e0e0;
        color: #333;
    }
    
    /* Mobile search icon styling */
    .mobile-search-icon {
        color: var(--gcid-primary-color, #007cba) !important;
    }
    
    .mobile-search-icon:hover {
        background: var(--incom-hover-bg) !important;
        transform: scale(1.05) !important;
    }
    
    .mobile-search-icon svg {
        color: var(--gcid-primary-color, #007cba) !important;
    }
    
    /* Icons side by side layout */
    .et_pb_column_2_tb_header .et_pb_group {
        display: flex !important;
        flex-direction: row !important;
        justify-content: center;
        align-items: center;
        gap: 15px;
        margin-bottom: 0;
    }
    
    .et_pb_column_2_tb_header .et_pb_code {
        margin-bottom: 0;
        display: flex;
        align-items: center;
    }
    
    .incom-account-dropdown-toggle span {
        display: none; /* Hide username on mobile */
    }
    
    .et_pb_row_1_tb_header {
        display: none; /* Hide navigation on mobile, use mobile menu instead */
    }

    .et_pb_row_0_tb_header.et_pb_row.et_pb_row_1-4_1-2_1-4.et_pb_gutters3 {
        display: flex;
        flex-direction: row;
        align-items: center;
    }

    .et_pb_column_0_tb_header.et_pb_column.et_pb_column_1_4.et_pb_css_mix_blend_mode_passthrough {
        margin-bottom: 0;
    }
}

@media (max-width: 767px) {
    .et_pb_row_0_tb_header {
        padding: 10px 0!important;
        gap: 10px;
    }
    
    .et_pb_column_0_tb_header .et_pb_image img {
        max-height: 40px;
    }
    
    .et_pb_column_2_tb_header .et_pb_group {
        gap: 15px;
    }
    
    .incom-account-dropdown-toggle,
    .incom-cart-widget a {
        padding: 6px 10px;
    }
}

@media only screen and (max-width: 980px) {
  .et-db #et-boc .et-l .et_pb_row_0_tb_header {
    display: flex;
    flex-direction: row!important;
  }
}

/* Tablet Specific Adjustments */
@media (min-width: 768px) and (max-width: 980px) {
    .et_pb_row_0_tb_header {
        flex-direction: row;
        align-items: center;
    }
    
    .et_pb_column_0_tb_header {
        order: 1;
    }
    
    .et_pb_column_1_tb_header {
        flex: 1;
        order: 2;
        margin: 0 20px;
    }
    
    .et_pb_column_2_tb_header {
        order: 3;
    }
}

/* --- AJAX Search Overlay Results --- */
.incom-search-container.expanded #incom-ajax-search-results {
    position: fixed;
    width: calc(100vw - 40px);
    max-width: calc(100vw - 40px);
    background: transparent;
    overflow-y: auto;
    z-index: 10001;
    padding-bottom: 16px;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Debug and fallback styles for search results */
#incom-ajax-search-results {
    min-height: 0 !important;
    height: auto !important;
    display: block !important;
}

#incom-ajax-search-results:empty {
    /* Style when search results are empty */
    min-height: 0 !important;
    height: 0 !important;
    display: none !important;
}

/* Ensure no-results message displays properly */
.incom-ajax-search-no-results {
    padding: 15px 20px !important;
    color: #888 !important;
    background: #fff !important;
    border-radius: 0 0 6px 6px !important;
    border: 1px solid #ddd !important;
    display: block !important;
    font-size: 14px !important;
    text-align: center !important;
    min-height: 40px !important;
    line-height: 1.4 !important;
}

/* Mobile specific no-results styling */
@media (max-width: 980px) {
    .incom-search-container.expanded .incom-ajax-search-no-results,
    body > .incom-search-container.expanded.moved-to-body .incom-ajax-search-no-results {
        border-radius: 0 0 20px 20px !important;
        padding: 20px !important;
        font-size: 16px !important;
        min-height: 60px !important;
        box-shadow: 0 6px 30px rgba(0,0,0,0.15) !important;
    }
}

/* Desktop search results - normal positioning */
.incom-search-container:not(.expanded) #incom-ajax-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1000;
}

/* Mobile-specific positioning for AJAX search results */
@media (max-width: 980px) {
    .incom-search-container.expanded #incom-ajax-search-results,
    body > .incom-search-container.expanded.moved-to-body #incom-ajax-search-results {
        top: 80px !important; /* Position below the search input on mobile */
        left: 20px !important;
        right: 20px !important;
        width: calc(100vw - 40px) !important;
        max-width: calc(100vw - 40px) !important;
        z-index: 10002 !important; /* Higher than the search container */
        background: transparent !important;
        max-height: calc(100vh - 120px) !important; /* Prevent overflow */
        overflow-y: auto !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
}

@media (max-width: 600px) {
    .incom-search-container.expanded .incom-ajax-search-list {
        border-radius: 0 0 15px 15px !important;
        padding-bottom: 8px;
    }
}



.incom-ajax-search-list li {
    border-bottom: 1px solid var(--gcid-secondary-color, #eee);
    list-style: none !important;
    list-style-type: none !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    height: auto !important;
    min-height: 40px !important;
}

.incom-ajax-search-list li:last-child {
    border-bottom: none;
}

.incom-ajax-search-list a {
    padding: 14px 18px !important;
    font-size: 1rem !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    color: var(--gcid-secondary-color, #333) !important;
    text-decoration: none !important;
    transition: background 0.2s !important;
    width: 100% !important;
    box-sizing: border-box !important;
    min-height: 40px !important;
    height: auto !important;
}

.incom-ajax-search-list a:hover {
    background: var(--gcid-primary-color, #007cba);
    color: #fff;
}

/* Mobile-specific AJAX search list improvements */
@media (max-width: 980px) {
    .incom-ajax-search-list a {
        padding: 16px 20px !important; /* Larger touch targets */
        font-size: 1.1rem !important;
    }
    
    .incom-ajax-search-thumb {
        width: 40px !important;
        height: 40px !important;
        margin-right: 12px !important;
    }
    
    .incom-ajax-search-meta {
        margin-left: 52px !important; /* Account for larger thumbnail */
        margin-top: 4px !important;
    }
}

/* Force show search results when mobile search is expanded */
@media (max-width: 980px) {
    .incom-search-container.expanded,
    body > .incom-search-container.expanded.moved-to-body {
        /* Ensure the container itself is properly displayed */
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .incom-search-container.expanded #incom-ajax-search-form,
    body > .incom-search-container.expanded.moved-to-body #incom-ajax-search-form {
        /* Ensure the form is visible */
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .incom-search-container.expanded #incom-ajax-search-results,
    body > .incom-search-container.expanded.moved-to-body #incom-ajax-search-results {
        /* Force show the results container */
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        position: fixed !important;
        top: 80px !important;
        left: 20px !important;
        right: 20px !important;
        width: calc(100vw - 40px) !important;
        max-width: calc(100vw - 40px) !important;
        z-index: 10002 !important;
        background: transparent !important;
        max-height: calc(100vh - 120px) !important;
        overflow-y: auto !important;
    }
    
    .incom-search-container.expanded #incom-ajax-search-results .incom-ajax-search-list,
    body > .incom-search-container.expanded.moved-to-body #incom-ajax-search-results .incom-ajax-search-list {
        /* Style the actual search list */
        background: #fff !important;
        border: 1px solid #ddd !important;
        border-radius: 0 0 20px 20px !important;
        box-shadow: 0 6px 30px rgba(0,0,0,0.15) !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        min-height: 50px !important;
        height: auto !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        list-style: none !important;
        list-style-type: none !important;
        position: relative !important;
    }
    
    .incom-search-container.expanded #incom-ajax-search-results .incom-ajax-search-list li,
    body > .incom-search-container.expanded.moved-to-body #incom-ajax-search-results .incom-ajax-search-list li {
        display: block !important;
        height: auto !important;
        min-height: 50px !important;
        margin: 0 !important;
        padding: 0 !important;
        list-style: none !important;
        list-style-type: none !important;
        border-bottom: 1px solid #eee !important;
    }
    
    .incom-search-container.expanded #incom-ajax-search-results .incom-ajax-search-list a,
    body > .incom-search-container.expanded.moved-to-body #incom-ajax-search-results .incom-ajax-search-list a {
        display: flex !important;
        padding: 16px 20px !important;
        font-size: 1.1rem !important;
        min-height: 50px !important;
        height: auto !important;
        width: 100% !important;
        box-sizing: border-box !important;
        align-items: center !important;
        gap: 8px !important;
    }
    
    /* Hide the results when search is collapsed */
    .incom-search-container.collapsed #incom-ajax-search-results,
    .incom-search-container:not(.expanded) #incom-ajax-search-results {
        display: none !important;
    }
}

/* Desktop behavior - normal dropdown */
@media (min-width: 981px) {
    .incom-search-container .incom-ajax-search-list {
        position: absolute !important;
        top: 100% !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        z-index: 1000 !important;
    }
}
