/* =====================================================
   PROPERTIES STYLES - Airbnb-like Design
   Portal Inmobiliario
   ===================================================== */

:root {
    /* Colors - Airbnb inspired */
    --color-primary: #FF385C;
    --color-primary-hover: #E61E4D;
    --color-secondary: #00A699;
    --color-text: #222222;
    --color-text-light: #717171;
    --color-text-lighter: #B0B0B0;
    --color-border: #DDDDDD;
    --color-border-light: #EBEBEB;
    --color-bg: #FFFFFF;
    --color-bg-light: #F7F7F7;
    --color-bg-hover: #F7F7F7;
    --color-success: #00A699;
    --color-warning: #FFB400;
    --color-danger: #C13515;
    
    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-2xl: 48px;
    
    /* Border radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 16px;
    --radius-xl: 30px;
    --radius-full: 9999px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 2px 4px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 8px 24px rgba(0, 0, 0, 0.16);
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 350ms ease;
}

/* Property Card */
.property-card {
    display: flex;
    flex-direction: column;
    background: transparent; /* Airbnb cards don't have bg color usually */
    border: none;
    cursor: pointer;
    text-decoration: none;
    color: var(--color-text-primary);
    position: relative;
    group-hover: none; /* Reset */
    transition: opacity 0.2s;
}

.property-card:hover {
    /* Airbnb doesn't elevate cards on hover usually, just image slider arrows appear */
    opacity: 1; 
}

/* Image Section */
.property-card-image-container {
    position: relative;
    width: 100%;
    aspect-ratio: 20/19; /* Airbnb classic ratio */
    border-radius: 30px;
    overflow: hidden;
    background: #f0f0f0;
    margin-bottom: 12px;
}

.property-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.property-location-title {
    font-size: 15px;
    font-weight: 600;
}

/* Badge */
.property-card-overlay-top {
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    pointer-events: none; /* Let clicks pass through to link */
}

.property-badge {
    background: rgba(255, 255, 255, 0.95);
    color: #222;
    padding: 4px 8px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    backdrop-filter: blur(4px);
}

.property-badge.destacado {
    background: rgba(255, 255, 255, 0.95);
    font-weight: 700;
}

/* Action Buttons (Heart) */
.card-action-btn {
    pointer-events: auto; /* Re-enable clicks */
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 2px;
    transition: transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto; /* Push to right if no badge */
}

.card-action-btn:hover {
    transform: scale(1.1);
}

.card-action-btn svg {
    fill: rgba(0, 0, 0, 0.5);
    stroke: white;
    stroke-width: 2px;
    transition: fill 0.2s, stroke 0.2s;
}

.property-card-favorite.active svg,
.card-action-btn.active svg {
    fill: #FF385C; /* Airbnb Red */
    stroke: #FF385C;
}

/* Content Section */
.property-card-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.property-card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    font-size: 15px;
    line-height: 19px;
    margin-bottom: 2px;
}

.property-location-title {
    font-weight: 600;
    color: var(--color-text-primary);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 80%;
}

.property-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 15px;
    color: var(--color-text-primary);
}

.property-rating i {
    font-size: 12px;
    color: #FFDE21;
}

.property-info-row {
    font-size: 13px;
    line-height: 19px;
    color: var(--color-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.text-gray {
    color: var(--color-text-secondary);
}

.property-price-row {
    display: flex;
    align-items: baseline;
    gap: 4px;
    margin-top: 6px;
    font-size: 15px;
    line-height: 19px;
    color: var(--color-text-primary);
}

.price-amount {
    font-weight: 600;
}

.price-period {
    font-weight: 400;
}

/* Loading Skeleton */
.property-card.loading .property-card-image-container,
.property-card.loading .property-card-content > div {
    background: linear-gradient(90deg, #f0f0f0 25%, #f8f8f8 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    color: transparent;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Property Grid */
.properties-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--spacing-xl);
    padding: var(--spacing-lg) 0;
}

@media (max-width: 768px) {
    .properties-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: var(--spacing-lg);
    }
}

@media (max-width: 480px) {
    .properties-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
}

/* Property Gallery */
.property-gallery {
    position: relative;
    width: 100%;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--color-bg-light);
}

.property-gallery-main {
    position: relative;
    width: 100%;
    padding-top: 66.66%; /* 3:2 aspect ratio */
    overflow: hidden;
}

.property-gallery-main img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity var(--transition-base);
    animation: fadeIn var(--transition-base) ease-out;
}

.property-gallery-thumbnails {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-sm);
    margin-top: var(--spacing-sm);
}

.property-gallery-thumbnail {
    position: relative;
    padding-top: 75%;
    overflow: hidden;
    border-radius: var(--radius-md);
    cursor: pointer;
    opacity: 0.7;
    transition: all var(--transition-base);
    border: 2px solid transparent;
}

.property-gallery-thumbnail:hover {
    opacity: 1;
    transform: scale(1.05);
    border-color: var(--color-primary);
}

.property-gallery-thumbnail.active {
    opacity: 1;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px var(--color-primary);
}

.property-gallery-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Property Filters */
.property-filters {
    background: var(--color-bg);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

.property-filters-section {
    margin-bottom: var(--spacing-lg);
}

.property-filters-section:last-child {
    margin-bottom: 0;
}

.property-filters-title {
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: var(--spacing-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: color var(--transition-base);
    padding: var(--spacing-sm) 0;
}

.property-filters-title:hover {
    color: var(--color-primary);
}

.property-filters-title i {
    transition: transform var(--transition-base);
    font-size: var(--font-size-sm);
}

.property-filters-title.active i {
    transform: rotate(180deg);
}

.property-filters-content {
    display: none;
}

.property-filters-content.active {
    display: block;
}

.property-filters-checkbox {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) 0;
    cursor: pointer;
}

.property-filters-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.property-filters-checkbox label {
    cursor: pointer;
    font-size: 14px;
    color: var(--color-text);
}

.property-filters-range {
    margin: var(--spacing-md) 0;
}

.property-filters-range input[type="range"] {
    width: 100%;
}

.property-filters-range-values {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: var(--color-text-light);
    margin-top: var(--spacing-sm);
}

/* Search Bar */
.search-bar {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xs);
    display: flex;
    align-items: center;
    box-shadow: var(--shadow-lg);
    transition: all var(--transition-base);
    max-width: 850px;
    margin: 0 auto;
}

.search-bar:hover {
    box-shadow: var(--shadow-xl);
    transform: translateY(-2px);
}

.search-bar-location,
.search-bar-type,
.search-bar-price {
    display: flex;
    align-items: center;
    padding: var(--spacing-sm) var(--spacing-md);
    flex: 1;
    min-width: 0;
}

.search-bar-location i {
    color: var(--color-text-light);
    margin-right: var(--spacing-sm);
    font-size: var(--font-size-sm);
}

.search-bar-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 0;
    font-size: var(--font-size-sm);
    background: transparent;
    color: var(--color-text);
    min-width: 0;
}

.search-bar-input::placeholder {
    color: var(--color-text-lighter);
}

.search-bar-select {
    border: none;
    outline: none;
    background: transparent;
    font-size: var(--font-size-sm);
    color: var(--color-text);
    cursor: pointer;
    width: 100%;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23717171' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right center;
    padding-right: var(--spacing-lg);
}

.search-bar-price {
    gap: var(--spacing-xs);
}

.search-bar-price-input {
    width: 80px;
    text-align: center;
}

.search-bar-price-separator {
    color: var(--color-text-light);
    font-size: var(--font-size-sm);
}

.search-bar-divider {
    width: 1px;
    height: 24px;
    background: var(--color-border);
    flex-shrink: 0;
}

.search-bar-button {
    background: var(--color-primary);
    color: var(--color-bg);
    border: none;
    border-radius: var(--radius-full);
    padding: var(--spacing-sm) var(--spacing-lg);
    font-weight: 600;
    font-size: var(--font-size-sm);
    cursor: pointer;
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    margin-left: var(--spacing-xs);
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
}

.search-bar-button:hover {
    background: var(--color-primary-hover);
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
}

.search-bar-button i {
    font-size: var(--font-size-sm);
}

@media (max-width: 768px) {
    .search-bar {
        flex-wrap: wrap;
        border-radius: var(--radius-lg);
    }
    
    .search-bar-location,
    .search-bar-type,
    .search-bar-price {
        flex: 1 1 100%;
        border-bottom: 1px solid var(--color-border-light);
        padding: var(--spacing-md);
    }
    
    .search-bar-location:last-of-type,
    .search-bar-type:last-of-type,
    .search-bar-price:last-of-type {
        border-bottom: none;
    }
    
    .search-bar-divider {
        display: none;
    }
    
    .search-bar-button {
        width: 100%;
        margin: var(--spacing-sm) var(--spacing-xs) var(--spacing-xs);
        justify-content: center;
    }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: var(--spacing-2xl) var(--spacing-lg);
    color: var(--color-text-light);
}

.empty-state-icon {
    font-size: 64px;
    margin-bottom: var(--spacing-lg);
    opacity: 0.5;
}

.empty-state-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: var(--spacing-sm);
}

.empty-state-text {
    font-size: 14px;
    color: var(--color-text-light);
}

/* Form Styles */
.property-consulta-form {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.form-group {
    display: flex;
    flex-direction: column;
}

.primary-btn-full {
    width: 100%;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.property-card {
    animation: fadeInUp var(--transition-base) ease-out;
}

.property-card:nth-child(1) { animation-delay: 0.05s; }
.property-card:nth-child(2) { animation-delay: 0.1s; }
.property-card:nth-child(3) { animation-delay: 0.15s; }
.property-card:nth-child(4) { animation-delay: 0.2s; }
.property-card:nth-child(5) { animation-delay: 0.25s; }
.property-card:nth-child(6) { animation-delay: 0.3s; }

/* Property Specs Grid */
.property-specs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: var(--spacing-lg);
    padding: var(--spacing-md) 0;
}

.property-spec-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    background: var(--color-bg-light);
    transition: all var(--transition-base);
}

.property-spec-item:hover {
    background: var(--color-bg-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.property-spec-icon {
    font-size: 24px;
    color: var(--color-primary);
    width: 32px;
    text-align: center;
}

.property-spec-content {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.property-spec-value {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--color-text);
}

.property-spec-label {
    font-size: var(--font-size-sm);
    color: var(--color-text-light);
}

/* Smooth hover animations */
.property-card-image,
.property-card-content {
    transition: all var(--transition-base);
}

.property-card:hover .property-card-image {
    transform: scale(1.02);
}

/* Loading states */
.property-card.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Stagger animation for grid */
.properties-grid > * {
    animation: fadeInUp var(--transition-base) ease-out both;
}

.properties-grid > *:nth-child(1) { animation-delay: 0.05s; }
.properties-grid > *:nth-child(2) { animation-delay: 0.1s; }
.properties-grid > *:nth-child(3) { animation-delay: 0.15s; }
.properties-grid > *:nth-child(4) { animation-delay: 0.2s; }
.properties-grid > *:nth-child(5) { animation-delay: 0.25s; }
.properties-grid > *:nth-child(6) { animation-delay: 0.3s; }
.properties-grid > *:nth-child(7) { animation-delay: 0.35s; }
.properties-grid > *:nth-child(8) { animation-delay: 0.4s; }

.property-card .property-card-favorite.active svg {
  fill: var(--color-primary);
  stroke: var(--color-primary);
}

.property-card .property-card-favorite {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.property-card .property-card-favorite:hover {
  transform: scale(1.06);
}
