﻿/* ========================================
       VARIABLES CSS & BASE RESET
    ======================================== */
:root {
    --primary-color: #4a5568;
    --secondary-color: #22c55e;
    --accent-color: #1EC6B6;
    --danger-color: #ef4444;
    --text-primary: #2d3748;
    --text-secondary: #718096;
    --text-muted: #7A838B;
    --border-color: #e2e8f0;
    --bg-light: #f8fafc;
    --bg-white: #ffffff;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-md: 0 5px 20px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.15);
    --radius-sm: 8px;
    --radius-md: 15px;
    --radius-lg: 20px;
    --transition: all 0.3s ease;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Support prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========================================
       BOUTON RETOUR RESPONSIVE
    ======================================== */
.btn-back {
    background-color: var(--bg-light);
    color: var(--primary-color);
    border: 1px solid var(--border-color);
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    touch-action: manipulation;
    min-height: 44px; /* Accessibilité tactile */
}

    .btn-back:hover,
    .btn-back:focus {
        background-color: #edf2f7;
        border-color: #cbd5e0;
        color: var(--text-primary);
        transform: translateX(-2px);
        text-decoration: none;
        outline: 2px solid var(--accent-color);
        outline-offset: 2px;
    }

/* ========================================
       SECTION PRINCIPALE
    ======================================== */
.property-details-section {
    padding: 40px 0;
    background: var(--bg-light);
    min-height: 100vh;
}

/* ========================================
       HEADER DE LA PROPRIÉTÉ
    ======================================== */
.property-header {
    background: var(--bg-white);
    padding: 30px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    margin-bottom: 30px;
    animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.property-title {
    font-size: clamp(1.5rem, 4vw, 2.2rem);
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 15px;
    line-height: 1.3;
    word-wrap: break-word;
}

.property-location {
    display: flex;
    align-items: center;
    color: var(--text-secondary);
    font-size: clamp(0.95rem, 2vw, 1.1rem);
    margin-bottom: 20px;
    flex-wrap: wrap;
}

    .property-location i {
        margin-right: 8px;
        flex-shrink: 0;
    }

.property-badges {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.badge {
    background: var(--primary-color);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: clamp(12px, 2vw, 14px);
    font-weight: 500;
    white-space: nowrap;
    transition: var(--transition);
}

    .badge:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow-sm);
    }

/* ========================================
       AFFICHAGE DU PRIX
    ======================================== */
.price-display {
    background: var(--primary-color);
    color: white;
    padding: 20px;
    border-radius: var(--radius-md);
    text-align: center;
    margin-bottom: 20px;
}

.price-amount {
    font-size: clamp(1.8rem, 5vw, 2.5rem);
    font-weight: bold;
    margin-bottom: 5px;
    word-wrap: break-word;
}

.price-period {
    font-size: clamp(0.95rem, 2vw, 1.1rem);
    opacity: 0.9;
}

/* ========================================
       GALERIE D'IMAGES RESPONSIVE
    ======================================== */
.property-images {
    background: var(--bg-white);
    padding: 30px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    margin-bottom: 30px;
}

.main-image {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    transition: var(--transition);
    cursor: zoom-in;
}

    .main-image:hover {
        transform: scale(1.02);
    }

.thumbnail-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 15px;
}

.thumbnail {
    width: 100%;
    height: 80px;
    object-fit: cover;
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition);
    border: 3px solid transparent;
}

    .thumbnail:hover,
    .thumbnail:focus {
        transform: scale(1.05);
        border-color: var(--primary-color);
        outline: 2px solid var(--accent-color);
        outline-offset: 2px;
    }

    .thumbnail.active {
        border-color: var(--primary-color);
    }

/* ========================================
       INFORMATIONS DE LA PROPRIÉTÉ
    ======================================== */
.property-info {
    background: var(--bg-white);
    padding: 30px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    margin-bottom: 30px;
}

.info-section {
    margin-bottom: 30px;
}

    .info-section:last-child {
        margin-bottom: 0;
    }

.section-title {
    font-size: clamp(1.2rem, 3vw, 1.5rem);
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

    .section-title i {
        margin-right: 10px;
        color: var(--primary-color);
        flex-shrink: 0;
    }

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.info-item {
    display: flex;
    align-items: flex-start;
    padding: 15px;
    background: var(--bg-light);
    border-radius: 10px;
    border-left: 4px solid var(--primary-color);
    transition: var(--transition);
}

    .info-item:hover {
        transform: translateX(5px);
        box-shadow: var(--shadow-sm);
    }

    .info-item i {
        font-size: 1.2rem;
        color: var(--primary-color);
        margin-right: 15px;
        width: 20px;
        text-align: center;
        flex-shrink: 0;
        margin-top: 2px;
    }

.info-content {
    flex: 1;
    min-width: 0;
}

.info-label {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 0.9rem;
    margin-bottom: 2px;
}

.info-value {
    color: var(--text-primary);
    font-size: 1rem;
    word-wrap: break-word;
}

/* ========================================
       GRILLE DES ÉQUIPEMENTS
    ======================================== */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
}

.feature-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    background: var(--bg-light);
    border-radius: 10px;
    color: var(--primary-color);
    font-size: clamp(13px, 2vw, 14px);
    transition: var(--transition);
}

    .feature-item:hover {
        background: var(--primary-color);
        color: white;
        transform: translateY(-2px);
    }

    .feature-item i {
        margin-right: 10px;
        width: 20px;
        text-align: center;
        flex-shrink: 0;
    }

/* ========================================
       CARTE DE RÉSERVATION (STICKY)
    ======================================== */
.booking-card {
    position: sticky;
    top: 20px;
    background: var(--bg-white);
    padding: 30px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    z-index: 10;
}

.btn-book {
    width: 100%;
    background: var(--secondary-color);
    border: none;
    padding: 15px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 16px;
    color: white;
    cursor: pointer;
    transition: var(--transition);
    min-height: 50px;
    touch-action: manipulation;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

    .btn-book:hover,
    .btn-book:focus {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(34, 197, 94, 0.4);
        outline: 2px solid var(--secondary-color);
        outline-offset: 2px;
    }

    .btn-book:active {
        transform: translateY(0);
    }

/* ========================================
       BADGES SPÉCIAUX
    ======================================== */
.negotiable-badge {
    background: var(--secondary-color);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: clamp(0.75rem, 1.5vw, 0.9rem);
    margin-left: 8px;
    display: inline-block;
}

.new-listing-badge {
    background: var(--danger-color);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: clamp(0.7rem, 1.5vw, 0.8rem);
    margin-left: 10px;
}

/* ========================================
       DESCRIPTION
    ======================================== */
.description-content {
    line-height: 1.8;
    color: var(--text-muted);
    font-size: clamp(14px, 2vw, 16px);
}

    .description-content p {
        margin-bottom: 15px;
    }

/* ========================================
       CATÉGORIES D'ÉQUIPEMENTS
    ======================================== */
.amenity-category {
    margin-bottom: 25px;
}

    .amenity-category h6 {
        color: var(--primary-color);
        font-weight: 600;
        margin-bottom: 15px;
        font-size: clamp(1rem, 2vw, 1.1rem);
    }

/* ========================================
       RESPONSIVE BREAKPOINTS
    ======================================== */

/* 280px - 320px : Très petits smartphones */
@media (max-width: 320px) {
    :root {
        font-size: 14px;
    }

    .property-header,
    .property-images,
    .property-info,
    .booking-card {
        padding: 15px;
    }

    .property-title {
        font-size: 1.3rem;
    }

    .main-image {
        height: 200px;
    }

    .thumbnail {
        height: 60px;
    }

    .thumbnail-gallery {
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
        gap: 8px;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .badge {
        padding: 6px 12px;
        font-size: 11px;
    }

    .btn-back {
        padding: 8px 12px;
        font-size: 12px;
    }

    .property-badges {
        gap: 6px;
    }
}

/* 321px - 374px : Petits smartphones */
@media (min-width: 321px) and (max-width: 374px) {
    .property-header,
    .property-images,
    .property-info,
    .booking-card {
        padding: 18px;
    }

    .main-image {
        height: 220px;
    }

    .thumbnail-gallery {
        grid-template-columns: repeat(auto-fill, minmax(75px, 1fr));
        gap: 10px;
    }
}

/* 375px - 413px : Smartphones standards */
@media (min-width: 375px) and (max-width: 413px) {
    .property-header,
    .property-images,
    .property-info,
    .booking-card {
        padding: 20px;
    }

    .main-image {
        height: 250px;
    }

    .thumbnail-gallery {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }
}

/* 414px - 599px : Smartphones moyens à grands */
@media (min-width: 414px) and (max-width: 599px) {
    .main-image {
        height: 280px;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .features-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
}

/* 568px - 667px landscape : Mode paysage smartphones */
@media (min-width: 568px) and (max-width: 667px) and (orientation: landscape) {
    .main-image {
        height: 250px;
    }

    .property-details-section {
        padding: 20px 0;
    }

    .booking-card {
        position: relative;
        top: 0;
    }
}

/* 600px - 767px : Petites tablettes */
@media (min-width: 600px) and (max-width: 767px) {
    .main-image {
        height: 320px;
    }

    .info-grid {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    }

    .features-grid {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    }

    .thumbnail-gallery {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    }
}

/* 768px - 1023px : Tablettes standard */
@media (min-width: 768px) and (max-width: 1023px) {
    .main-image {
        height: 350px;
    }

    .info-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .features-grid {
        grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    }

    .booking-card {
        position: relative;
        top: 0;
        margin-top: 30px;
    }
}

/* 1024px - 1279px : Grandes tablettes/petits laptops */
@media (min-width: 1024px) and (max-width: 1279px) {
    .container {
        max-width: 960px;
    }

    .main-image {
        height: 380px;
    }

    .info-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 1280px - 1439px : Desktop standard */
@media (min-width: 1280px) and (max-width: 1439px) {
    .container {
        max-width: 1140px;
    }

    .main-image {
        height: 400px;
    }
}

/* 1440px - 1919px : Full HD */
@media (min-width: 1440px) and (max-width: 1919px) {
    .container {
        max-width: 1320px;
    }

    .main-image {
        height: 450px;
    }

    .property-header,
    .property-images,
    .property-info {
        padding: 40px;
    }
}

/* 1920px+ : 2K/4K/Ultra-wide */
@media (min-width: 1920px) {
    .container {
        max-width: 1600px;
    }

    .main-image {
        height: 500px;
    }

    .property-header,
    .property-images,
    .property-info {
        padding: 50px;
    }

    .property-title {
        font-size: 2.5rem;
    }

    .section-title {
        font-size: 1.8rem;
    }
}

/* ========================================
       OPTIMISATIONS PERFORMANCE
    ======================================== */
.property-images,
.property-header,
.property-info,
.booking-card,
.info-item,
.feature-item {
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

/* ========================================
       ACCESSIBILITÉ
    ======================================== */
/* Focus visible pour navigation clavier */
*:focus-visible {
    outline: 3px solid var(--accent-color);
    outline-offset: 3px;
}

/* Support mode contraste élevé */
@media (prefers-contrast: high) {
    .badge,
    .btn-book,
    .info-item {
        border: 2px solid currentColor;
    }

    .property-header,
    .property-images,
    .property-info,
    .booking-card {
        border: 1px solid var(--text-primary);
    }
}

/* Support mode sombre */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-light: #1a202c;
        --bg-white: #2d3748;
        --text-primary: #f7fafc;
        --text-secondary: #e2e8f0;
        --border-color: #4a5568;
    }

    .main-image,
    .thumbnail {
        filter: brightness(0.9);
    }
}

/* ========================================
       UTILITAIRES
    ======================================== */
.text-muted {
    color: var(--text-muted);
}

.mb-0 {
    margin-bottom: 0 !important;
}

/* Prévention du zoom automatique iOS */
@supports (-webkit-touch-callout: none) {
    input, textarea, select {
        font-size: 16px !important;
    }
}

/* ========================================
       ANIMATIONS DE CHARGEMENT
    ======================================== */
.property-header,
.property-images,
.property-info {
    animation: fadeInUp 0.6s ease backwards;
}

.property-images {
    animation-delay: 0.1s;
}

.property-info {
    animation-delay: 0.2s;
}

.booking-card {
    animation: fadeInUp 0.6s ease 0.3s backwards;
}

/* ========================================
       PRINT STYLES
    ======================================== */
@media print {
    .btn-back,
    .btn-book,
    .thumbnail-gallery {
        display: none;
    }

    .property-details-section {
        padding: 0;
    }

    .main-image {
        height: auto;
        page-break-inside: avoid;
    }

    .property-header,
    .property-info {
        box-shadow: none;
        border: 1px solid #ddd;
        page-break-inside: avoid;
    }
}