/* ============================================================
   AWA B2B — FASE 7: Header, Busca & Navegação (Mueller/Motorola)
   Search Bar Expansion | SearchbyCat Dropdown | VerticalMenu | Category Grid
   ============================================================ */

/* ============================================================
   1. BUSCA EXPANDIDA — Ocupar quase todo o header
   ============================================================ */
/* Expand search container to fill available space */
.top-search {
    display: flex !important;
    align-items: center;
    gap: 16px;
}

.block-search {
    flex: 1;
    max-width: none !important;
    width: 100% !important;
}

.block-search .block-content {
    width: 100%;
}

.block-search .form.minisearch {
    display: flex;
    align-items: stretch;
    width: 100%;
    border: 2px solid var(--primary-color, #b73337);
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.block-search .form.minisearch:focus-within {
    border-color: #8b1a1e;
    box-shadow: 0 0 0 3px rgba(183, 51, 55, 0.12);
}

.block-search .field.search {
    flex: 1;
    display: flex;
    align-items: stretch;
    margin: 0;
    padding: 0;
    border: none;
}

.block-search .field.search .label {
    display: none;
}

.block-search .field.search .control {
    display: flex;
    align-items: stretch;
    width: 100%;
    gap: 0;
}

/* ============================================================
   2. SEARCHBYCAT — Dropdown de Categorias (Amazon/Mueller Style)
   ============================================================ */
/* Hide the Chosen.js wrapper and show native select */
.block-search .chosen-container {
    display: none !important;
}

#choose_category {
    display: block !important;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    min-width: 160px;
    max-width: 200px;
    padding: 0 32px 0 14px;
    border: none;
    border-right: 1px solid #e2e8f0;
    background: #f1f5f9
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2364748b' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
        no-repeat right 12px center;
    font-size: 13px;
    font-weight: 600;
    font-family: var(--awa-font-body, 'Source Sans 3', sans-serif);
    color: #334155;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    order: -1; /* Place BEFORE the input */
    height: auto;
    line-height: 1.2;
}

#choose_category:focus {
    outline: none;
    background-color: #e2e8f0;
}

#choose_category option {
    font-size: 13px;
    padding: 6px 12px;
}

/* Input field — full width rest */
.block-search .field.search .control input#search {
    flex: 1;
    padding: 12px 16px;
    border: none !important;
    background: transparent;
    font-size: 14px;
    font-family: var(--awa-font-body, 'Source Sans 3', sans-serif);
    color: #0f172a;
    min-height: 44px;
    box-shadow: none !important;
    outline: none;
}

.block-search .field.search .control input#search::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

/* Submit button */
.block-search .actions {
    display: flex;
}

.block-search .actions .action.search {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 18px;
    background: var(--primary-color, #b73337);
    color: #fff;
    border: none;
    border-radius: 0;
    cursor: pointer;
    min-height: 44px;
    transition: background 0.15s;
}

.block-search .actions .action.search:hover {
    background: #8b1a1e;
}

.block-search .actions .action.search span {
    font-size: 18px;
}

/* Autocomplete dropdown */
#search_autocomplete {
    border: 1px solid #e2e8f0;
    border-top: none;
    border-radius: 0 0 6px 6px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    z-index: 1060;
}

/* ============================================================
   3. VERTICAL MENU — Botão DEPARTAMENTOS (Mueller Style)
   ============================================================ */
/* Vertical menu toggle button */
.menu_left_home1 {
    position: relative;
    overflow: visible !important;
    height: auto !important;
}

.menu_left_home1 .vertical-menu-title,
.menu_left_home1 .vmenu-toggle {
    display: flex !important;
    align-items: center;
    gap: 10px;
    padding: 0 20px;
    height: 100%;
    min-height: 46px;
    background: var(--primary-color, #b73337);
    color: #fff;
    font-family: var(--awa-font-heading, 'Lexend', sans-serif);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
}

.menu_left_home1 .vertical-menu-title:hover,
.menu_left_home1 .vmenu-toggle:hover {
    background: #8b1a1e;
}

/* Hamburger icon */
.menu_left_home1 .vertical-menu-title::before,
.menu_left_home1 .vmenu-toggle::before {
    content: '';
    display: inline-block;
    width: 18px;
    height: 14px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='14' viewBox='0 0 18 14'%3E%3Cpath d='M0 1h18M0 7h18M0 13h18' stroke='white' stroke-width='2'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: contain;
}

/* Dropdown panel */
.menu_left_home1 .togge-menu.list-category-dropdown,
.menu_left_home1 .vertical-menu-content,
.menu_left_home1 .vertical-menu-dropdown,
.menu_left_home1 .sidemenu-content {
    position: absolute;
    top: 100% !important;
    left: 15px; /* Aligned with bootstrap col padding */
    min-width: 270px;
    background: #fff !important;
    border: 1px solid #e2e8f0 !important;
    border-top: none !important;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
    padding: 8px 0;
    z-index: 1040 !important;
}

/* Ensure submenus (flyouts) are styled and visible */
.navigation.verticalmenu .subchildmenu {
    background: #fff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 0 8px 8px 8px;
    box-shadow: 6px 6px 20px rgba(0, 0, 0, 0.08);
    z-index: 1050 !important;
}

/* Dropdown items */
.menu_left_home1 .togge-menu.list-category-dropdown li > a,
.menu_left_home1 .vertical-menu-content li > a,
.menu_left_home1 .vertical-menu-dropdown li > a,
.menu_left_home1 .sidemenu-content li > a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    color: #334155;
    text-decoration: none;
    transition: background 0.12s, color 0.12s;
    border: none;
}

.menu_left_home1 .togge-menu.list-category-dropdown li > a:hover,
.menu_left_home1 .vertical-menu-content li > a:hover,
.menu_left_home1 .vertical-menu-dropdown li > a:hover,
.menu_left_home1 .sidemenu-content li > a:hover {
    background: #f8fafc;
    color: var(--primary-color, #b73337);
}

/* Separator for sub-items */
.menu_left_home1 .togge-menu.list-category-dropdown li + li,
.menu_left_home1 .vertical-menu-content li + li,
.menu_left_home1 .vertical-menu-dropdown li + li,
.menu_left_home1 .sidemenu-content li + li {
    border-top: 1px solid #f1f5f9;
}

/* ============================================================
   4. GRID CATEGORIAS (Homepage — Below Banner)
   ============================================================ */
.awa-category-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    padding: 32px 0;
    max-width: 1200px;
    margin: 0 auto;
}

.awa-category-grid__card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 24px 16px;
    background: #f9f9f9;
    border: 1px solid transparent;
    border-radius: 6px;
    text-decoration: none;
    color: #0f172a;
    transition: border-color 0.15s, background 0.15s;
    cursor: pointer;
    text-align: center;
}

.awa-category-grid__card:hover {
    border-color: #e2e8f0;
    background: #fff;
}

.awa-category-grid__card:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(183, 51, 55, 0.15);
}

.awa-category-grid__icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color, #b73337);
}

.awa-category-grid__icon svg {
    width: 32px;
    height: 32px;
}

.awa-category-grid__title {
    font-family: var(--awa-font-heading, 'Lexend', sans-serif);
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    line-height: 1.3;
}

/* Responsive */
@media (width <= 991px) {
    .awa-category-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
        padding: 24px 16px;
    }
}

@media (width <= 600px) {
    .awa-category-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    #choose_category {
        min-width: 120px;
        max-width: 140px;
        font-size: 12px;
    }
}

/* Block title override */
.block-search .block-title {
    display: none;
}

/* ============================================================
   Responsive: Search bar mobile
   ============================================================ */
@media (width <= 767px) {
    .block-search .form.minisearch {
        border-width: 1.5px;
    }

    #choose_category {
        min-width: 100px;
        padding: 0 24px 0 8px;
        font-size: 11px;
    }

    .block-search .field.search .control input#search {
        padding: 10px 12px;
        font-size: 13px;
        min-height: 40px;
    }

    .block-search .actions .action.search {
        padding: 0 14px;
        min-height: 40px;
    }
}
