/**
 * Residence Units CSS
 * Blue Apulia Child Theme
 * 
 * Stili per la sezione unità Residence nella pagina singola
 * Basato su bb-rooms.css con personalizzazioni specifiche
 */

/* =============================================================================
   SEZIONE PRINCIPALE RESIDENCE
   ============================================================================= */

.residence-units-section {
    margin: 2rem 0;
    padding: 0;
}

/* =============================================================================
   SERVIZI COMUNI DEL RESIDENCE
   ============================================================================= */

.residence-shared-services {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    border-left: 4px solid #3f8bc9;
}

.residence-shared-services h3 {
    margin: 0 0 1rem 0;
    font-size: 1.25rem;
    color: #2c3e50;
}

.shared-services-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.shared-service-tag {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    background: white;
    color: #3f8bc9;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid #3f8bc9;
}

/* =============================================================================
   SEZIONE BOOKING
   ============================================================================= */

.residence-booking-section {
    margin-top: 2rem;
}

.residence-booking-section h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 1.5rem;
    text-align: center;
}

/* Info ricerca */
.residence-search-info {
    background: #e7f3ff;
    border: 1px solid #3f8bc9;
    border-radius: 8px;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.residence-search-info p {
    margin: 0;
    color: #2c3e50;
}

/* =============================================================================
   COMBINAZIONE SUGGERITA
   ============================================================================= */

.residence-combination-section {
    margin-bottom: 2rem;
}

.residence-combination-section h3 {
    font-size: 1.25rem;
    color: #2c3e50;
    margin-bottom: 1rem;
}

.residence-combination-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.residence-combination-card:hover {
    border-color: #3f8bc9;
    box-shadow: 0 4px 12px rgba(63, 139, 201, 0.15);
}

.residence-combination-card.selected {
    border-color: #2d8a4e;
    background: linear-gradient(135deg, #f0fff4 0%, #e6ffed 100%);
    box-shadow: 0 4px 12px rgba(45, 138, 78, 0.15);
}

/* Header combinazione */
.combination-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.combination-check {
    flex-shrink: 0;
}

.combination-check input[type="radio"] {
    display: none;
}

.combination-check label {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 2px solid #3f8bc9;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
}

.combination-check input[type="radio"]:checked + label {
    background: #2d8a4e;
    border-color: #2d8a4e;
}

.combination-check .checkmark {
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.2s;
}

.combination-check input[type="radio"]:checked + label .checkmark {
    opacity: 1;
}

.combination-info {
    flex: 1;
    display: flex;
    gap: 1rem;
    align-items: center;
}

.combination-units-count {
    background: #3f8bc9;
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.combination-capacity {
    color: #666;
    font-size: 0.95rem;
}

.combination-price {
    text-align: right;
}

.combination-price .price-amount {
    display: block;
    font-size: 1.75rem;
    font-weight: 700;
    color: #2d8a4e;
}

.combination-price .price-label {
    font-size: 0.85rem;
    color: #666;
}

/* Preview unità nella combinazione */
.combination-units-preview {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    padding-top: 1rem;
    border-top: 1px solid #e0e0e0;
}

.combination-unit-preview {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    background: white;
    border-radius: 8px;
    flex: 1;
    min-width: 200px;
}

.combination-unit-preview img {
    width: 60px;
    height: 45px;
    object-fit: cover;
    border-radius: 6px;
}

.unit-preview-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.unit-preview-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: #333;
}

.unit-preview-details {
    font-size: 0.8rem;
    color: #666;
}

/* =============================================================================
   DIVISORE
   ============================================================================= */

.residence-divider {
    text-align: center;
    margin: 2rem 0;
    position: relative;
}

.residence-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e0e0e0;
}

.residence-divider span {
    position: relative;
    background: #fff;
    padding: 0 1.5rem;
    color: #888;
    font-style: italic;
    font-size: 0.95rem;
}

/* =============================================================================
   SELEZIONE MANUALE
   ============================================================================= */

.residence-manual-selection {
    margin-top: 1.5rem;
}

.manual-selection-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.manual-selection-header input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: #3f8bc9;
}

.manual-selection-header label {
    font-weight: 500;
    color: #333;
    cursor: pointer;
}

/* =============================================================================
   LISTA UNITÀ - LAYOUT ORIZZONTALE (come B&B)
   ============================================================================= */

.residence-units-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Card Unità - Layout Orizzontale */
.residence-unit-card {
    display: flex;
    flex-direction: row;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    min-height: 260px;
}

.residence-unit-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    border-color: #3f8bc9;
}

.residence-unit-card.unit-unavailable {
    opacity: 0.6;
    pointer-events: none;
}

/* COLONNA SINISTRA: Galleria */
.unit-gallery-column {
    flex: 0 0 auto;
    width: 360px;
    height: 260px;
    position: relative;
    background: #f5f5f5;
}

.unit-gallery-slider {
    width: 100%;
    height: 100%;
}

.unit-gallery-slider .swiper-slide {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.unit-gallery-slider img,
.unit-single-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.unit-gallery-slider .swiper-button-next,
.unit-gallery-slider .swiper-button-prev {
    color: #fff;
    background: rgba(0,0,0,0.5);
    width: 36px;
    height: 36px;
    border-radius: 50%;
}

.unit-gallery-slider .swiper-button-next:after,
.unit-gallery-slider .swiper-button-prev:after {
    font-size: 16px;
}

.unit-gallery-slider .swiper-pagination {
    bottom: 8px;
}

.unit-gallery-slider .swiper-pagination-bullet {
    background: #fff;
    opacity: 0.7;
}

.unit-gallery-slider .swiper-pagination-bullet-active {
    opacity: 1;
    background: #3f8bc9;
}

/* Placeholder senza foto */
.unit-no-image {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.unit-no-image span {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.unit-no-image p {
    font-size: 0.9rem;
    margin: 0;
    opacity: 0.9;
}

/* Overlay non disponibile */
.unit-unavailable-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
}

.unit-unavailable-overlay span {
    background: #dc3545;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-weight: 600;
}

/* COLONNA DESTRA: Informazioni */
.unit-info-column {
    flex: 1;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    height: 260px;
    overflow-y: auto;
}

/* Header con checkbox */
.unit-header {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.unit-checkbox {
    flex-shrink: 0;
    margin-top: 2px;
}

.unit-checkbox input[type="checkbox"] {
    display: none;
}

.unit-checkbox label {
    display: block;
    cursor: pointer;
}

.unit-checkbox .checkbox-custom {
    display: block;
    width: 24px;
    height: 24px;
    border: 2px solid #3f8bc9;
    border-radius: 4px;
    background: white;
    position: relative;
    transition: all 0.2s;
}

.unit-checkbox input[type="checkbox"]:checked + label .checkbox-custom {
    background: #2d8a4e;
    border-color: #2d8a4e;
}

.unit-checkbox input[type="checkbox"]:checked + label .checkbox-custom::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 14px;
    font-weight: bold;
}

.unit-title {
    flex: 1;
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
    color: #222;
    line-height: 1.3;
}

.unit-description {
    color: #666;
    margin: 0;
    line-height: 1.5;
    font-size: 0.9rem;
}

/* Dettagli Unità */
.unit-details {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.unit-detail-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.9rem;
    color: #444;
}

.unit-detail-item .icon {
    font-size: 1rem;
}

/* Prezzo */
.unit-pricing {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid #eee;
}

.unit-price-main {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
}

.unit-price-main .price-amount {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2d8a4e;
}

.unit-price-main .price-period {
    font-size: 0.85rem;
    color: #666;
}

.unit-details-link {
    color: #3f8bc9;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s;
}

.unit-details-link:hover {
    color: #2d6fa3;
    text-decoration: underline;
}

/* =============================================================================
   RIEPILOGO E PRENOTAZIONE
   ============================================================================= */

.residence-booking-summary {
    position: sticky;
    bottom: 0;
    background: white;
    border-top: 1px solid #e0e0e0;
    padding: 1.5rem;
    margin-top: 2rem;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    border-radius: 12px 12px 0 0;
}

.booking-summary-content {
    max-width: 800px;
    margin: 0 auto;
}

.summary-selection h4 {
    margin: 0 0 0.75rem 0;
    font-size: 1rem;
    color: #333;
}

.summary-units {
    margin-bottom: 1rem;
}

.summary-placeholder {
    color: #888;
    font-style: italic;
    margin: 0;
}

.summary-unit-item {
    display: flex;
    justify-content: space-between;
    padding: 0.4rem 0;
    border-bottom: 1px solid #eee;
}

.summary-totals {
    margin-bottom: 1rem;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 0.4rem 0;
    font-size: 0.95rem;
}

.summary-row .label {
    color: #666;
}

.summary-row .value {
    font-weight: 600;
    color: #333;
}

.summary-row.summary-price {
    padding-top: 0.75rem;
    border-top: 2px solid #3f8bc9;
    font-size: 1.1rem;
}

.summary-row.summary-price .value {
    font-size: 1.5rem;
    color: #2d8a4e;
}

/* Warning capienza */
.summary-warning {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.summary-warning .warning-icon {
    font-size: 1.25rem;
}

.summary-warning .warning-text {
    color: #856404;
    font-size: 0.9rem;
}

/* Bottone Prenota */
.btn-prenota-residence {
    width: 100%;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #2d8a4e 0%, #238b45 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-prenota-residence:hover:not(:disabled) {
    background: linear-gradient(135deg, #238b45 0%, #1e7a3d 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(45, 138, 78, 0.3);
}

.btn-prenota-residence:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* No units message */
.residence-no-units {
    text-align: center;
    padding: 3rem 2rem;
    background: #f8f9fa;
    border-radius: 12px;
}

.residence-no-units p {
    margin: 0;
    color: #666;
    font-size: 1.1rem;
}

/* =============================================================================
   RESPONSIVE
   ============================================================================= */

@media (max-width: 992px) {
    .residence-unit-card {
        flex-direction: column;
        min-height: auto;
    }
    
    .unit-gallery-column {
        width: 100%;
        height: 250px;
    }
    
    .unit-info-column {
        height: auto;
        padding: 1.25rem;
    }
    
    .combination-header {
        flex-wrap: wrap;
    }
    
    .combination-price {
        width: 100%;
        text-align: left;
        margin-top: 0.5rem;
    }
}

@media (max-width: 768px) {
    .residence-units-section {
        margin: 1rem 0;
    }
    
    .residence-booking-section h2 {
        font-size: 1.5rem;
    }
    
    .unit-gallery-column {
        height: 200px;
    }
    
    .unit-title {
        font-size: 1.1rem;
    }
    
    .unit-price-main .price-amount {
        font-size: 1.3rem;
    }
    
    .combination-units-preview {
        flex-direction: column;
    }
    
    .combination-unit-preview {
        min-width: 100%;
    }
    
    .residence-booking-summary {
        padding: 1rem;
    }
    
    .summary-row.summary-price .value {
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    .unit-gallery-column {
        height: 180px;
    }
    
    .unit-details {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .unit-pricing {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .shared-services-grid {
        gap: 0.4rem;
    }
    
    .shared-service-tag {
        font-size: 0.8rem;
        padding: 0.3rem 0.6rem;
    }
}
