/* Navbar.css */

:root {
    --nav-dropdown-gutter: clamp(12px, 2vw, 36px);
}

/* ── Barra de contato ────────────────────────────────────────────────── */
.welcome-banner {
    background-color: #BB0606;
    color: #fff;
    height: 40px;
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 2100;
    display: flex;
    align-items: center;
    transition: opacity 0.3s ease, visibility 0s linear 0.3s;
}

.welcome-banner.hidden {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0s linear 0.3s;
}

.contact-bar-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 22px;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    box-sizing: border-box;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 7px;
    color: rgba(255, 255, 255, 0.92);
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.2px;
    white-space: nowrap;
    transition: color 0.2s ease;
}

.contact-item:hover { color: #fff; }

.contact-item i {
    font-size: 12px;
    opacity: 0.85;
    flex-shrink: 0;
}

.contact-item .fab.fa-whatsapp { font-size: 14px; }

.contact-divider {
    color: rgba(255, 255, 255, 0.3);
    font-size: 14px;
    user-select: none;
}

/* ── Navbar ──────────────────────────────────────────────────────────── */
.navbar {
    position: fixed;
    width: 100%;
    background-color: #fff;
    border-bottom: 1px solid #ebebeb;
    box-shadow: 0 1px 12px rgba(0, 0, 0, 0.07);
    top: 40px;
    z-index: 2000;
    display: flex;
    align-items: center;
    padding: 0;
    box-sizing: border-box;
    height: 120px;  /* +33% de 90px */
    transition: height 0.3s ease, box-shadow 0.3s ease, top 0.3s ease;
}

.navbar.shrink {
    height: 70px;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.11);
}

/* ── Container interno ───────────────────────────────────────────────── */
.container-inner {
    width: 100%;
    max-width: 1920px;
    margin: 0 auto;
    padding: 0 36px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    gap: 24px;
}

/* ── Logo ────────────────────────────────────────────────────────────── */
.logo-icons {
    display: none;
    align-items: center;
    flex-shrink: 0;
}

.navbar-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
    transition: opacity 0.2s ease;
}

.navbar-logo:hover { opacity: 0.85; }

.logo-img {
    height: 84px;      /* 120px - 36px margem = 84px (18px cada lado) */
    width: auto;
    max-width: 260px;
    object-fit: contain;
    display: block;
    transition: height 0.3s ease, max-width 0.3s ease;
}

.navbar.shrink .logo-img {
    height: 50px;
    max-width: 200px;
}

/* ── Menu Desktop ────────────────────────────────────────────────────── */
.container-menu {
    display: flex;
    align-items: center;          /* todos centralizados no eixo Y */
    justify-content: space-between;
    width: 100%;
    height: 100%;
    gap: 24px;
    position: relative;
}

.navbar-menu {
    display: flex;
    gap: clamp(24px, 2.4vw, 44px);
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;          /* todos os links no mesmo eixo Y */
    flex: 0 0 auto;
    margin: 0;
    padding: 0;
    height: auto;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

/* Links — todos com mesma altura, mesma altura de linha, mesmo padding */
.nav-link,
.button-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 38px;                  /* altura uniforme para todos */
    font-size: clamp(17px, 1.05vw, 20px);
    font-weight: 900;
    letter-spacing: 0;
    text-transform: none;          /* mantém "Otimização em Obra", sem uppercase */
    color: #505057;
    text-decoration: none;
    cursor: pointer;
    position: relative;
    padding: 0;
    margin: 0;
    white-space: nowrap;
    background: none;
    border: none;
    outline: none;
    font-family: inherit;
    line-height: 1;
    vertical-align: middle;
    transition: color 0.2s ease, transform 0.2s ease;
}

.nav-link:hover,
.button-link:hover {
    color: #BB0606;
    transform: translateY(-1px);
}

.nav-link::after,
.button-link::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 0;
    right: 0;
    margin: 0 auto;
    width: 0;
    height: 2px;
    background: #BB0606;
    border-radius: 1px;
    transition: width 0.25s ease;
}

.nav-link:hover::after,
.button-link:hover::after {
    width: 100%;
}

.navbar.shrink .nav-link,
.navbar.shrink .button-link {
    height: 34px;
    font-size: clamp(16px, 0.95vw, 18px);
}

/* ── Lupa na navbar (limpa, sem fundo, sem campo ao lado) ────────────── */
.search-toggle-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 32px;             /* mesma altura dos nav-links */
    flex-shrink: 0;
    transition: opacity 0.2s;
    margin: 0;
    line-height: 1;
}
.search-toggle-btn:hover { opacity: 0.65; }
.search-toggle-btn img { width: 22px; height: 22px; display: block; }

/* ── Painel de busca (abre abaixo da navbar ao clicar na lupa) ───────── */
.search-dropdown {
    position: fixed;
    top: var(--navbar-total-height, 160px);  /* exatamente abaixo da navbar */
    right: var(--nav-dropdown-gutter);
    left: auto;
    width: min(860px, calc(100vw - 72px));
    background: #fff;
    border-radius: 0 0 16px 16px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.16);
    border: 1px solid #ebebeb;
    border-top: 3px solid #BB0606;
    z-index: 1900;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.22s ease, transform 0.22s ease, visibility 0s linear 0.22s;
    overflow: hidden;
}

.search-dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition: opacity 0.22s ease, transform 0.22s ease;
}

.search-dropdown-inner {
    display: flex;
    flex-direction: column;
}

/* Campo de busca grande dentro do painel */
.search-dropdown-field {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 22px;
    background: #fafafa;
    border-bottom: 1px solid #f0f0f0;
    position: relative;
}

.search-dropdown-fieldicon {
    color: #BB0606;
    font-size: 16px;
    flex-shrink: 0;
}

.search-dropdown-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 16px;
    outline: none;
    color: #222;
    font-family: inherit;
    padding: 4px 0;
    min-width: 0;
}

.search-dropdown-input::placeholder { color: #bbb; }

.search-dropdown-clear {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 6px;
    color: #aaa;
    font-size: 14px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    transition: color 0.2s;
    border-radius: 6px;
}
.search-dropdown-clear:hover { color: #BB0606; background: #fff; }

/* Body: resultados + sidebar lado a lado */
.search-dropdown-body {
    display: flex;
    background: #fff;
}

.search-dropdown-results {
    flex: 1;
    padding: 18px 22px;
    min-width: 0;
    border-right: 1px solid #f0f0f0;
}

.search-dropdown-title {
    font-size: 15px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 10px;
}

.search-dropdown-divider {
    border: none;
    border-top: 1px solid #ebebeb;
    margin: 0 0 12px;
}

.search-dropdown-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 80px;
    max-height: min(64vh, 620px);
    overflow-y: auto;
}

.search-dropdown-products {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.search-dropdown-hint {
    font-size: 13px;
    color: #aaa;
    padding: 8px 0;
}

.search-dropdown-empty {
    font-size: 13px;
    color: #999;
    padding: 10px 0;
}

/* Cada resultado */
.search-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s ease;
    cursor: pointer;
}
.search-result-item:hover { background: #fef2f2; }

.search-result-img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 6px;
    background: #f5f5f5;
    flex-shrink: 0;
}

.search-result-info { min-width: 0; }

.search-result-name {
    font-size: 13px;
    font-weight: 600;
    color: #1a1a1a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.search-result-sub {
    font-size: 11px;
    color: #888;
    display: block;
}

.search-result-item:hover .search-result-name { color: #BB0606; }

.search-dropdown-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 0 2px;
}

.search-page-btn {
    min-width: 30px;
    height: 30px;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    background: #fff;
    color: #444;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.search-page-btn:hover,
.search-page-btn.active {
    border-color: #BB0606;
    background: #BB0606;
    color: #fff;
}

.search-page-ellipsis {
    color: #999;
    font-size: 12px;
    padding: 0 2px;
}

/* Sidebar */
.search-dropdown-sidebar {
    width: 200px;
    flex-shrink: 0;
    padding: 18px 18px 18px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.search-sidebar-link {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: #BB0606;
    text-decoration: none;
    padding: 8px 6px;
    border-radius: 6px;
    transition: background 0.15s ease, padding 0.15s ease;
}

.search-sidebar-button {
    width: 100%;
    border: 0;
    background: transparent;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
}

.search-sidebar-link:hover {
    background: #fef2f2;
    padding-left: 12px;
}

/* ── Ícones Mobile ───────────────────────────────────────────────────── */
.mobile-icons {
    display: flex;
    align-items: center;
    gap: 4px;
}

.menu-button,
.search-icon-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.menu-button:hover,
.search-icon-button:hover { background: #f5f5f5; }

.menu-icon {
    color: #BB0606;
    font-size: 22px;
}

/* ── Busca Mobile ────────────────────────────────────────────────────── */
.search-form-mobile {
    display: none;
    align-items: center;
    width: 100%;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(8px);
    position: fixed;
    left: 0;
    top: 126px; /* contact(36) + navbar(90) */
    z-index: 1002;
    flex-direction: column;
    border-bottom: 1px solid #f0f0f0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.search-form-mobile.active { display: flex; }

.search-input-wrapper-mobile {
    display: flex;
    width: 100%;
    max-width: 480px;
    background: #f5f5f5;
    border-radius: 24px;
    overflow: hidden;
    border: 2px solid transparent;
    transition: border-color 0.2s;
}

.search-input-wrapper-mobile:focus-within {
    border-color: #BB0606;
    background: #fff;
}

.search-input-mobile {
    flex: 1;
    padding: 11px 44px 11px 18px;
    border: none;
    background: transparent;
    font-size: 15px;
    outline: none;
    color: #333;
}

.search-input-mobile::placeholder { color: #aaa; }

.search-button-mobile {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 4px;
}

.search-button-mobile img { width: 20px; height: 20px; }

/* ── Product panel ───────────────────────────────────────────────────── */
.product-panel-content {
    background: #fff;
    padding: 20px;
    border: 1px solid #ebebeb;
    border-radius: 0 0 12px 12px;
    position: fixed;
    top: 160px;
    width: 100%;
    max-width: 1920px;
    z-index: 995;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    transition: top 0.3s ease;
}

/* ── Mobile ──────────────────────────────────────────────────────────── */
@media (max-width: 929px) {
    .welcome-banner {
        height: 36px;
    }

    .contact-bar-inner {
        gap: 12px;
        padding: 0 14px;
    }

    .contact-item:first-child,
    .contact-divider:first-of-type {
        display: none;
    }

    .contact-item { font-size: 11px; gap: 5px; }

    .navbar {
        top: 36px;
        height: 90px;
    }

    .navbar.shrink { height: 56px; }

    .logo-img {
        height: 58px;
        max-width: 190px;
    }

    .navbar.shrink .logo-img {
        height: 38px;
        max-width: 150px;
    }

    .container-inner {
        padding: 0 16px;
        gap: 12px;
    }

    .search-form-mobile {
        top: 126px; /* contact(36) + navbar(90) */
    }

    /* Dropdown ocupa quase a tela toda no mobile */
    .search-dropdown {
        right: 8px;
        left: 8px;
        width: auto;
    }

    .search-dropdown-body {
        flex-direction: column;
    }

    .search-dropdown-results {
        border-right: none;
        border-bottom: 1px solid #f0f0f0;
        padding: 14px 16px;
    }

    .search-dropdown-sidebar {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 4px;
        padding: 12px 16px 14px;
    }

    .search-sidebar-link {
        font-size: 13px;
        padding: 6px 10px;
    }

    .search-dropdown-field {
        padding: 14px 16px;
    }

    .search-dropdown-input { font-size: 15px; }

    .product-panel-content {
        top: 126px;
    }
}

/* ── Breakpoint menu ─────────────────────────────────────────────────── */
@media (max-width: 929px) {
    .container-menu { display: none; }

    .logo-icons {
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
}

@media (min-width: 930px) {
    .logo-icons,
    .mobile-icons { display: none; }
    .container-menu { display: flex; }
}
