/* Estilos base do site público (antes embutidos em includes/header_styles.php). As cores e fontes da instalação ficam no :root inline. */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background: var(--background);
    color: var(--text);
}

h1,
h2,
h3 {
    font-family: var(--font-heading);
}

h4,
h5,
h6 {
    font-family: var(--font-subheading);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Top Bar */
.top-bar {
    background: linear-gradient(90deg, var(--menu-gradient-start) 0%, var(--menu-gradient-end) 100%);
    /* Blue Gradient */
    color: var(--white);
    padding: 12px 0;
    font-size: 14px;
    font-weight: 500;
}

/* Footer Styles override removed to apply only to CTA */

.top-bar-content {
    display: flex;
    justify-content: flex-start;
    /* Align Items to Left (Start) */
    align-items: center;
    gap: 15px;
    /* Consistent spacing between Text and Button */
}

.top-bar-text {
    font-size: 16px;
    font-weight: 500;
}

.location-pill-btn {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--white);
    padding: 6px 16px;
    border-radius: 9999px;
    /* Pill shape */
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s;
}

.location-pill-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

display: flex;
align-items: center;
justify-content: center;
width: 28px;
height: 28px;
background: rgba(255, 255, 255, 0.15);
backdrop-filter: blur(10px);
color: var(--white);
border-radius: 50%;
transition: all 0.3s;
text-decoration: none;
font-size: 12px;
}

.social-top a:hover {
    background: var(--white);
    color: var(--primary);
    transform: translateY(-2px);
}

.btn-accessibility {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: none;
    color: var(--white);
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-accessibility:hover {
    background: var(--white);
    color: var(--primary);
}

.header-main {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 15px 0;
    position: relative;
    z-index: 1001;
}

.is-sticky .header-main {
    background: rgba(255, 255, 255, 0.85);
    padding: 8px 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border-bottom-color: rgba(255, 255, 255, 0.5);
}

.header-content {
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.3s ease;
}

.header-logo {
    flex: 0 0 auto;
    margin-right: 50px;
}

.logo-link {
    display: block;
    text-decoration: none;
}

.logo-img {
    max-height: 80px;
    width: auto;
    transition: all 0.3s ease;
}

.is-sticky .logo-img {
    max-height: 42px;
}

.mobile-logo {
    display: none;
}

.search-container {
    flex: 1;
    max-width: 100%;
}

.search-wrapper {
    display: flex;
    background: var(--background);
    border: 2px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s;
    position: relative;
    z-index: 10002;
}

.search-wrapper:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 0 0 12px 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    z-index: 10001;
    max-height: 400px;
    overflow-y: auto;
    display: none;
}

.search-dropdown.active {
    display: block;
}

.search-input {
    flex: 1;
    border: none;
    padding: 14px 16px;
    font-size: 15px;
    background: transparent;
    outline: none;
    color: var(--text);
}

.search-input::placeholder {
    color: var(--text-light);
}

.search-city-display {
    border-left: 1px solid var(--border);
    padding: 14px 16px;
    font-size: 14px;
    background: transparent;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    min-width: 150px;
}

.search-city-display svg {
    color: var(--primary);
    opacity: 0.8;
}

.search-btn {
    background: var(--primary);
    color: var(--white);
    border: none;
    padding: 0 24px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.search-btn:hover {
    background: var(--secondary);
}

.quick-suggestions {
    margin-top: 4px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
    font-size: 11px;
    color: var(--text-light);
    transition: all 0.3s ease;
    max-height: 50px;
    overflow: hidden;
}

.is-sticky .quick-suggestions {
    max-height: 0;
    margin-top: 0;
    opacity: 0;
    pointer-events: none;
}

.quick-chip {
    border-radius: 999px;
    padding: 3px 8px;
    border: 1px solid var(--border);
    background: var(--white);
    cursor: pointer;
    font-size: 11px;
    color: var(--text);
    transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.quick-chip:hover {
    background: var(--background);
    border-color: #d1d5db;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.08);
    transform: translateY(-1px);
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: var(--background);
    border: none;
    border-radius: 10px;
    color: var(--text);
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.header-btn:hover {
    background: var(--primary);
    color: var(--white);
}

.header-btn svg {
    width: 20px;
    height: 20px;
}

.header-btn .badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--accent);
    color: var(--white);
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
}

.menu-mobile-btn {
    display: none;
}

/* Navigation */
.nav-main {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    position: relative;
    z-index: 999;
}

.nav-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    transition: all 0.3s ease;
}

.is-sticky .nav-content {
    padding: 0;
}

.is-sticky .nav-main {
    border-bottom: none;
}

.is-sticky .nav-categories-container {
    padding: 5px 0;
}

.nav-categories-container {
    position: relative;
    padding: 12px 0;
}

.nav-categories-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--primary);
    color: var(--white);
    border: none;
    padding: 10px 16px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
}


.nav-categories-btn:hover {
    background: var(--secondary);
    transform: translateY(-2px);
}

/* Dropdown Categorias */
.sticky-categories-container {
    display: none;
    position: relative;
    flex-shrink: 0;
    margin-right: 20px;
}

/* Fix hover gap */
.sticky-categories-container::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 20px;
    background: transparent;
    z-index: 100;
}

.header-main.is-sticky .sticky-categories-container {
    display: block;
}

@media (max-width: 991px) {
    .header-main.is-sticky .quick-suggestions {
        display: none !important;
    }
}

.sticky-categories-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--primary);
    color: var(--white);
    border: none;
    padding: 0 16px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    height: 44px;
}

.sticky-categories-btn:hover {
    background: var(--secondary);
}

.sticky-categories-container:hover .categories-dropdown {
    display: grid;
    opacity: 1;
    transform: translateY(0);
    top: 100%;
    margin-top: 15px;
}

@media (max-width: 1024px) {
    .sticky-categories-container {
        display: none !important;
    }
}

.categories-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 600px;
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    padding: 25px;
    display: none;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    z-index: 1100;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    border: 1px solid var(--border);
}

.nav-categories-container:hover .categories-dropdown {
    display: grid;
    opacity: 1;
    transform: translateY(0);
}

.dropdown-category-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.dropdown-category-item:hover {
    background: rgba(99, 102, 241, 0.05);
    color: var(--primary);
    transform: translateX(5px);
}

.dropdown-category-item i {
    font-size: 18px;
    color: var(--primary);
}

.nav-categories-btn svg {
    width: 18px;
    height: 18px;
}

.nav-links {
    display: flex;
    gap: 25px;
    flex: 1;
    justify-content: flex-start;
    /* Alinha à esquerda */
    margin-left: 30px;
    /* Separa do container de categorias */
}

.nav-link {
    color: var(--text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
    position: relative;
}

.is-sticky .nav-link {
    font-size: 13px;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width 0.3s;
}

.nav-link:hover {
    color: var(--primary);
}

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

.nav-actions {
    display: flex;
    gap: 10px;
}

.nav-panel-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 15px;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
}

.nav-panel-link i {
    font-size: 18px;
}

.nav-panel-link:hover {
    text-decoration: underline;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
}

.btn-business {
    background: #1e3a8a;
    color: var(--white);
}

.btn-business:hover {
    background: #1e293b;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.3);
}

.btn-quotes {
    background: var(--background);
    color: var(--text);
}

.btn-quotes:hover {
    background: var(--border);
}

.nav-user-wrapper {
    position: relative;
}

.nav-user-button {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: none;
    background: var(--primary);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.nav-user-button:hover {
    background: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.3);
}

.nav-user-menu {
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 12px;
    min-width: 200px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 15px 50px rgba(15, 23, 42, 0.15);
    padding: 8px;
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid rgba(0, 0, 0, 0.05);
    pointer-events: none;
}

.nav-user-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

@keyframes userMenuIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.nav-user-menu-item {
    display: block;
    padding: 10px 16px;
    border-radius: 12px;
    color: #334155;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none !important;
    transition: all 0.2s;
}

.nav-user-menu-item:hover {
    background: #f1f5f9;
    color: var(--primary);
}

/* Weather Widget Modernized */
.weather-widget {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 0 25px;
    margin-left: 15px;
    border-left: 1px solid rgba(0, 0, 0, 0.08);
}

@media (max-width: 991px) {
    .weather-widget {
        display: none !important;
    }
}

.weather-icon img {
    width: 48px;
    height: auto;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.weather-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.weather-temp-item {
    display: flex;
    align-items: baseline;
    gap: 5px;
}

.weather-val {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.weather-label {
    font-size: 11px;
    font-weight: 800;
    text-transform: lowercase;
    color: #555;
}

.temp-min-wrap .weather-val {
    color: #4A90E2;
    /* Blue for min */
}

.temp-max-wrap .weather-val {
    color: #E35D5D;
    /* Red for max */
}

/* Categories Grid */
.categories-section {
    background: var(--white);
    padding: 20px 0 24px;
    border-bottom: 1px solid var(--border);
}

.recent-company-banner {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    padding: 6px 14px;
    margin-bottom: 14px;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.05);
    transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
    height: 52px;
    overflow: hidden;
}

.recent-company-banner:hover {
    background: #f9fafb;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
    transform: translateY(-1px);
}

.recent-company-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    z-index: 10;
    background: transparent;
}

.recent-company-slider {
    flex: 1;
    height: 100%;
    min-width: 0;
}

.recent-company-slider .swiper-slide {
    display: flex;
    align-items: center;
    height: 100%;
}

.recent-company-text {
    font-size: 13px;
    line-height: 1.4;
    text-align: left;
    text-decoration: none;
    color: var(--text);
    display: block;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.recent-company-text strong {
    font-weight: 700;
}

@media (min-width: 768px) {
    .recent-company-banner {
        justify-content: center;
    }

    .recent-company-text {
        text-align: center;
    }
}

@keyframes recent-bell {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.5);
    }

    70% {
        transform: scale(1.06);
        box-shadow: 0 0 0 8px rgba(245, 158, 11, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0);
    }
}

.categories-grid {
    display: flex;
    gap: 12px;
    padding-bottom: 10px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    cursor: grab;
}

.categories-grid:active {
    cursor: grabbing;
}

.categories-grid::-webkit-scrollbar {
    display: none;
}

@media (min-width: 769px) {
    .search-container {
        margin-left: auto;
    }
}

.category-card {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #f3f4f6;
    border: 1px solid var(--border);
    border-radius: 12px;
    text-decoration: none;
    color: var(--text);
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
    flex: 0 0 auto;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
    scroll-snap-align: start;
    white-space: nowrap;
}

.category-card:hover {
    background: #eef2f7;
    color: var(--text);
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.06);
}

.category-card .category-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    color: #111827;
    font-size: 18px;
}

.category-name {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.2px;
    text-transform: none;
}

.category-card.all-chip {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
    justify-content: center;
    gap: 0;
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s;
}

.mobile-menu-overlay.active {
    display: block;
    opacity: 1;
}

.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 300px;
    height: 100vh;
    background: var(--white);
    box-shadow: -2px 0 20px var(--shadow);
    z-index: 1000;
    overflow-y: auto;
    transition: right 0.3s;
    padding: 20px;
}

.mobile-menu.active {
    right: 0;
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.mobile-menu-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text);
}

.mobile-menu-links {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.mobile-menu-link {
    color: var(--text);
    text-decoration: none;
    padding: 15px 0;
    font-size: 15px;
    font-weight: 500;
    border-bottom: 1px solid var(--border);
    transition: color 0.3s;
}

.mobile-menu-link:hover {
    color: var(--primary);
}

/* Responsive */
@media (max-width: 1024px) {
    .nav-links {
        gap: 20px;
    }

    .top-links {
        display: none;
    }
}

@media (max-width: 768px) {
    .header-main.is-sticky {
        padding: 0 !important;
    }

    .top-bar {
        padding: 2px 0;
        font-size: 12px;
    }

    .top-bar-content {
        justify-content: center;
    }

    .top-bar-left {
        flex: 1;
    }

    .top-bar-right {
        display: none;
    }

    .header-content {
        display: grid;
        grid-template-columns: 1fr auto;
        /* Col 1: Logo takes space, Col 2: Icons take fit */
        grid-template-rows: auto auto;
        /* Row 1: Logo/Icons, Row 2: Search */
        gap: 4px 0;
        /* Vertical Gap reduced */
        padding: 4px 0 0 0;
        align-items: center;
    }

    .header-logo {
        grid-column: 1 / 2;
        grid-row: 1;
        width: 100%;
        /* Take full column width */
        min-width: 0;
        padding-right: 10px;
        display: flex;
        justify-content: flex-start !important;
        align-items: center;
        margin-bottom: 0;
        text-align: left !important;
    }

    .header-logo a {
        display: flex;
        justify-content: flex-start !important;
        margin: 0 !important;
    }

    .header-actions {
        grid-column: 2 / 3;
        grid-row: 1;
        display: flex;
        gap: 6px;
        align-items: center;
        justify-content: flex-end;
        white-space: nowrap;
        /* Prevent icons wrapping */
    }

    .desktop-logo {
        display: none !important;
    }

    .mobile-logo {
        display: block !important;
        height: auto !important;
        max-width: 150px !important;
        /* Reduced max width */
        width: 100%;
        object-fit: contain;
        margin-left: 0 !important;
        margin-right: auto !important;
        /* Ensure no other media query overrides this */
    }

    .search-container {
        grid-column: 1 / span 2;
        /* Span full width */
        grid-row: 2;
        width: 100%;
        margin-top: 0;
        margin-bottom: 4px;
        /* Gap handled by grid-gap */
    }

    /* Compact Search Inputs on Mobile */
    .search-input {
        padding: 10px 12px;
        font-size: 16px;
    }

    .search-city-display {
        padding: 10px 12px;
        font-size: 13px;
    }

    .quick-suggestions {
        display: flex !important;
        margin-top: 4px;
    }

    .quick-suggestions-label {
        display: inline-block !important;
        margin-right: 4px;
    }

    /* Show only first 4 chips on mobile */
    .quick-chip:nth-child(n+5) {
        display: none;
    }

    .menu-mobile-btn {
        display: flex;
    }

    .nav-main {
        display: none;
    }

    .categories-section {
        padding: 0 0 10px 0;
    }

    .categories-grid {
        display: flex;
        overflow-x: auto;
        gap: 12px;
        padding-bottom: 0;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .categories-grid::-webkit-scrollbar {
        display: none;
    }

    .category-card {
        flex: 0 0 calc((100% - 24px) / 3);
        padding: 15px 10px;
    }

    .category-icon {
        font-size: 28px;
    }

    .category-name {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .location-badge {
        font-size: 11px;
        padding: 4px 8px;
    }

    /* Double-check logo sizing on small screens */
    .mobile-logo {
        max-width: 140px !important;
    }

    /* Header Icons (Square & Gray) */
    .header-actions {
        gap: 6px;
    }

    /* Top Bar Mobile Adjustments */
    .top-bar-content {
        justify-content: flex-start;
        /* Keep left alignment on mobile */
        gap: 8px;
        /* Slightly smaller gap on mobile */
    }

    .header-btn {
        width: 40px;
        height: 40px;
        background: #f3f4f6;
        /* Gray-100 */
        color: #1f2937;
        /* Gray-800 */
        border-radius: 10px;
        border: 1px solid transparent;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .header-btn:hover,
    .header-btn:active {
        background: #e5e7eb;
        /* Gray-200 */
        color: var(--primary);
    }

    .header-btn svg {
        width: 22px;
        height: 22px;
        stroke-width: 2;
    }

    .header-btn[onclick="toggleCityModal()"] {
        /* Highlight Location Button if needed, or keep same */
        background: #f3f4f6;
        color: #1f2937;
    }

    /* Mobile Search Layout: Campo + Botão lado a lado (como no print) */
    .search-container {
        padding: 0 4px;
        margin-bottom: 4px;
    }

    .recent-company-banner {
        margin-bottom: 10px;
    }

    .search-wrapper {
        display: flex;
        align-items: stretch;
        gap: 8px;
        background: transparent;
        border: none;
        box-shadow: none;
        border-radius: 0;
    }

    .search-input {
        flex: 1 1 auto;
        width: auto;
        height: 48px;
        background: var(--white);
        border: none;
        border-radius: 8px;
        padding: 0 18px;
        font-size: 16px;
        font-weight: 500;
        color: #4b5563;
        text-transform: none;
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    }

    .search-input::placeholder {
        color: #9ca3af;
        font-weight: 500;
        font-size: 14px;
    }

    /* No mobile o seletor de cidade não aparece dentro da barra de busca */
    .search-city-display {
        display: none;
    }

    .search-btn {
        flex: 0 0 auto;
        padding: 0 12px;
        height: 48px;
        background: #2D2B52;
        color: var(--white);
        border: none;
        border-radius: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: 700;
        font-size: 13px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }

    .search-btn:active {
        transform: translateY(1px);
    }

    .search-btn svg {
        width: 18px;
        height: 18px;
        margin-right: 0;
    }

    .search-btn span {
        display: none;
    }

    /* Adjust Categories Grid for smaller screens if needed */
    .categories-grid {
        gap: 10px;
    }

    .category-card {
        padding: 12px 8px;
        flex: 0 0 calc((100% - 20px) / 3);
        /* Slightly smaller on very small screens */
    }

    .category-icon {
        font-size: 24px;
    }

    .category-name {
        font-size: 10px;
    }
}

/* Modal Cidade */
.city-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.city-modal-overlay.active {
    display: flex;
    opacity: 1;
}

.city-modal {
    background: var(--white);
    width: 90%;
    max-width: 600px;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    transform: scale(0.95);
    transition: transform 0.3s;
    overflow: hidden;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.city-modal-overlay.active .city-modal {
    transform: scale(1);
}

.city-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--background);
}

.city-modal-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.city-modal-close {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 4px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.city-modal-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text);
}

.city-modal-body {
    padding: 24px;
    overflow-y: auto;
}

.city-search-box {
    margin-bottom: 20px;
    position: relative;
}

.city-search-input {
    width: 100%;
    padding: 12px 16px 12px 40px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
}

.city-search-input:focus {
    border-color: var(--primary);
}

.city-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    pointer-events: none;
}

.city-states {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.city-state-group {
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    padding: 10px 12px 8px 12px;
    background: linear-gradient(145deg, #ffffff, #f8fafc);
}

.city-state-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: #64748b;
    cursor: pointer;
    gap: 8px;
}

.city-state-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 11px;
    background: rgba(79, 70, 229, 0.06);
    color: #312e81;
}

.city-state-count {
    font-size: 11px;
    opacity: 0.9;
}

.city-state-chevron {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: #94a3b8;
    transition: transform 0.16s ease-out;
}

.city-state-group.open .city-state-chevron {
    transform: rotate(90deg);
}

.city-state-body {
    margin-top: 6px;
    padding-top: 4px;
    max-height: 220px;
    overflow-y: auto;
    display: none;
}

.city-state-group.open .city-state-body {
    display: block;
}

.cities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
}

.city-item-link {
    padding: 10px 12px;
    border: 1px solid rgba(148, 163, 184, 0.6);
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.18s ease-out;
    text-align: center;
    font-size: 13px;
    font-weight: 500;
    color: #0f172a;
    background: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.city-item-link:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(79, 70, 229, 0.06);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.06);
}

.city-item-link.active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
    box-shadow: 0 6px 14px rgba(79, 70, 229, 0.35);
}

.city-geo-button {
    width: 100%;
    border: 2px dashed var(--primary);
    background: rgba(79, 70, 229, 0.03);
    color: var(--primary);
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.18s ease-out;
    font-size: 14px;
}

.city-geo-button:hover {
    background: rgba(79, 70, 229, 0.08);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.06);
}

/* Submenu Desktop */
.category-wrapper {
    position: relative;
}

.desktop-submenu {
    display: none;
    position: absolute;
    left: 100%;
    top: 0;
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 250px;
    z-index: 1000;
    border-radius: 0 8px 8px 8px;
    border: 1px solid var(--border);
    padding: 5px 0;
    /* Nunca passa da tela: com muitas subcategorias rola por dentro */
    max-height: calc(100vh - 24px);
    overflow-y: auto;
}

.category-wrapper:hover .desktop-submenu {
    display: block;
}

.desktop-submenu a {
    display: block;
    padding: 10px 20px;
    color: var(--text);
    text-decoration: none;
    font-size: 14px;
    transition: background 0.2s, color 0.2s;
    border-left: 3px solid transparent;
}

.desktop-submenu a:hover {
    background: var(--background);
    color: var(--primary);
    border-left-color: var(--primary);
}

.stories-bar-wrapper {
    width: 100%;
    margin: 0 0 8px;
    overflow: hidden;
}

.stories-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    overflow-x: auto;
    padding: 6px 2px 10px;
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.7) transparent;
}

.stories-bar::-webkit-scrollbar {
    height: 6px;
}

.stories-bar::-webkit-scrollbar-track {
    background: transparent;
}

.stories-bar::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.7);
    border-radius: 999px;
}

.story-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 4px;
    border: none;
    background: transparent;
    padding: 0;
    cursor: pointer;
    min-width: 70px;
    text-decoration: none;
    color: inherit;
}

.story-avatar {
    width: 60px;
    height: 60px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e5e7eb;
    position: relative;
}

.story-avatar-inner {
    width: 54px;
    height: 54px;
    border-radius: 999px;
    background: #f9fafb;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    font-size: 22px;
    color: #9ca3af;
}

.story-avatar-inner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.story-avatar.has-story {
    padding: 2px;
    background: conic-gradient(from 180deg, #f97316, #ec4899, #8b5cf6, #f97316);
}

.story-label {
    font-size: 11px;
    color: #4b5563;
    max-width: 70px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-decoration: none;
}

.story-add-icon {
    position: absolute;
    right: -2px;
    bottom: -2px;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 11px;
    border: 2px solid #ffffff;
}

.story-viewer-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.story-viewer-overlay.active {
    display: flex;
    pointer-events: auto;
}

.story-viewer-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
}

.story-viewer-shell {
    position: relative;
    width: 100%;
    max-width: 420px;
    max-height: 100%;
    aspect-ratio: 9 / 16;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.story-viewer-topbar {
    position: relative;
    padding: 10px 12px 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 12;
}

.story-viewer-dots {
    flex: 1;
    height: 4px;
    display: flex;
    gap: 3px;
    align-items: center;
}

.story-progress-segment {
    flex: 1;
    height: 3px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.35);
    overflow: hidden;
}

.story-progress-fill {
    width: 0;
    height: 100%;
    background: #ffffff;
    border-radius: 999px;
}

.story-viewer-close {
    border: none;
    background: transparent;
    color: #f9fafb;
    margin-left: 10px;
    font-size: 22px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.story-viewer-header {
    position: absolute;
    top: 50px;
    left: 14px;
    right: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0;
    z-index: 10;
}

.story-viewer-avatar-wrap {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    border: 2px solid rgba(255, 255, 255, 0.8);
    overflow: hidden;
    flex-shrink: 0;
}

.story-viewer-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.story-viewer-title-wrap {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.story-viewer-empresa {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.story-viewer-info {
    font-size: 11px;
    color: rgba(249, 250, 251, 0.7);
}

.story-viewer-media {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    z-index: 1;
}

.story-viewer-media-el {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
    background: #111827;
    display: none;
}

.story-viewer-topbar,
.story-viewer-header,
.story-viewer-footer {
    position: absolute;
    left: 0;
    right: 0;
    z-index: 10;
}

.story-viewer-topbar {
    top: 0;
    padding: 10px 12px 0;
    height: 40px;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0));
}

.story-viewer-header {
    top: 45px;
    padding: 0 14px;
    height: auto;
}

.story-viewer-footer {
    bottom: 0;
    padding: 20px 14px 20px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0));
    display: flex;
    gap: 8px;
    justify-content: space-between;
    align-items: center;
}

.story-viewer-action {
    flex: 1;
    border: none;
    border-radius: 999px;
    padding: 8px 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    background: #020617;
    color: #f9fafb;
    cursor: pointer;
}

.story-viewer-action i {
    font-size: 14px;
}

@media (max-width: 576px) {
    .story-viewer-shell {
        max-width: 100%;
        max-height: 100%;
        margin: 0 6px;
    }

    .story-viewer-header {
        top: 50px;
        left: 14px;
        right: 14px;
        padding: 0;
    }

    .story-viewer-footer {
        padding-bottom: 20px;
    }
}

.story-item-you .story-avatar {
    background: transparent;
    border: 2px solid var(--primary);
}

.story-item-you .story-avatar-inner {
    background: #ffffff;
    color: var(--primary);
}

.home-slider-wrapper {
    width: 100%;
    margin: 0 0 14px;
}

.home-slider-swiper {
    width: 100%;
    overflow: hidden;
    border-radius: 12px;
}

.home-slider-swiper .swiper-slide img,
.home-slider-banner img {
    display: block;
    width: 100%;
    height: auto;
}

.home-slider-pagination {
    margin-top: 8px;
    text-align: center;
    position: static;
}

.home-slider-pagination .swiper-pagination-bullet {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: var(--border);
    opacity: 1;
    margin: 0 3px;
}

.home-slider-pagination .swiper-pagination-bullet-active {
    background: var(--primary);
    transform: scale(1.2);
}

@media (max-width: 767.98px) {
    .home-slider-swiper .swiper-slide img {
        width: 100%;
        height: auto;
    }
}

/* ===== Refino do cabeçalho público (toque, primeira dobra, foco) ===== */
.top-bar-content { flex-wrap: nowrap !important; min-width: 0; }
.top-bar-content > span { white-space: nowrap; }
.location-pill-btn {
    min-height: 44px;
    white-space: nowrap;
    min-width: 0;
}
.location-pill-btn > span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 52vw;
}

/* Chips de Top Buscas: visual compacto, área de toque de 44px */
.quick-chip {
    position: relative;
    min-height: 28px;
    padding: 4px 10px;
    font-size: 12px;
}
.quick-chip::after {
    content: "";
    position: absolute;
    inset: -8px -3px;
}
.quick-suggestions { gap: 6px; max-height: 64px; padding-block: 4px; }

.category-card { min-height: 44px; }
.nav-main .nav-link { display: inline-flex; align-items: center; min-height: 44px; }

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
    outline: 3px solid var(--primary, #1d4ed8);
    outline-offset: 2px;
    border-radius: 6px;
}

.search-input::placeholder { color: #5b6472; opacity: 1; }

@media (max-width: 768px) {
    .header-btn, .menu-mobile-btn { width: 44px; height: 44px; }
    .nav-user-button { width: 44px !important; height: 44px !important; }

    /* Primeira dobra: categorias primeiro, anúncio e novidade depois */
    .categories-section > .container { display: flex; flex-direction: column; }
    .categories-section .categories-grid { order: 1; }
    .categories-section .recent-company-banner { order: 2; }
    .categories-section .home-slider-wrapper { order: 3; margin-top: 12px; }
    .category-card { flex-basis: calc((100% - 24px) / 3.4); }

    /* Respiro abaixo do cabeçalho fixo: a sombra dele não corta mais as categorias */
    .categories-section { padding-top: 20px !important; }
    .categories-section .categories-grid { padding: 2px 20px 8px; margin-inline: -20px; scroll-padding-left: 20px; }
    .categories-section .recent-company-banner { margin-top: 14px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Áreas de toque: logo, avisos de novidade, links do rodapé e do cookie */
.logo-link { padding-block: 8px; }
.city-modal-close-btn { min-width: 44px; min-height: 44px; }
.bottom-link { display: inline-flex; align-items: center; min-height: 44px; }
.cookie-content a { padding-block: 12px; }

/* ===== Barra de navegação (desktop): uma linha só, sem quebra de texto ===== */
@media (min-width: 992px) {
    .nav-content { gap: 16px; flex-wrap: nowrap; }
    .nav-categories-container { flex: 0 0 auto; }
    .nav-categories-btn,
    .nav-main .nav-link,
    .nav-main .nav-btn,
    .nav-panel-link,
    .weather-val { white-space: nowrap; }

    .nav-links { margin-left: 8px !important; gap: 22px !important; min-width: 0; }
    .nav-actions { flex: 0 0 auto; gap: 12px !important; }

    /* Clima compacto: temperatura em cima, "min"/"máx" embaixo */
    .weather-widget { gap: 10px; padding: 0 16px; margin-left: 4px; flex: 0 0 auto; }
    .weather-icon img { width: 40px; }
    .weather-info { gap: 14px; }
    .weather-temp-item { flex-direction: column; align-items: center; gap: 0; line-height: 1.1; }
    .weather-val { font-size: 17px; }
    .weather-label { font-size: 10px; letter-spacing: 0.04em; }

    .nav-main .nav-btn { padding: 10px 18px; gap: 10px; }
}

@media (min-width: 992px) and (max-width: 1279px) {
    .nav-links { gap: 16px !important; }
    .nav-categories-btn { padding: 10px 14px; }
    .nav-main .nav-btn { padding: 10px 14px; }
    .weather-widget { padding: 0 12px; }
    .weather-icon img { width: 34px; }
    .nav-panel-link span { display: none; }
    .nav-panel-link { width: 44px; height: 44px; justify-content: center; }
}

@media (max-width: 420px) {
    /* O nome da cidade aparece inteiro: o rótulo "Alterar cidade" sai e fica no aria-label do botão */
    .top-bar-content > span { display: none !important; }
    .top-bar-content { justify-content: center; }
    .location-pill-btn > span { max-width: none !important; }
}

/* Fim dos estilos específicos do header */
/* Ícones Lucide do cabeçalho */
.nav-user-button svg { width: 22px; height: 22px; }
.btn-business svg { width: 20px; height: 20px; }
.nav-panel-link svg, .btn-modern-primary svg { width: 18px; height: 18px; }
.search-btn svg { width: 20px; height: 20px; }

/* Busca: campo e botão formam uma peça só; X limpa; sem texto não envia */
.search-wrapper { align-items: stretch; }
.search-clear {
    flex: none;
    width: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: #64748b;
    cursor: pointer;
}
.search-clear[hidden] { display: none; }
.search-clear svg { width: 18px; height: 18px; }
.search-clear:hover { color: #0f172a; }
.search-clear:focus-visible { outline: 3px solid #1d4ed8; outline-offset: -3px; }
.search-btn:disabled {
    background: #cbd5e1 !important;
    color: #475569 !important;
    cursor: not-allowed;
    transform: none;
}

@media (max-width: 768px) {
    .search-wrapper {
        gap: 0 !important;
        background: var(--white) !important;
        border: 1.5px solid var(--border) !important;
        border-radius: 12px !important;
        overflow: hidden;
        box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06) !important;
    }
    .search-wrapper:focus-within { border-color: var(--primary) !important; }
    .search-input {
        background: transparent !important;
        border-radius: 0 !important;
        box-shadow: none !important;
    }
    .search-btn {
        width: 52px;
        padding: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
    }
}

/* Ícones Lucide no lugar do Font Awesome: seguem o tamanho (font-size) e a cor do texto, como os antigos */
svg.ic {
    width: 1em;
    height: 1em;
    vertical-align: -0.125em;
    flex-shrink: 0;
}
