/* =============================================================
   ORPI MANDELIEU — Header & Footer v5
   Fichier CSS à inclure dans head.php
   ATTENTION : nécessite Font Awesome 6 Free (voir head.php)
   ============================================================= */

/* Espaceur pour compenser le header fixed (top bar ~33px + header ~72px) */
.orpi-header-spacer {
    height: 105px;
}

/* =============================================================
   HEADER — Barre supérieure (desktop uniquement)
   ============================================================= */
.orpi-top-bar {
    background: #595959;
    padding: 8px 32px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 24px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 101;
    box-sizing: border-box;
}
.orpi-top-bar a {
    font-size: 13px;
    color: #FFFFFF;
    opacity: 0.85;
    transition: opacity 0.2s ease;
    text-decoration: none;
}
.orpi-top-bar a:hover { opacity: 1; text-decoration: underline; }
.orpi-top-bar .separator { color: #FFFFFF; opacity: 0.4; font-size: 13px; }

/* =============================================================
   HEADER — Barre principale (desktop)
   ============================================================= */
.orpi-main-header {
    background: #FFFFFF;
    padding: 14px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #ECEAE6;
    position: fixed;
    top: 33px; /* hauteur de la top bar */
    left: 0;
    right: 0;
    width: 100%;
    z-index: 100;
    gap: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    box-sizing: border-box;
}
.orpi-logo { display: flex; align-items: center; flex-shrink: 0; }
.orpi-logo img { height: 44px; width: auto; }

.orpi-main-nav { display: flex; align-items: center; gap: 24px; flex-shrink: 0; }
.orpi-main-nav > a,
.orpi-main-nav .nav-trigger {
    font-size: 15px;
    color: #595959;
    font-weight: 400;
    transition: color 0.2s ease;
    position: relative;
    padding: 6px 0;
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
}
.orpi-main-nav > a:hover,
.orpi-main-nav .nav-trigger:hover { color: #E30513; }
.orpi-main-nav > a.active,
.orpi-main-nav .nav-trigger.active { color: #E30513; font-weight: 500; }
.orpi-main-nav .nav-separator { color: #B4B2A9; font-size: 15px; }

/* CTA principal */
.orpi-cta-button {
    background: #E30513 !important;
    color: #FFFFFF !important;
    font-size: 15px !important;
    font-weight: 500 !important;
    height: 40px !important;
    min-height: 40px !important;
    max-height: 40px !important;
    padding: 0 20px !important;
    border-radius: 999px !important;
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    white-space: nowrap !important;
    text-decoration: none !important;
    box-sizing: border-box !important;
    line-height: 1 !important;
    border: none !important;
    overflow: hidden !important;
    vertical-align: middle !important;
}
.orpi-cta-button:hover {
    background: #C70410 !important;
    color: #FFFFFF !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(227, 5, 19, 0.25);
}
.orpi-cta-button > i,
.orpi-cta-button > span { color: #FFFFFF !important; line-height: 1 !important; display: inline-flex !important; align-items: center !important; height: auto !important; }
.orpi-cta-button > i { font-size: 15px !important; }

/* =============================================================
   SOUS-MENUS DÉROULANTS (Acheter, Louer)
   ============================================================= */
.orpi-dropdown-wrapper { position: relative; }
.orpi-dropdown-trigger::after {
    content: ' \f107';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 12px;
    margin-left: 4px;
    opacity: 0.6;
}
.orpi-dropdown {
    position: absolute;
    top: calc(100% + 1px);
    left: -16px;
    min-width: 240px;
    background: #FFFFFF;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    padding: 12px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
    z-index: 99;
}
.orpi-dropdown-wrapper:hover .orpi-dropdown,
.orpi-dropdown:hover { opacity: 1; visibility: visible; transform: translateY(0); }

.orpi-dropdown-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 14px;
    color: #595959;
    transition: background 0.2s ease, color 0.2s ease;
    text-decoration: none;
}
.orpi-dropdown-link:hover { background: #FAFAFA; color: #E30513; }
.orpi-dropdown-link.featured { background: #FFEBDF; color: #A32135; font-weight: 500; margin-top: 8px; }
.orpi-dropdown-link.featured:hover { background: #F2D9CA; }
.orpi-dropdown-link i { width: 18px; font-size: 13px; color: #E30513; text-align: center; }
.orpi-dropdown-divider { height: 1px; background: #ECEAE6; margin: 6px 8px; }

/* =============================================================
   MEGAMENU — Nos expertises
   ============================================================= */
.orpi-megamenu-wrapper { position: relative; }
.orpi-megamenu-trigger::after {
    content: ' \f107';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 10px;
    margin-left: 4px;
    opacity: 0.6;
}
.orpi-megamenu {
    position: absolute;
    top: calc(100% + 1px);
    right: -120px;
    width: 760px;
    background: #FFFFFF;
    border-radius: 0 0 16px 16px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    padding: 24px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
    z-index: 99;
}
.orpi-megamenu-wrapper:hover .orpi-megamenu,
.orpi-megamenu:hover { opacity: 1; visibility: visible; transform: translateY(0); }
.orpi-megamenu-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.orpi-expertise-card {
    padding: 20px 14px;
    border-radius: 12px;
    background: #FAFAFA;
    transition: background 0.2s ease, transform 0.2s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-height: 160px;
    text-decoration: none;
}
.orpi-expertise-card:hover { background: #FFEBDF; transform: translateY(-2px); }
.orpi-expertise-logo { height: 56px; margin-bottom: 14px; display: flex; align-items: center; justify-content: center; width: 100%; }
.orpi-expertise-logo img { max-height: 56px; max-width: 100%; width: auto; object-fit: contain; }
.orpi-expertise-description { font-size: 15px; color: #595959; line-height: 1.5; opacity: 0.85; }

/* =============================================================
   HEADER MOBILE
   ============================================================= */
.orpi-mobile-header {
    display: none;
     background: #FFFFFF;
     padding: 12px 20px;
     justify-content: space-between;
     align-items: center;
     border-bottom: 1px solid #ECEAE6;
     position: fixed;
     top: 0;
     left: 0;
     right: 0;
     width: 100%;
     z-index: 100;
     box-sizing: border-box;
}
.orpi-mobile-header .orpi-logo img { height: 36px; }
.orpi-mobile-actions { display: flex; align-items: center; gap: 18px; }
.orpi-mobile-icon {
    color: #595959;
    font-size: 18px;
    background: none;
    border: none;
    padding: 4px;
    transition: color 0.2s ease;
    text-decoration: none;
    line-height: 1;
    cursor: pointer;
    font-family: inherit;
}
.orpi-mobile-icon:hover { color: #E30513; }

/* Bouton flottant mobile */
.orpi-floating-cta {
    display: none;
    position: fixed;
    bottom: 16px;
    right: 16px;
    background: #E30513;
    color: #FFFFFF;
    font-size: 14px;
    padding: 14px 20px;
    border-radius: 28px;
    font-weight: 500;
    box-shadow: 0 6px 16px rgba(227, 5, 19, 0.35);
    z-index: 90;
    align-items: center;
    gap: 8px;
    transition: transform 0.2s ease;
    text-decoration: none;
}
.orpi-floating-cta:hover, .orpi-floating-cta:active { transform: scale(1.05); color: #FFFFFF; }

/* Menu mobile plein écran */
.orpi-mobile-menu {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #FFFFFF;
    z-index: 200;
    overflow-y: auto;
    padding: 20px 20px 90px 20px;
    font-family: 'Orpi', 'Arial Rounded MT', 'Arial', sans-serif;
}
.orpi-mobile-menu.open { display: block; }
.orpi-mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 16px;
    border-bottom: 1px solid #ECEAE6;
    margin-bottom: 20px;
}
.orpi-mobile-menu-close { color: #595959; font-size: 22px; background: none; border: none; line-height: 1; cursor: pointer; font-family: inherit; }

.orpi-mobile-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #E30513;
    color: #FFFFFF;
    font-size: 15px;
    padding: 14px;
    border-radius: 28px;
    text-align: center;
    font-weight: 500;
    margin-bottom: 24px;
    transition: background 0.2s ease;
    text-decoration: none;
}
.orpi-mobile-cta:hover { background: #C70410; color: #FFFFFF; }

.orpi-mobile-section-title {
    font-size: 11px;
    color: #888780;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 8px;
    margin-top: 16px;
    font-weight: 500;
}
.orpi-mobile-section-title:first-of-type { margin-top: 0; }

.orpi-mobile-link {
    display: block;
    font-size: 15px;
    color: #595959;
    padding: 12px 0;
    border-bottom: 1px solid #ECEAE6;
    transition: color 0.2s ease;
    text-decoration: none;
}
.orpi-mobile-link:hover { color: #E30513; }
.orpi-mobile-link:last-child { border-bottom: none; }

/* =============================================================
   FOOTER
   ============================================================= */
.orpi-footer {
    background: #FAFAFA;
    padding: 48px 32px 24px;
    margin-top: 64px;
    font-family: 'Orpi', 'Arial Rounded MT', 'Arial', sans-serif;
}
.orpi-footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1.1fr;
    gap: 32px;
    max-width: 1280px;
    margin: 0 auto 32px;
}
.orpi-footer-logo { margin-bottom: 24px; }
.orpi-footer-logo img { height: 56px; width: auto; }

.orpi-agency { margin-bottom: 16px; }
.orpi-agency:last-child { margin-bottom: 0; }
.orpi-agency-name { font-size: 13px; font-weight: 500; color: #595959; margin-bottom: 4px; transition: color 0.2s ease; display: inline-block; text-decoration: none; }
.orpi-agency-name:hover { color: #E30513; }
.orpi-agency-address { font-size: 12px; color: #595959; opacity: 0.8; line-height: 1.5; margin-bottom: 4px; }
.orpi-agency-phone { font-size: 13px; color: #E30513; font-weight: 500; transition: color 0.2s ease; display: inline-block; text-decoration: none; }
.orpi-agency-phone:hover { color: #A32135; }

.orpi-footer-column-title { font-size: 14px; font-weight: 500; color: #595959; margin-bottom: 16px; }
.orpi-footer-links { display: flex; flex-direction: column; gap: 10px; }
.orpi-footer-link { font-size: 13px; color: #595959; transition: color 0.2s ease; text-decoration: none; }
.orpi-footer-link:hover { color: #E30513; }
.orpi-footer-link.spacer { margin-top: 8px; }

/* Réseaux sociaux */
.orpi-social-icons { display: flex; gap: 10px; margin-bottom: 20px; }
.orpi-social-icon {
    width: 38px; height: 38px;
    background: #FFFFFF;
    border: 1px solid #ECEAE6;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #595959;
    font-size: 16px;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
    text-decoration: none;
}
.orpi-social-icon:hover { background: #E30513; color: #FFFFFF; border-color: #E30513; transform: translateY(-2px); text-decoration: none; }

/* Magazine card */
.orpi-magazine-card { background: #FFFFFF; border: 1px solid #ECEAE6; border-radius: 12px; padding: 14px; margin-bottom: 14px; transition: border-color 0.2s ease; display: block; text-decoration: none; }
.orpi-magazine-card:hover { border-color: #E30513; text-decoration: none; }
.orpi-magazine-card:hover .orpi-magazine-title,
.orpi-magazine-card:hover .orpi-magazine-subtitle { text-decoration: none; }
.orpi-magazine-title { font-size: 13px; font-weight: 500; color: #595959; margin-bottom: 4px; text-decoration: none; }
.orpi-magazine-subtitle { font-size: 11px; color: #595959; opacity: 0.7; text-decoration: none; }

/* Carte avis */
.orpi-rating-card { background: #FFEBDF; border-radius: 12px; padding: 12px 14px; display: flex; align-items: center; gap: 10px; transition: background 0.2s ease; text-decoration: none; }
.orpi-rating-card:hover { background: #F2D9CA; text-decoration: none; }
.orpi-rating-card:hover .orpi-rating-percent,
.orpi-rating-card:hover .orpi-rating-count { text-decoration: none; }
.orpi-rating-star { color: #E30513; font-size: 18px; flex-shrink: 0; }
.orpi-rating-content { flex: 1; }
.orpi-rating-percent { font-size: 12px; font-weight: 500; color: #A32135; line-height: 1.3; text-decoration: none; }
.orpi-rating-count { font-size: 11px; color: #A32135; opacity: 0.8; line-height: 1.3; text-decoration: none; }


/* Barre de bas de page */
.orpi-footer-bottom {
    border-top: 1px solid #ECEAE6;
    padding-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1280px;
    margin: 0 auto;
    flex-wrap: wrap;
    gap: 8px;
}
.orpi-footer-legal { font-size: 12px; color: #595959; opacity: 0.7; line-height: 1.5; }
.orpi-footer-legal a { color: inherit; transition: color 0.2s ease; text-decoration: none; }
.orpi-footer-legal a:hover { color: #E30513; }
.orpi-footer-credits { font-size: 12px; color: #595959; opacity: 0.7; }

/* =============================================================
   RESPONSIVE — Tablette
   ============================================================= */
@media (max-width: 1100px) {
    .orpi-main-nav { gap: 16px; }
    .orpi-main-nav > a, .orpi-main-nav .nav-trigger { font-size: 13px; }
    .orpi-cta-button { font-size: 12px !important; padding: 0 16px !important; height: 38px !important; }
    .orpi-megamenu { right: -50px; width: 600px; }
    .orpi-megamenu-grid { grid-template-columns: repeat(2, 1fr); }
    .orpi-footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
}

/* =============================================================
   RESPONSIVE — Mobile
   ============================================================= */
@media (max-width: 768px) {
    .orpi-top-bar, .orpi-main-header { display: none; }
    .orpi-mobile-header { display: flex; }
    .orpi-floating-cta { display: inline-flex; }
    .orpi-footer { padding: 32px 20px 20px; margin-top: 32px; }
    .orpi-footer-grid { grid-template-columns: 1fr; gap: 28px; }
    .orpi-footer-bottom { flex-direction: column; align-items: flex-start; gap: 8px; }
    /* Le header mobile est fixe. Sans decalage, le haut de chaque page passait
       dessous. Seule la fiche compensait, avec son propre espaceur en dur.
       On decale donc le body pour toutes les pages, et on neutralise
       l'espaceur de la fiche pour ne pas cumuler les deux. */
    body { padding-top: 61px; }
    .orpi-header-spacer { height: 0; }
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-12px); }
    to { opacity: 1; transform: translateY(0); }
}
.orpi-mobile-menu.open > * { animation: slideDown 0.3s ease forwards; }
