/* ============================================
   LOCATION SEARCH - Estilos
   ============================================ */

.location-search-container {
    max-width: 100%;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Formulário de busca */
.search-form {
    margin-bottom: 30px;
}

.search-input-group {
    position: relative;
}

.location-input {
    width: 100%;
    padding: 16px 50px 16px 20px;
    font-size: 16px;
    border: 2px solid #00733F;
    border-radius: 8px;
    transition: all 0.3s;
    box-sizing: border-box;
}

.location-input:focus {
    outline: none;
    border-color: #00733F;
    box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.2);
}

.location-input::placeholder {
    color: #999;
}

.search-icon {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    color: #999;
    pointer-events: none;
    width: 20px;
    height: 20px;
}

.clear-button {
    position: absolute;
    right: 55px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    width: 24px;
    height: 24px;
    padding: 0 0 5px 0;
    line-height: 24px;
    transition: color 0.2s;
    z-index: 10;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    justify-items: center;
}

.clear-button:hover {
    color: white;
}

/* Dropdown de sugestões */
.suggestions-dropdown {
    position: absolute;
    /* top: calc(100% + 5px); */
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
}

.suggestion-item {
    padding: 14px 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s;
}

.suggestion-item:first-child {
    border-radius: 8px 8px 0 0;
}

.suggestion-item:last-child {
    border-bottom: none;
    border-radius: 0 0 8px 8px;
}

.suggestion-item:hover,
.suggestion-item.active {
    background-color: #dce9e3;
}

.suggestion-item.no-results {
    cursor: default;
    color: #999;
    font-style: italic;
}

.suggestion-item.no-results:hover {
    background-color: white;
}

.use-location-item {
    background-color: #e9f5f0;
    color: #00733F;
    font-weight: 600;
    border-bottom: 2px solid rgba(0,0,0,0.1);
}

.use-location-item:hover,
.use-location-item.active {
    background-color: #dce9e3;
}

.ic-current-location {
    width: 20px;
    height: 20px;
}

.location-icon,
.address-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.suggestion-item span {
    flex: 1;
    font-size: 15px;
}

/* Lista de unidades */
.units-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.unit-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s;
    cursor: pointer;
}

.unit-card:hover {
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    transform: translateY(-4px);
}

.unit-thumbnail {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #f5f5f5;
}

.unit-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.unit-card:hover .unit-thumbnail img {
    transform: scale(1.05);
}

.unit-info {
    padding: 20px;
}

.unit-name {
    font-size: 20px;
    font-weight: 700;
    color: #00733F;
    margin: 0 0 8px 0;
    line-height: 1.3;
}

.unit-address {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
    margin: 0 !important;
}

/* Mensagens */
.error-message,
.no-results {
    text-align: center;
    padding: 40px 20px;
    font-size: 16px;
    color: #666;
}

.error-message {
    background-color: #fef2f2;
    color: #dc2626;
    border-radius: 8px;
    border-left: 4px solid #dc2626;
}

/* Loading spinner */
.loading-spinner {
    text-align: center;
    padding: 60px 20px;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #00733F;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-spinner p {
    color: #666;
    font-size: 16px;
    margin: 0;
}

/* Responsividade */
@media (max-width: 1024px) {
    .units-list {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .units-list {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 16px;
    }
    
    .location-input {
        font-size: 16px;
        padding: 14px 50px 14px 16px;
    }
    
    .unit-thumbnail {
        height: 180px;
    }
    
    .unit-info {
        padding: 16px;
    }
    
    .unit-name {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .units-list {
        grid-template-columns: 1fr;
    }
    
    .suggestion-item {
        padding: 12px 16px;
    }
    
    .suggestion-item span {
        font-size: 14px;
    }
}

.distance-tag {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgb(0, 115, 63, 0.9);
    color: #fff;
    padding: 0px 6px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 800;
    /* text-transform: uppercase; */
    /* box-shadow: 0 2px 8px rgba(0,0,0,0.3); */
    display: inline-flex;
    align-items: center;
    gap: 4px;
    z-index: 10;
    backdrop-filter: blur(4px);
}