/* ===== VARIABLES CSS ===== */
:root {
    --apimo-primary: #3a8dc4;
    --apimo-secondary: #2980b9;
    --apimo-white: #ffffff;
    --apimo-text-gray: #6c757d;
    --apimo-border-radius: 12px;
    --apimo-border-radius-sm: 8px;
    --apimo-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    --apimo-transition: all 0.3s ease;
}

/* ===== STYLES GÉNÉRAUX ===== */
.apimo-properties-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin-top: 20px;
}

.apimo-property-card {
    background: var(--apimo-white);
    border-radius: var(--apimo-border-radius);
    box-shadow: var(--apimo-shadow);
    overflow: hidden;
    transition: var(--apimo-transition);
    opacity: 0;
    transform: translateY(20px);
}

.apimo-property-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* ===== IMAGES DES PROPRIÉTÉS ===== */
.apimo-property-image {
    position: relative;
    height: 250px;
    overflow: hidden;
}

.apimo-property-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--apimo-transition);
}

.apimo-no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    background: #f8f9fa;
    color: #6c757d;
    font-size: 48px;
}

.apimo-property-type {
    position: absolute;
    top: 15px;
    left: 15px;
    background: var(--apimo-primary);
    color: var(--apimo-white);
    padding: 6px 12px;
    border-radius: var(--apimo-border-radius-sm);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

/* ===== CONTENU DES CARTES ===== */
.apimo-property-content {
    padding: 25px;
}

.apimo-property-price {
    margin-bottom: 15px;
}

.apimo-price-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--apimo-primary);
}

.apimo-price-currency {
    font-size: 18px;
    font-weight: 600;
    color: var(--apimo-text-gray);
    margin-left: 5px;
}

.apimo-property-title {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 15px 0;
    color: #333;
    line-height: 1.3;
}

.apimo-property-location {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--apimo-text-gray);
    margin-bottom: 20px;
    font-size: 14px;
}

.apimo-property-location svg {
    flex-shrink: 0;
}

.apimo-property-details {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
}

.apimo-detail-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--apimo-text-gray);
    font-size: 14px;
}

.apimo-detail-item svg {
    flex-shrink: 0;
}

/* ===== STYLES POUR LES BOUTONS D'ACTIONS ===== */
.apimo-property-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.apimo-view-property-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: var(--apimo-primary);
    color: var(--apimo-white);
    text-decoration: none;
    border-radius: var(--apimo-border-radius-sm);
    font-size: 14px;
    font-weight: 600;
    transition: var(--apimo-transition);
}

.apimo-view-property-btn:hover {
    background: #2980b9;
    transform: translateY(-1px);
    color: var(--apimo-white);
    text-decoration: none;
}

.apimo-view-property-btn svg {
    transition: var(--apimo-transition);
}

.apimo-view-property-btn:hover svg {
    transform: translateX(5px);
}

.apimo-more-info-btn-small {
    padding: 12px !important;
    min-width: 50px;
    justify-content: center !important;
    background: var(--apimo-text-gray) !important;
    flex-shrink: 0;
}

.apimo-more-info-btn-small span {
    display: none;
}

.apimo-more-info-btn-small:hover {
    background: #5a6268 !important;
}

/* ===== BOUTON UNIQUE - PLEINE LARGEUR ===== */
.apimo-view-property-btn-full {
    width: 100% !important;
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px !important;
    background: #3a8dc4 !important;
    color: white !important;
    text-decoration: none !important;
    border-radius: var(--apimo-border-radius-sm);
    font-size: 16px !important;
    font-weight: 600;
    transition: var(--apimo-transition);
    margin-top: 20px;
    border: none;
    cursor: pointer;
}

.apimo-view-property-btn-full:hover {
    background: #2980b9 !important;
    transform: translateY(-2px) !important;
    color: white !important;
    text-decoration: none !important;
    box-shadow: 0 4px 15px rgba(58, 141, 196, 0.3) !important;
}

.apimo-view-property-btn-full svg {
    transition: var(--apimo-transition);
    flex-shrink: 0;
}

.apimo-view-property-btn-full:hover svg {
    transform: translateX(8px) !important;
}

/* ===== STYLES POUR L'AFFICHAGE COMPLET D'UNE PROPRIÉTÉ ===== */
.apimo-property-full-details {
    background: var(--apimo-white);
    border-radius: var(--apimo-border-radius);
    box-shadow: var(--apimo-shadow);
    margin: 0 auto 30px auto;
    overflow: hidden;
    max-width: 1000px; /* Largeur maximale pour la page de détail */
}

/* ===== STYLES POUR LES BOUTONS DE PARTAGE ===== */
.apimo-share-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0 auto 30px auto;
    padding: 20px;
    background: var(--apimo-white);
    border-radius: var(--apimo-border-radius);
    box-shadow: var(--apimo-shadow);
    max-width: 1000px; /* Largeur maximale pour les boutons de partage */
}

.apimo-back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--apimo-primary);
    background: none;
    border: none;
    font-weight: 500;
    cursor: pointer;
    transition: var(--apimo-transition);
    font-size: 14px;
    text-decoration: none;
}

.apimo-back-link:hover {
    color: #2980b9;
    text-decoration: none;
}

.apimo-share-buttons {
    display: flex;
    gap: 10px;
}

.apimo-share-btn {
    padding: 8px 16px;
    border: none;
    border-radius: var(--apimo-border-radius-sm);
    cursor: pointer;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: var(--apimo-transition);
    font-size: 14px;
    background: none;
}

.apimo-share-facebook { 
    background: #1877f2; 
    color: var(--apimo-white); 
}

.apimo-share-linkedin { 
    background: #0077b5; 
    color: var(--apimo-white); 
}

.apimo-share-whatsapp { 
    background: #25d366; 
    color: var(--apimo-white); 
}

.apimo-share-copy { 
    background: var(--apimo-text-gray); 
    color: var(--apimo-white); 
}

/* ===== BOUTONS DE PARTAGE - HOVER BLEU FORCÉ ===== */
.apimo-share-facebook:hover { 
    background: #3a8dc4 !important;
    transform: translateY(-2px) !important;
}

.apimo-share-linkedin:hover { 
    background: #3a8dc4 !important;
    transform: translateY(-2px) !important;
}

.apimo-share-whatsapp:hover { 
    background: #3a8dc4 !important;
    transform: translateY(-2px) !important;
}

.apimo-share-copy:hover { 
    background: #3a8dc4 !important;
    transform: translateY(-2px) !important;
}

.apimo-share-btn:hover { 
    transform: translateY(-2px); 
    opacity: 0.9; 
}

/* ===== GALERIE D'IMAGES ===== */
.apimo-gallery {
    margin-bottom: 30px;
}

.apimo-gallery-main {
    position: relative;
    height: 550px;
    overflow: hidden;
    border-radius: var(--apimo-border-radius);
}

.apimo-gallery-main img {
    width: 100%;
    height: 100%!important;
    object-fit: cover;
    cursor: pointer;
}

.apimo-gallery-prev,
.apimo-gallery-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--apimo-transition);
}

.apimo-gallery-prev {
    left: 15px;
}

.apimo-gallery-next {
    right: 15px;
}

.apimo-gallery-prev:hover,
.apimo-gallery-next:hover {
    background: rgba(0, 0, 0, 0.9);
}

.apimo-gallery-counter {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 12px;
    border-radius: var(--apimo-border-radius-sm);
    font-size: 14px;
}

.apimo-gallery-fullscreen {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: var(--apimo-border-radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--apimo-transition);
}

.apimo-gallery-fullscreen:hover {
    background: rgba(0, 0, 0, 0.9);
}

.apimo-gallery-thumbs {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    overflow-x: auto;
    padding: 5px 0;
    height: 100px;
}

.apimo-thumb {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: var(--apimo-border-radius-sm);
    cursor: pointer;
    transition: var(--apimo-transition);
    opacity: 0.7;
}

.apimo-thumb:hover,
.apimo-thumb.active {
    opacity: 1;
    transform: scale(1.05);
}

/* ===== DÉTAILS DE LA PROPRIÉTÉ ===== */
.apimo-modal-info {
    padding: 30px;
}

.apimo-modal-header {
    margin-bottom: 30px;
}

.apimo-modal-header h2 {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 15px 0;
    color: #333;
}

.apimo-modal-price {
    margin-bottom: 20px;
}

.apimo-price-main {
    font-size: 32px;
    font-weight: 700;
    color: var(--apimo-primary);
}

.apimo-price-fees {
    display: block;
    font-size: 14px;
    color: var(--apimo-text-gray);
    margin-top: 5px;
}

.apimo-modal-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.apimo-feature-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: var(--apimo-border-radius-sm);
}

.apimo-feature-icon {
    font-size: 24px;
    min-width: 30px;
    text-align: center;
}

.apimo-energy-letter {
    background: var(--apimo-primary);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
}

.apimo-feature-text strong {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 2px;
}

.apimo-feature-text span {
    color: var(--apimo-text-gray);
    font-size: 14px;
}

.apimo-modal-description {
    margin-bottom: 30px;
}

.apimo-modal-description h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #333;
}

.apimo-modal-description p {
    line-height: 1.6;
    color: #555;
}

/* ===== CARTE ===== */
.apimo-property-map {
    margin-bottom: 30px;
}

.apimo-map-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.apimo-map-header h4 {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    color: #333;
}

.apimo-map-container {
    height: 300px;
    border-radius: var(--apimo-border-radius-sm);
    overflow: hidden;
    border: 1px solid #ddd;
}

/* ===== DÉTAILS SUPPLÉMENTAIRES ===== */
.apimo-modal-details h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #333;
}

.apimo-details-grid {
    display: grid;
    gap: 15px;
}

.apimo-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
}

.apimo-detail-row:last-child {
    border-bottom: none;
}

.apimo-detail-label {
    font-weight: 600;
    color: #333;
}

.apimo-detail-value {
    color: var(--apimo-text-gray);
}

/* ===== LIGHTBOX ===== */
.apimo-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--apimo-transition);
}

.apimo-lightbox.show {
    opacity: 1;
    visibility: visible;
}

.apimo-lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
}

.apimo-lightbox img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.apimo-lightbox-close {
    position: absolute;
    top: -50px;
    right: 0;
    background: none;
    border: none;
    color: white;
    font-size: 30px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.apimo-lightbox-prev,
.apimo-lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--apimo-transition);
}

.apimo-lightbox-prev {
    left: -80px;
}

.apimo-lightbox-next {
    right: -80px;
}

.apimo-lightbox-prev:hover,
.apimo-lightbox-next:hover {
    background: rgba(255, 255, 255, 0.3);
}

.apimo-lightbox-counter {
    position: absolute;
    bottom: -50px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 16px;
}

/* ===== LOADER ===== */
.apimo-loader {
    text-align: center;
    padding: 50px;
}

.apimo-loader-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--apimo-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== TOAST DE SUCCÈS ===== */
.apimo-copy-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #28a745;
    color: white;
    padding: 12px 20px;
    border-radius: 6px;
    font-weight: 500;
    z-index: 99999;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

/* ===== ÉTATS D'ERREUR ===== */
.apimo-error {
    text-align: center;
    padding: 40px;
    background: #f8d7da;
    color: #721c24;
    border-radius: var(--apimo-border-radius);
    margin: 20px 0;
}

.apimo-no-properties {
    text-align: center;
    padding: 40px;
    background: #fff3cd;
    color: #856404;
    border-radius: var(--apimo-border-radius);
    margin: 20px 0;
}

/* ===== UTILITAIRES ===== */
.apimo-no-scroll {
    overflow: hidden;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .apimo-properties-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .apimo-property-content {
        padding: 20px;
    }
    
    .apimo-view-property-btn-full {
        padding: 12px 16px !important;
        font-size: 14px !important;
    }
    
    .apimo-share-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
        padding: 15px;
    }
    
    .apimo-share-buttons {
        width: 100%;
        justify-content: space-between;
    }
    
    .apimo-share-btn {
        flex: 1;
        justify-content: center;
        font-size: 12px;
        padding: 8px 4px;
    }
    
    .apimo-modal-features {
        grid-template-columns: 1fr;
    }
    
    .apimo-gallery-main {
        height: 250px;
    }
    
    .apimo-modal-info {
        padding: 20px;
    }
    
    .apimo-lightbox-prev {
        left: 10px;
    }
    
    .apimo-lightbox-next {
        right: 10px;
    }
    
    .apimo-lightbox-close {
        top: 10px;
        right: 10px;
    }
    
    .apimo-lightbox-counter {
        bottom: 10px;
    }
}

@media (max-width: 480px) {
    .apimo-view-property-btn-full {
        padding: 10px 15px !important;
        font-size: 13px !important;
    }
    
    .apimo-share-header {
        padding: 15px;
    }
    
    .apimo-share-btn {
        padding: 6px 8px;
        font-size: 11px;
    }
    
    .apimo-share-btn svg {
        width: 14px;
        height: 14px;
    }
    
    .apimo-copy-toast {
        right: 10px;
        top: 10px;
        padding: 10px 15px;
        font-size: 14px;
    }
    
    .apimo-modal-header h2 {
        font-size: 24px;
    }
    
    .apimo-price-main {
        font-size: 28px;
    }
    
    .apimo-feature-item {
        padding: 12px;
    }
    
    .apimo-detail-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}