/* ==========================================
   Dynasty 8 - Styles Responsive
   ========================================== */

/* Grands écrans (Desktop large) */
@media (min-width: 1024px) {
    .content-wrapper {
        align-items: center;
    }
}

/* Tablettes (iPad Mini, iPad Air, iPad Pro) */
@media (max-width: 1024px) and (min-width: 769px) {
    .content-wrapper {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 2rem;
        max-width: 900px;
        margin: 0 auto;
    }

    .zone-map-sidebar,
    .form-section {
        max-width: 100%;
    }

    .zone-map-image {
        width: 100%;
        height: auto;
        max-height: 400px;
    }

    .header {
        padding: 1rem 0;
    }

    .header-hero h2 {
        font-size: 1.4rem;
    }

    .header-hero .hero-subtitle {
        font-size: 0.95rem;
    }

    .logo-img {
        height: 58px;
    }

    .progress-bar {
        margin-bottom: 2rem;
    }

    .progress-step-circle {
        width: 45px;
        height: 45px;
    }

    .progress-step-label {
        font-size: 0.9rem;
    }

    .footer {
        padding: 1.25rem 0;
    }

    .footer .container > div {
        gap: 1.5rem;
    }
}

/* Surface et écrans pliables (Surface Pro 7, Galaxy Z Fold, etc.) */
@media (max-width: 912px) and (min-width: 769px) {
    .content-wrapper {
        padding: 2rem;
    }

    .form-section,
    .zone-map-sidebar {
        padding: 2rem;
    }

    .header nav a {
        padding: 0.5rem 1.25rem;
    }
}

/* Mobiles moyens (iPhone XR, 12 Pro, 14 Pro Max, Pixel 7, Galaxy) */
@media (max-width: 768px) and (min-width: 391px) {
    .content-wrapper {
        grid-template-columns: 1fr;
    }
    
    .zone-map-sidebar {
        max-width: 600px;
        margin: 0 auto 2rem;
    }

    .header {
        padding: 0.75rem 0;
    }

    .header .container {
        padding: 0 1rem;
    }

    .header-content {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 0.75rem;
    }

    .header-hero {
        display: none;
    }

    .logo {
        gap: 0.5rem;
        flex-shrink: 1;
        min-width: 0;
    }

    .logo-img {
        height: 45px !important;
        flex-shrink: 0;
    }

    .logo-text {
        min-width: 0;
    }

    .logo-text h1 {
        font-size: 0.9rem;
        white-space: nowrap;
    }

    .logo-text .subtitle {
        font-size: 0.7rem;
        white-space: nowrap;
    }

    .header nav {
        flex-shrink: 0;
    }

    .header nav a {
        padding: 0.5rem 0.85rem;
        font-size: 0 !important;
        border: 2px solid var(--text-white);
        border-radius: 6px;
        display: inline-block;
        line-height: 1;
    }

    .header nav a::before {
        content: "← RETOUR";
        font-size: 0.75rem;
        display: inline-block;
        text-transform: uppercase;
        font-weight: 600;
        letter-spacing: 0.5px;
    }

    .progress-step-circle {
        width: 36px;
        height: 36px;
        font-size: 0.85rem;
    }

    .progress-step.active .progress-step-circle,
    .progress-step.completed .progress-step-circle {
        font-size: 0.8rem;
    }

    .progress-step-label {
        font-size: 0.75rem;
        max-width: 70px;
    }

    .form-section {
        padding: 1.5rem 1rem;
    }

    .form-section h3 {
        font-size: 1.25rem;
        margin-bottom: 1.25rem;
    }

    .form-group {
        margin-bottom: 1.25rem;
    }

    .form-group label {
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }

    .tooltip {
        display: inline-flex;
        vertical-align: middle;
    }

    .tooltip-icon {
        width: 18px;
        height: 18px;
        font-size: 0.7rem;
    }

    .footer {
        padding: 1.25rem 0;
    }

    .footer .container {
        padding: 0 1rem;
    }

    .footer .container > div {
        flex-direction: column !important;
        gap: 0.65rem !important;
        text-align: center;
    }

    .footer p {
        font-size: 0.75rem !important;
        line-height: 1.4 !important;
        margin: 0.1rem 0 !important;
    }

    .footer a {
        font-size: 0.7rem !important;
        padding: 0.2rem 0.5rem !important;
    }

    .zone-map-sidebar {
        padding: 1rem;
    }

    .zone-map-sidebar h4 {
        font-size: 1.1rem;
        margin-bottom: 0.75rem;
    }

    .zone-map-image {
        max-height: 220px;
        width: auto;
        margin: 0 auto;
        display: block;
    }

    .progress-bar {
        gap: 0.5rem;
        margin-bottom: 1.5rem;
    }

    .progress-step {
        flex: 1;
        min-width: 0;
    }

    h3 {
        font-size: 1.3rem;
    }

    .form-group label {
        font-size: 0.95rem;
    }

    .form-control {
        font-size: 0.95rem;
        padding: 0.875rem;
    }

    .btn-primary,
    .btn-secondary {
        padding: 0.875rem 1.5rem;
        font-size: 0.95rem;
    }

    .estimation-modal-body {
        padding: 1.5rem !important;
    }

    .devis-preview {
        padding: 1.25rem !important;
    }
}

/* Petits mobiles (iPhone SE et similaires) */
@media (max-width: 390px) {
    .header {
        padding: 0.6rem 0;
    }

    .header .container {
        padding: 0 0.75rem;
    }

    .header-content {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 0.5rem;
    }

    .header-hero {
        display: none;
    }

    .logo {
        gap: 0.4rem;
        flex-shrink: 1;
        min-width: 0;
    }

    .logo-img {
        height: 40px !important;
        flex-shrink: 0;
    }

    .logo-text h1 {
        font-size: 0.8rem !important;
        white-space: nowrap;
    }

    .logo-text .subtitle {
        font-size: 0.65rem !important;
        white-space: nowrap;
    }

    .header nav {
        flex-shrink: 0;
    }

    .header nav a {
        padding: 0.4rem 0.65rem;
        font-size: 0 !important;
        border: 2px solid var(--text-white);
        border-radius: 5px;
    }

    .header nav a::before {
        content: "← RETOUR";
        font-size: 0.7rem;
        display: inline-block;
        text-transform: uppercase;
        font-weight: 600;
    }

    .zone-map-sidebar {
        padding: 0.75rem;
    }

    .zone-map-sidebar h4 {
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }

    .zone-map-image {
        max-height: 180px;
    }

    .progress-bar {
        gap: 0.3rem;
        margin-bottom: 1rem;
        padding: 0;
    }

    .progress-step {
        gap: 0.25rem;
    }

    .progress-step-circle {
        width: 32px;
        height: 32px;
        font-size: 0.75rem;
    }

    .progress-step.active .progress-step-circle,
    .progress-step.completed .progress-step-circle {
        font-size: 0.7rem;
    }

    .progress-step-label {
        font-size: 0.65rem;
        max-width: 55px;
        line-height: 1.1;
    }

    .form-section {
        padding: 1.25rem 0.75rem;
    }

    .form-section h3 {
        font-size: 1.1rem;
        margin-bottom: 1rem;
    }

    .form-group {
        margin-bottom: 1rem;
    }

    .form-group label {
        font-size: 0.85rem;
    }

    .form-control {
        font-size: 0.9rem;
        padding: 0.75rem;
    }

    .btn-primary,
    .btn-secondary {
        padding: 0.75rem 1.25rem;
        font-size: 0.9rem;
    }

    .footer {
        padding: 0.9rem 0;
    }

    .footer .container {
        padding: 0 0.75rem;
    }

    .footer .container > div {
        flex-direction: column !important;
        gap: 0.4rem !important;
        text-align: center;
    }

    .footer p {
        font-size: 0.7rem !important;
        margin: 0.1rem 0 !important;
        line-height: 1.35 !important;
    }

    .footer a {
        font-size: 0.65rem !important;
        padding: 0.2rem 0.45rem !important;
    }

    .progress-bar {
        margin-bottom: 1.5rem;
    }

    .progress-bar::before {
        display: none;
    }

    .progress-step {
        gap: 0.35rem;
    }

    .progress-step-circle {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }

    .progress-step.active .progress-step-circle,
    .progress-step.completed .progress-step-circle {
        font-size: 0.75rem;
    }

    .progress-step-label {
        font-size: 0.7rem;
        max-width: 60px;
        line-height: 1.2;
    }

    .form-section,
    .preview-section {
        padding: 1.5rem;
    }
    
    .zone-map-sidebar {
        max-width: 100%;
        padding: 1rem;
    }
    
    .zone-map-sidebar h4 {
        font-size: 1rem;
    }

    .devis-preview {
        padding: 1.5rem;
    }

    .devis-header {
        flex-direction: column;
        gap: 1.5rem;
    }

    .devis-info {
        text-align: left;
    }

    .devis-parties {
        grid-template-columns: 1fr;
    }

    .option-item {
        grid-template-columns: 1fr;
    }

    .form-actions {
        flex-direction: column;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
        min-width: auto;
    }

    .content-wrapper {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 1rem;
    }

    .zone-map-image {
        width: 100%;
        height: auto;
    }
}

/* Responsive Modal (mobiles) */
@media (max-width: 480px) {
    .estimation-modal.active {
        padding: 0.5rem;
    }

    .estimation-modal-content {
        max-width: 100%;
        max-height: 95vh;
        border-radius: 8px;
    }

    .estimation-modal-header {
        padding: 1rem 1.25rem;
    }

    .estimation-modal-header h3 {
        font-size: 1.2rem;
    }

    .estimation-modal-body {
        padding: 1.25rem !important;
    }

    .estimation-modal-footer {
        padding: 1rem 1.25rem;
        flex-direction: column-reverse;
    }

    .estimation-modal-footer .btn-primary,
    .estimation-modal-footer .btn-secondary {
        width: 100%;
        min-width: auto;
    }

    .devis-preview {
        padding: 1rem !important;
    }

    .devis-header {
        margin-bottom: 1.25rem !important;
        padding-bottom: 1rem !important;
    }

    .devis-header h1 {
        font-size: 1.2rem !important;
    }

    .devis-header p {
        font-size: 0.8rem !important;
    }

    .devis-number {
        font-size: 1rem !important;
    }

    .devis-date {
        font-size: 0.75rem !important;
    }

    .property-details {
        padding: 1rem !important;
        margin-bottom: 1.25rem !important;
    }

    .property-details h3 {
        font-size: 1.1rem !important;
    }

    .property-grid {
        grid-template-columns: 1fr !important;
        gap: 0.5rem !important;
    }

    .pricing-table h3 {
        font-size: 1rem !important;
    }

    .pricing-table table {
        font-size: 0.85rem !important;
    }

    .pricing-table td {
        padding: 0.75rem 0.5rem !important;
    }
}

/* Nest Hub et écrans fixes */
@media (min-width: 1024px) and (max-width: 1280px) {
    .container {
        max-width: 1024px;
        padding: 0 2rem;
    }

    .content-wrapper {
        gap: 2rem;
    }

    .form-section {
        padding: 2.5rem;
    }
}

/* Optimisation pour écrans très larges */
@media (min-width: 1920px) {
    .container {
        max-width: 1800px;
    }

    .content-wrapper {
        max-width: 1800px;
    }
}

/* Styles d'impression */
@media print {
    body {
        background: white;
        padding: 0;
        margin: 0;
    }

    .header,
    .dev-banner,
    .dev-banner-staging,
    .footer,
    .form-section,
    .zone-map-sidebar,
    .progress-bar,
    .floating-price,
    .map-modal,
    .estimation-modal-header,
    .estimation-modal-footer,
    .estimation-modal-close,
    .preview-header button {
        display: none !important;
    }

    .estimation-modal {
        display: block !important;
        position: static !important;
        background: white !important;
        width: 100% !important;
        height: auto !important;
        overflow: visible !important;
    }

    .estimation-modal-content {
        max-width: 100% !important;
        max-height: none !important;
        box-shadow: none !important;
        border-radius: 0 !important;
    }

    .estimation-modal-body {
        padding: 2rem !important;
        overflow: visible !important;
    }

    .content-wrapper {
        display: block !important;
        max-width: 100%;
    }

    .preview-section {
        border: none;
        box-shadow: none;
        padding: 0;
        display: block !important;
    }

    .devis-preview {
        box-shadow: none;
        page-break-inside: avoid;
        padding: 2rem !important;
    }

    .devis-header {
        margin-bottom: 2rem !important;
        page-break-after: avoid;
    }

    .property-details {
        page-break-inside: avoid;
        margin-bottom: 1.5rem !important;
    }

    .pricing-table {
        page-break-inside: avoid;
    }

    table {
        page-break-inside: avoid;
    }

    .devis-preview::after {
        content: "📱 Plus d'informations sur dynasty.storylife.fr | 📞 Contact: Dynasty 8 Real Estate";
        display: block;
        text-align: center;
        margin-top: 2rem;
        padding-top: 2rem;
        border-top: 2px solid var(--primary-green);
        font-size: 0.9rem;
        color: var(--text-secondary);
        page-break-before: avoid;
    }
}
