/**
 * Public Styles for Colitalia Real Estate
 * Colore Ufficiale: #387857
 */

/* Property Grid */
.cre-property-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin: 30px 0;
}

.cre-property-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.cre-property-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.cre-property-image {
    position: relative;
    height: 220px;
    overflow: hidden;
}

.cre-property-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.cre-property-card:hover .cre-property-image img {
    transform: scale(1.05);
}

.cre-property-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: #387857; /* Colore Ufficiale */
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.cre-property-price {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 8px 15px;
    border-radius: 4px;
    font-size: 16px;
    font-weight: bold;
}

.cre-property-content {
    padding: 20px;
}

.cre-property-title {
    font-size: 20px;
    margin: 0 0 10px 0;
    line-height: 1.3;
}

.cre-property-title a {
    color: #387857; /* Colore Ufficiale */
    text-decoration: none;
}

.cre-property-location {
    color: #666;
    font-size: 14px;
    margin-bottom: 15px;
}

.cre-property-features {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.cre-feature {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    color: #666;
}

.cre-feature i {
    color: #387857; /* Colore Ufficiale */
}

.cre-property-excerpt {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
    margin-bottom: 15px;
}

.cre-property-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cre-btn-view {
    display: inline-block;
    background: #387857; /* Colore Ufficiale */
    color: white;
    padding: 10px 20px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.3s;
}

.cre-btn-view:hover {
    background: #2b5a41; /* Hover più scuro */
    color: white;
}

/* -------------------------------------------
   SINGLE PROPERTY - HEADER & GALLERY
   ------------------------------------------- */
.cre-single-property {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
}

.cre-property-header {
    margin-bottom: 30px;
    text-align: center;
    padding-bottom: 20px;
    border-bottom: 1px solid #eaeaea;
}

.cre-property-header h1 {
    font-size: 36px;
    font-weight: 700;
    color: #387857; /* Colore Ufficiale */
    margin: 0 0 10px 0;
}

.cre-property-address {
    color: #7f8c8d;
    font-size: 16px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
}

.cre-property-gallery {
    margin-bottom: 40px;
    max-width: 1000px; 
    margin-left: auto;
    margin-right: auto;
}

.cre-main-image-wrapper {
    position: relative;
    cursor: zoom-in;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1); 
}

.cre-main-image {
    width: 100%;
    height: 450px; 
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.cre-main-image-wrapper:hover .cre-main-image {
    transform: scale(1.03);
}

.cre-zoom-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(56, 120, 87, 0.8); /* Colore Ufficiale in trasparenza */
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.cre-zoom-icon .dashicons {
    font-size: 30px;
    width: 30px;
    height: 30px;
}

.cre-main-image-wrapper:hover .cre-zoom-icon {
    opacity: 1;
}

/* LIGHTBOX E FRECCE */
.cre-lightbox {
    display: none;
    position: fixed;
    z-index: 999999;
    padding-top: 50px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
}

.cre-lightbox-content {
    margin: auto;
    display: block;
    max-width: 85%;
    max-height: 85vh;
    object-fit: contain;
    animation: zoomIn 0.3s;
    border-radius: 4px;
}

@keyframes zoomIn {
    from {transform: scale(0.95); opacity: 0;} 
    to {transform: scale(1); opacity: 1;}
}

.cre-lightbox-close {
    position: absolute;
    top: 20px;
    right: 40px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
    z-index: 1000000;
}

.cre-lightbox-close:hover {
    color: #ccc;
}

/* Stile Frecce */
.cre-lightbox-prev,
.cre-lightbox-next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: 50px;
    height: 50px;
    line-height: 46px;
    text-align: center;
    margin-top: -25px;
    color: white;
    font-weight: bold;
    font-size: 28px;
    transition: 0.3s ease;
    user-select: none;
    background-color: rgba(0,0,0,0.5);
    border-radius: 50%;
    z-index: 1000000;
}

.cre-lightbox-prev {
    left: 30px;
}

.cre-lightbox-next {
    right: 30px;
}

.cre-lightbox-prev:hover,
.cre-lightbox-next:hover {
    background-color: #387857; /* Colore Ufficiale al passaggio */
    transform: scale(1.1);
}

/* Miniature sotto la foto principale */
.cre-thumbnail-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px; 
    margin-top: 15px;
}

.cre-thumbnail {
    height: 90px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    opacity: 0.6;
    transition: all 0.3s ease;
    width: 100%;
    box-shadow: 0 3px 8px rgba(0,0,0,0.1);
    border: 2px solid transparent;
}

.cre-thumbnail:hover,
.cre-thumbnail.active {
    opacity: 1;
    border: 2px solid #387857; /* Colore Ufficiale */
    transform: translateY(-2px); 
}
/* ------------------------------------------- */

/* Layout inferiore */
.cre-property-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
}

.cre-property-info h2 {
    font-size: 24px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #387857; /* Colore Ufficiale */
}

.cre-info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.cre-info-item {
    text-align: center;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
}

/* FIX PER LE ICONE SVG E DASHICONS */
.cre-info-item i,
.cre-info-item svg {
    font-size: 24px;
    width: 24px;
    height: 24px;
    color: #387857; /* Colore Ufficiale */
    fill: #387857; /* Per colorare l'SVG */
    margin-bottom: 10px;
    display: inline-block;
}

.cre-info-value {
    font-size: 24px;
    font-weight: bold;
    color: #387857; /* Colore Ufficiale */
}

.cre-info-label {
    font-size: 14px;
    color: #666;
    margin-top: 5px;
}

.cre-property-description {
    line-height: 1.8;
    color: #444;
    margin-bottom: 30px;
}

/* Booking Form */
.cre-booking-widget {
    background: #f9f9f9;
    padding: 30px;
    border-radius: 8px;
    position: sticky;
    top: 30px;
}

.cre-booking-widget h3 {
    margin: 0 0 20px 0;
    font-size: 20px;
}

.cre-price-display {
    text-align: center;
    padding: 20px;
    background: #387857; /* Colore Ufficiale */
    color: white;
    border-radius: 8px;
    margin-bottom: 20px;
}

.cre-price-display .price {
    font-size: 32px;
    font-weight: bold;
}

.cre-price-display .period {
    font-size: 14px;
    opacity: 0.8;
}

.cre-form-group {
    margin-bottom: 20px;
}

.cre-form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

.cre-form-group input,
.cre-form-group select,
.cre-form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.cre-form-group input:focus,
.cre-form-group select:focus,
.cre-form-group textarea:focus {
    outline: none;
    border-color: #387857; /* Colore Ufficiale */
}

/* STILE CAMPI TELEFONO */
.cre-phone-wrapper {
    display: flex;
    gap: 10px;
}

.cre-phone-prefix {
    width: 80px !important; 
    flex-shrink: 0;
    text-align: center;
}

.cre-phone-number {
    flex-grow: 1;
}

.cre-date-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.cre-services-list {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    background: white;
}

.cre-service-item {
    display: flex;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.cre-service-item:last-child {
    border-bottom: none;
}

.cre-service-item input[type="checkbox"] {
    width: auto;
    margin-right: 10px;
}

.cre-service-item label {
    flex: 1;
    margin: 0;
    font-weight: normal;
    cursor: pointer;
}

.cre-service-price {
    font-size: 12px;
    color: #666;
}

.cre-price-preview {
    background: white;
    padding: 15px;
    border-radius: 4px;
    margin: 20px 0;
    border: 2px solid #387857; /* Colore Ufficiale */
}

.cre-price-preview-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
}

.cre-price-preview-total {
    display: flex;
    justify-content: space-between;
    font-size: 18px;
    font-weight: bold;
    border-top: 2px solid #eee;
    padding-top: 10px;
    margin-top: 10px;
}

.cre-btn-submit {
    width: 100%;
    background: #387857; /* Colore Ufficiale */
    color: white;
    padding: 15px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.cre-btn-submit:hover {
    background: #2b5a41; /* Hover più scuro */
}

.cre-btn-submit:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Map */
.cre-property-map-container {
    margin: 30px 0;
}

.cre-property-map-container h2 {
    font-size: 24px;
    margin-bottom: 20px;
}

#cre-map {
    height: 400px;
    width: 100%;
    border-radius: 8px;
}

/* Contact Form */
.cre-contact-form {
    max-width: 600px;
    margin: 30px auto;
    padding: 30px;
    background: #f9f9f9;
    border-radius: 8px;
}

.cre-contact-form h3 {
    margin: 0 0 20px 0;
    text-align: center;
}

.cre-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.cre-form-message {
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    display: none;
}

.cre-form-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.cre-form-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Archive Filters */
.cre-archive-filters {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.cre-filters-form {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: end;
}

.cre-filter-group {
    flex: 1;
    min-width: 150px;
}

.cre-filter-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 14px;
    color: #666;
}

.cre-filter-group input,
.cre-filter-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* Loading State */
.cre-loading {
    position: relative;
    opacity: 0.6;
    pointer-events: none;
}

.cre-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #387857; /* Colore Ufficiale */
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* STILI DATEPICKER BLOCCATO */
.cre-date-blocked {
    opacity: 0.6;
    cursor: not-allowed !important;
}

.cre-date-blocked a,
.cre-date-blocked span {
    background: #f5f5f5 !important;
    color: #999 !important;
    text-decoration: line-through !important;
    pointer-events: none !important;
    border: 1px solid #eee !important;
}

#cre-check-in[readonly], 
#cre-check-out[readonly] {
    background-color: #fff !important;
    cursor: pointer;
}

/* Responsive */
@media (max-width: 768px) {
    .cre-property-layout {
        grid-template-columns: 1fr;
    }
    
    .cre-booking-widget {
        position: static;
    }
    
    .cre-info-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .cre-thumbnail-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .cre-form-row {
        grid-template-columns: 1fr;
    }
    
    .cre-filters-form {
        flex-direction: column;
    }
    
    .cre-filter-group {
        width: 100%;
    }
}