/* Botão customizado para escolher arquivo de status */
.status-file-btn {
    width: 90px;
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2.5px dashed #D4AF37;
    border-radius: 18px;
    background: #191919;
    color: #D4AF37;
    font-size: 2.8em;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    position: relative;
    margin-bottom: 12px;
}
.status-file-btn:hover {
    border-color: #FFD700;
    background: #232323;
}
.status-file-btn input[type="file"] {
    opacity: 0;
    position: absolute;
    left: 0; top: 0; width: 100%; height: 100%;
    cursor: pointer;
}
/* Remove highlight azul em links, botões e cards no mobile */
a, button, .product-card, .carousel-btn {
    -webkit-tap-highlight-color: transparent;
    outline: none !important;
}
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #1A1A1A 60%, #5A0C16 100%);
    color: #F4F4F4;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1 0 auto;
}

header {
    background: #5A0C16;
    color: #F4F4F4;
    padding: 18px 0 10px 0;
    text-align: center;
    box-shadow: 0 2px 8px rgba(90,12,22,0.12);
}

.logo {
    font-size: 2.1em;
    font-weight: bold;
    letter-spacing: -1px;
    color: #F4F4F4;
    text-shadow: 0 1px 0 #1A1A1A;
}

.menu {
    margin-top: 10px;
    background: #5A0C16;
    padding: 8px 0;
    border-radius: 0 0 8px 8px;
    display: flex;
    justify-content: center;
    gap: 18px;
}

.menu button {
    background: none;
    color: #F4F4F4;
    border: none;
    font-size: 1.1em;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 4px;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
    font-weight: 500;
}

.menu button:hover {
    background: #B81C1C;
    color: #D4AF37;
    box-shadow: 0 2px 8px #B81C1C33;
}

.search-bar {
    position: relative;
    margin: 18px auto 0 auto;
    display: flex;
    justify-content: center;
    max-width: 900px;
    gap: 0;
    width: 100%;
}

/* Compact search form controls for bairro/cidade to avoid large header on mobile */
#bairro-search-form {
    display: flex; /* kept for safety if inline style removed */
    gap: 12px;
    width: 100%;
    max-width: 98vw;
    box-sizing: border-box;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

#bairro-search-form .autocomplete-group {
    /* allow groups to grow/shrink responsively; avoid large fixed min widths */
    flex: 1 1 220px;
    min-width: 120px;
    max-width: 480px;
    box-sizing: border-box;
}

#bairro-search-form input[type="text"] {
    width: 115%;
    max-width: 130%;
    box-sizing: border-box;
    padding: 8px 10px;
    border: 1.5px solid #B81C1C;
    border-radius: 6px;
    background: #1A1A1A;
    color: #F4F4F4;
    outline: none;
}

#bairro-search-form button {
    padding: 10px 14px;
}

/* Mobile: use two-column compact layout so controls don't stack one-per-line */
@media (max-width: 200px) {
    #bairro-search-form { gap: 8px; }
    #bairro-search-form .autocomplete-group { flex: 1 1 28%; min-width: 120px; max-width: 28%; }
    #bairro-search-form input[type="text"] { width: 80%; }
    #bairro-search-form button { flex: 1 1 48%; min-width: 120px; max-width: 28%; padding: 10px; }
}

#main-search-form {
    display: flex;
    gap: 10px;
    width: 100%;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

#localidade-autocomplete {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid #B81C1C;
    border-radius: 6px;
    font-size: 1em;
    background: #1A1A1A;
    color: #F4F4F4;
    outline: none;
}

#main-search {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid #B81C1C;
    border-radius: 6px;
    font-size: 1em;
    background: #1A1A1A;
    color: #F4F4F4;
    outline: none;
}

#btn-localize {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 10px 14px;
    background: #B81C1C;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1em;
    transition: background 0.2s, color 0.2s;
}
#btn-localize:hover {
    background: #D4AF37;
    color: #5A0C16;
}

#btn-busca {
    padding: 10px 18px;
    background: #B81C1C;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 1em;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}
#btn-busca:hover {
    background: #D4AF37;
    color: #5A0C16;
}

.location-autocomplete-wrapper {
    position: relative;
    width: 260px;
}

#location-autocomplete {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #B81C1C;
    border-radius: 6px;
    font-size: 1em;
    background: #1A1A1A;
    color: #F4F4F4;
    outline: none;
}

.suggestions-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #1A1A1A;
    border: 1px solid #B81C1C;
    border-top: none;
    z-index: 10;
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 180px;
    overflow-y: auto;
    box-shadow: 0 4px 16px #1A1A1A99;
}

.suggestions-list li {
    padding: 8px 12px;
    cursor: pointer;
    color: #F4F4F4;
    transition: background 0.2s;
}

.suggestions-list li:hover, .suggestions-list li.active {
    background: #B81C1C;
    color: #D4AF37;
}

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

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 28px;
    margin-top: 24px;
    transition: grid-template-columns 0.3s;
    justify-content: center;
    align-items: start;
    width: 100%;
    box-sizing: border-box;
}

.products-grid.grid-4 {
    grid-template-columns: repeat(3, 1fr);
}

.products-grid.grid-9 {
    grid-template-columns: repeat(9, 1fr);
}

.products-grid.list {
    grid-template-columns: 1fr;
}

.products-grid.detail {
    grid-template-columns: 1fr;
}

.product-card {
    background: #1A1A1A;
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(90,12,22,0.13);
    padding: 18px 16px 14px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 2px solid transparent;
    transition: box-shadow 0.2s, border 0.2s;
}

.product-card:hover {
    box-shadow: 0 4px 18px #B81C1C33;
    border: 2px solid #D4AF37;
}

.product-img {
    width: 120px;
    height: 120px;
    object-fit: contain;
    margin-bottom: 12px;
    background: #5A0C16;
    border-radius: 8px;
    border: 2px solid #D4AF37;
}

.product-title {
    font-size: 1.1em;
    font-weight: 600;
    margin-bottom: 6px;
    color: #F4F4F4;
    text-align: center;
}

.product-desc {
    font-size: 0.98em;
    color: #E3E3E3;
    margin-bottom: 10px;
    text-align: center;
}

.product-price {
    font-size: 1.2em;
    color: #D4AF37;
    font-weight: bold;
    margin-bottom: 10px;
}

.product-card button {
    background: #B81C1C;
    color: #F4F4F4;
    border: none;
    border-radius: 5px;
    padding: 8px 18px;
    font-size: 1em;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    font-weight: 500;
}

.product-card button:hover {
    background: #D4AF37;
    color: #5A0C16;
}

/* View mode buttons */
.view-modes .view-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: background 0.2s;
    outline: none;
    display: flex;
    align-items: center;
}

.view-modes .view-btn.active,
.view-modes .view-btn:focus {
    background: #B81C1C33;
    box-shadow: 0 0 0 2px #D4AF37;
}

.view-modes .view-btn svg {
    color: #D4AF37;
    /* mesma cor do texto do título */
    transition: color 0.2s;
}

.view-modes .view-btn.active svg {
    color: #B81C1C;
}

.view-modes .view-btn img {
    display: block;
}

/* Card for list mode */
.products-grid.list .product-card {
    flex-direction: row;
    align-items: center;
    padding: 18px 32px;
    gap: 24px;
}

.products-grid.list .product-img {
    width: 80px;
    height: 80px;
    margin-bottom: 0;
}

.products-grid.list .product-title,
.products-grid.list .product-desc,
.products-grid.list .product-price {
    text-align: left;
}

/* Card for detail mode */
.products-grid.detail .product-card {
    flex-direction: row;
    align-items: flex-start;
    padding: 24px 40px;
    gap: 32px;
    min-height: 160px;
}

.products-grid.detail .product-img {
    width: 120px;
    height: 120px;
    margin-bottom: 0;
}

.products-grid.detail .product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.products-grid.detail .product-title {
    font-size: 1.3em;
    margin-bottom: 8px;
}

.products-grid.detail .product-desc {
    font-size: 1.05em;
    margin-bottom: 12px;
}

.products-grid.detail .product-price {
    font-size: 1.2em;
    margin-bottom: 12px;
}

.products-grid.detail .product-card button {
    align-self: flex-start;
}

footer {
    background: #1A1A1A;
    color: #9E9E9E;
    text-align: center;
    padding: 18px 0 10px 0;
    margin-top: 40px;
}

#snackbar {
    visibility: hidden;
    min-width: 250px;
    background-color: #B81C1C;
    color: #F4F4F4;
    text-align: center;
    border-radius: 4px;
    padding: 16px;
    position: fixed;
    left: 50%;
    bottom: 30px;
    transform: translateX(-50%);
    z-index: 1000;
    font-size: 17px;
    opacity: 0;
    transition: opacity 0.5s, visibility 0.5s;
}

#snackbar.show {
    visibility: visible;
    opacity: 1;
}

/* Styles for cadastro modals removed (buttons were removed from UI) */

.search-fields {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}
.autocomplete-group {
    position: relative;
    min-width: 180px;
}
.autocomplete-group input[type="text"] {
    width: 100%;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #333;
    background: #18141a;
    color: #f5e9e0;
    font-size: 1rem;
    outline: none;
    transition: border 0.2s;
}
.autocomplete-group input[type="text"]:focus {
    border: 1.5px solid #b71c1c;
}
.autocomplete-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 20;
    background: #1a161c;
    border: 1px solid #333;
    border-top: none;
    max-height: 220px;
    overflow-y: auto;
    list-style: none;
    margin: 0;
    padding: 0;
    box-shadow: 0 4px 16px rgba(0,0,0,0.18);
}
.autocomplete-suggestions li {
    padding: 8px 12px;
    cursor: pointer;
    color: #f5e9e0;
    border-bottom: 1px solid #222;
    background: #1a161c;
    transition: background 0.15s;
}
.autocomplete-suggestions li:last-child {
    border-bottom: none;
}
.autocomplete-suggestions li.active,
.autocomplete-suggestions li:hover {
    background: #b71c1c;
    color: #fffbe6;
}
#bairro-autocomplete[disabled] {
    background: #2a232a;
    color: #888;
    cursor: not-allowed;
}

#resultados-bairros {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    margin: 0 auto;
    max-width: 420px;
    background: #18141a;
    border-radius: 8px;
    padding: 0;
    list-style: none;
    display: none;
    box-shadow: 0 4px 16px #1A1A1A99;
    border: 1.5px solid #B81C1C;
    z-index: 100;
}
#resultados-bairros li {
    padding: 12px 16px 8px 16px;
    border-bottom: 1px solid #222;
    cursor: pointer;
    color: #f5e9e0;
    background: #18141a;
    transition: background 0.15s, color 0.15s;
    text-align: left;
}
#resultados-bairros li:last-child {
    border-bottom: none;
}
#resultados-bairros li:hover, #resultados-bairros li.active {
    background: #B81C1C;
    color: #fffbe6;
}
#resultados-bairros .bairro-nome {
    font-weight: 600;
    font-size: 1.08em;
    color: #D4AF37;
    margin-bottom: 2px;
    display: block;
}
#resultados-bairros .bairro-detalhe {
    font-size: 0.93em;
    color: #bdbdbd;
    margin-bottom: 2px;
    display: block;
}
#resultados-bairros .bairro-coord {
    font-size: 0.85em;
    color: #888;
    display: block;
}
@media (max-width: 600px) {
    #resultados-bairros {
        max-width: 98vw;
        font-size: 0.98em;
        left: 0;
        right: 0;
    }
}

@media (max-width: 900px) {
    .products-grid.grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    .products-grid.grid-9 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 600px) {
    .products-grid,
    .products-grid.grid-4,
    .products-grid.grid-9,
    .products-grid.list,
    .products-grid.detail {
        grid-template-columns: 1fr;
    }
    .container {
        padding: 0 4px;
    }
}

@media (max-width: 700px) {
    #main-search-form {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    .search-bar {
        max-width: 98vw;
    }
}

/* ...existing code... */
#bairro-search-form {
    display: flex;
    gap: 20px !important;
    width: 100%;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 18px;
    margin-bottom: 8px;
}

#bairro-search-form .autocomplete-group {
    min-width: 180px;
    max-width: 260px;
    margin-right: 20px !important;
}
#bairro-search-form .autocomplete-group:first-of-type {
    min-width: 120px;
    max-width: 180px;
}
#bairro-search-form .autocomplete-group:last-of-type {
    margin-right: 20px !important;
}

#btn-buscar-bairro {
    margin-left: 1px !important;
}
#btn-localizar-me {
    margin-left: 1px !important;
}


/* MOBILE: keep cidade + bairro side-by-side where possible to avoid a tall header */
@media only screen and (max-width: 700px),
       only screen and (max-device-width: 700px),
       only screen and (pointer:coarse) {
    /* layout: two columns for inputs, buttons occupy a compact row below */
    #bairro-search-form {
        flex-direction: row;
        gap: 12px !important; /* more breathing room between columns */
        align-items: center;
        justify-content: center;
        flex-wrap: wrap;
    }
    /* make first two autocomplete groups share the row */
    #bairro-search-form .autocomplete-group {
        flex: 0 0 48%;
        min-width: 140px;
        max-width: 48%;
        margin-right: 0 !important;
        padding-left: 10px; /* small internal padding to avoid visual overlap */
        padding-right: 6px;
    }
    /* ensure the very first and second items get the same sizing (defensive) */
    #bairro-search-form .autocomplete-group:nth-child(-n+2) {
        flex-basis: 48%;
    }
    /* put action buttons on their own row and keep them compact */
    #btn-buscar-bairro, #btn-localizar-me {
        flex: 0 0 40%;
        width: auto;
        margin-left: 0 !important;
        margin-top: 6px !important;
        padding: 8px 12px !important;
    }
}