/* ==================== BANDEJA DE CIDADE ==================== */
.city-tray {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--glass-bg);
    border-top: 1px solid var(--glass-border);
    backdrop-filter: blur(20px);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    max-height: 50vh;
    display: flex;
    flex-direction: column;
}

.city-tray-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--glass-border);
}

.city-tray-title h3 {
    font-size: 1.3rem;
    margin: 0 0 0.3rem 0;
    background: var(--gradient-text);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.city-tray-title p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    margin: 0;
}

.city-tray-close {
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.city-tray-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.city-tray-content {
    position: relative;
    display: flex;
    align-items: center;
    padding: 1rem 0;
    flex: 1;
    overflow: hidden;
}

.city-tray-carousel {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    padding: 0 4rem;
    flex: 1;
    cursor: grab;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.city-tray-carousel::-webkit-scrollbar {
    height: 6px;
}

.city-tray-carousel::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.city-tray-carousel:active {
    cursor: grabbing;
}

.city-tray-item {
    min-width: 200px;
    max-width: 200px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.city-tray-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border-color: #00d4ff;
}

.city-tray-item-image {
    width: 100%;
    height: 150px;
    overflow: hidden;
    position: relative;
}

.city-tray-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.city-tray-item-info {
    padding: 1rem;
}

.city-tray-item-info h4 {
    font-size: 0.95rem;
    margin: 0 0 0.5rem 0;
    color: white;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.city-tray-item-price {
    color: #00d4ff;
    font-weight: bold;
    font-size: 1rem;
    margin: 0;
}

.city-tray-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 45px;
    height: 45px;
    border: none;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
    backdrop-filter: blur(10px);
}

.city-tray-nav:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: translateY(-50%) scale(1.1);
}

.city-tray-nav-prev {
    left: 0.5rem;
}

.city-tray-nav-next {
    right: 0.5rem;
}

.city-tray-loading {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1rem;
    border-top: 1px solid var(--glass-border);
}

.loading-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: #00d4ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.city-tray-loading p {
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
    font-size: 0.9rem;
}

/* ==================== OVERLAY DA BANDEJA DE DETALHES ==================== */
.property-tray-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: all;
}

/* ==================== BANDEJA DE DETALHES DO IMÓVEL ==================== */
.property-tray {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--glass-bg);
    border-top: 1px solid var(--glass-border);
    backdrop-filter: blur(20px);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
    z-index: 1001;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    max-height: 80vh;
    overflow-y: auto;
    pointer-events: all;
}

.property-tray-header {
    display: flex;
    justify-content: flex-end;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--glass-border);
}

.property-tray-close {
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.property-tray-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.property-tray-content {
    padding: 2rem;
}

.property-tray-main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.property-tray-gallery {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.property-tray-main-image-wrapper {
    position: relative;
    width: 100%;
}

.property-tray-main-image {
    position: relative;
    width: 100%;
    height: 400px;
    border-radius: 15px;
    overflow: hidden;
    cursor: grab;
    user-select: none;
}

.property-tray-main-image:active {
    cursor: grabbing;
}

.property-tray-main-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s ease;
}

.property-tray-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 45px;
    height: 45px;
    border: none;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
    opacity: 0;
}

.property-tray-main-image:hover .property-tray-nav {
    opacity: 1;
}

.property-tray-nav:hover {
    background: rgba(0, 212, 255, 0.8);
    transform: translateY(-50%) scale(1.1);
}

.property-tray-nav-prev {
    left: 15px;
}

.property-tray-nav-next {
    right: 15px;
}

.property-tray-counter {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
}

.property-tray-thumbnails {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding: 0.5rem 0;
}

.property-tray-thumbnails img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.property-tray-thumbnails img:hover,
.property-tray-thumbnails img.active {
    border-color: #00d4ff;
    transform: scale(1.1);
}

.property-tray-info h2 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    background: var(--gradient-text);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.property-tray-price {
    font-size: 1.5rem;
    font-weight: bold;
    color: #00d4ff;
    margin-bottom: 1rem;
}

.property-tray-description {
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
    margin-bottom: 1rem;
    max-height: 200px;
    overflow-y: auto;
}

.property-tray-address,
.property-tray-city {
    color: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.property-tray-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.property-tray-btn {
    flex: 1;
    padding: 1rem 1.5rem;
    border: none;
    border-radius: 10px;
    color: white;
    text-decoration: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.property-tray-btn-whatsapp {
    background: linear-gradient(135deg, #128C7E, #075e54);
}

.property-tray-btn-facebook {
    background: linear-gradient(135deg, #1877f2, #0d47a1);
}

.property-tray-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* ==================== RESPONSIVIDADE DO BADGE DO MAPA ==================== */
/* Tablet e Mobile: layout empilhado com scroll */
@media (max-width: 1023px) {
    .property-tray {
        max-height: 90vh;
    }
    
    .property-tray-content {
        padding: 1rem;
    }
    
    .property-tray-main {
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .property-tray-main-image {
        height: 50vh;
        min-height: 300px;
        max-height: 500px;
    }
    
    .property-tray-nav {
        opacity: 1;
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .property-tray-nav-prev {
        left: 10px;
    }
    
    .property-tray-nav-next {
        right: 10px;
    }
    
    .property-tray-info h2 {
        font-size: 1.3rem;
    }
    
    .property-tray-actions {
        flex-direction: column;
    }
    
    .property-tray-btn {
        width: 100%;
    }
}

/* Responsivo Mobile */
@media (max-width: 768px) {
    .city-tray {
        max-height: 85vh;
    }
    
    /* Cards quase fullwidth para ocupar melhor a tela pequena */
    .city-tray-item {
        min-width: calc(100vw - 6rem);
        max-width: calc(100vw - 6rem);
    }
    
    .city-tray-item-image {
        height: clamp(200px, 40vh, 320px);
    }
    
    /* Botao X maior para touch (WCAG 2.5.5) */
    .city-tray-close {
        width: 48px;
        height: 48px;
        font-size: 1.3rem;
        z-index: 10;
    }
    
    .city-tray-carousel {
        padding: 0 3rem;
        scroll-snap-type: x mandatory;
    }
    
    .city-tray-item {
        scroll-snap-align: center;
    }
    
    .property-tray {
        max-height: 95vh;
    }
    
    .property-tray-main-image {
        height: 40vh;
        min-height: 250px;
    }
    
    .property-tray-thumbnails {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap;
        scroll-snap-type: x mandatory;
        overscroll-behavior-x: contain;
        padding-bottom: 0.5rem;
    }
    
    .property-tray-thumbnails img {
        width: 60px;
        height: 60px;
        flex-shrink: 0;
        scroll-snap-align: start;
    }

    .property-tray-content {
        padding: 1rem 1rem calc(1rem + env(safe-area-inset-bottom, 0px));
    }
    
    .property-tray-description {
        font-size: 0.9rem;
        line-height: 1.6;
        max-height: none;
    }
}

/* Mobile muito pequeno */
@media (max-width: 480px) {
    .city-tray-item {
        min-width: calc(100vw - 4rem);
        max-width: calc(100vw - 4rem);
    }
    
    .city-tray-carousel {
        padding: 0 2rem;
    }
}

