/* Styles personnalisés pour LPO Rennes - Charte graphique */

/* Déclarations @font-face pour les polices personnalisées */
@font-face {
    font-family: 'Arista Pro';
    src: url('../assets/fonts/Arista-Pro-Light-trial.ttf') format('truetype');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Arista Pro';
    src: url('../assets/fonts/Arista-Pro-Bold-trial.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Arista Pro';
    src: url('../assets/fonts/Arista-Pro-Fat-trial.ttf') format('truetype');
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Arista Pro Alternate';
    src: url('../assets/fonts/Arista-Pro-Alternate-Light-trial.ttf') format('truetype');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Arista Pro Alternate';
    src: url('../assets/fonts/Arista-Pro-Alternate-Bold-trial.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Arista Pro Alternate';
    src: url('../assets/fonts/Arista-Pro-Alternate-Fat-trial.ttf') format('truetype');
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Manrope';
    src: url('../assets/fonts/Manrope-Light.ttf') format('truetype');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Manrope';
    src: url('../assets/fonts/Manrope-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Manrope';
    src: url('../assets/fonts/Manrope-Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Manrope';
    src: url('../assets/fonts/Manrope-SemiBold.ttf') format('truetype');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Manrope';
    src: url('../assets/fonts/Manrope-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Manrope';
    src: url('../assets/fonts/Manrope-ExtraBold.ttf') format('truetype');
    font-weight: 800;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'MsMadi';
    src: url('../assets/fonts/MsMadi-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* Variables CSS pour les couleurs de la charte */
:root {
    --blanc-casse: #F6F4F3;
    --gris-anthracite: #262626;
    --jaune-dore: #F3C93F;
}

/* Amélioration du style épuré et cocooning */
body {
    font-family: 'Manrope', sans-serif;
    background-color: var(--blanc-casse);
    color: var(--gris-anthracite);
    line-height: 1.7;
    overflow-x: hidden; /* évite tout débordement horizontal sur mobile */
}

/* Contraindre le widget Google Calendar pour éviter les débordements */
.calendar-scheduling-button,
.calendar-scheduling-button * {
    max-width: 100% !important;
    box-sizing: border-box;
}

.calendar-scheduling-button {
    width: 100% !important;
}

@media (min-width: 640px) {
    .calendar-scheduling-button {
        width: auto !important;
    }
}

/* Harmoniser le bouton Google Calendar quand il est placé dans nos wrappers */
.btn-rdv .calendar-scheduling-button {
    width: auto !important;
    background: transparent !important;
    border: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    color: inherit !important;
    font: inherit !important;
    line-height: 1 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.btn-rdv .calendar-scheduling-button:focus-visible {
    outline: none;
}

/* Popup Google Calendar (mobile) : plein écran avec 10px de marge */
@media (max-width: 640px) {
    iframe[src*="calendar.google.com"][src*="appointments"] {
        width: 100% !important;
        height: 100% !important;
        max-width: 100% !important;
        max-height: 100% !important;
        border-radius: 16px !important;
        display: block !important;
    }
}

/* Transitions douces pour un effet naturel */
* {
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Effets de lumière naturelle sur les éléments */
.shadow-natural {
    box-shadow: 0 4px 6px -1px rgba(38, 38, 38, 0.05), 
                0 2px 4px -1px rgba(38, 38, 38, 0.03);
}

/* Style pour les bordures subtiles inspirées du bois */
.border-wood {
    border-color: rgba(38, 38, 38, 0.08);
}

/* Effet de texture douce pour les fonds */
.bg-texture {
    background-image: 
        radial-gradient(circle at 1px 1px, rgba(38, 38, 38, 0.02) 1px, transparent 0);
    background-size: 20px 20px;
}

/* Hover effects doux et naturels */
a, button {
    transition: all 0.3s ease;
}

/* Bouton "scroll to top" */
.scroll-top-btn {
    position: fixed;
    right: 18px;
    bottom: 18px;
    width: 46px;
    height: 46px;
    --p: 0deg; /* progression (0deg -> 360deg) */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    background: rgba(246, 244, 243, 0.88);
    border: 1px solid rgba(38, 38, 38, 0.12);
    box-shadow: 0 12px 30px rgba(38, 38, 38, 0.10), 0 4px 10px rgba(38, 38, 38, 0.06);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
    transition: opacity 180ms ease, transform 180ms ease, border-color 180ms ease, background-color 180ms ease;
    z-index: 60;
}

.scroll-top-btn::before {
    content: "";
    position: absolute;
    inset: -3px; /* couronne légèrement externe */
    border-radius: 9999px;
    background: conic-gradient(rgba(38, 38, 38, 0.55) var(--p), rgba(38, 38, 38, 0.10) 0deg);
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3px));
    mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3px));
    opacity: 0.85;
}

.scroll-top-btn > svg {
    position: relative;
    z-index: 1;
}

.scroll-top-btn.is-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

@media (hover: hover) and (pointer: fine) {
    .scroll-top-btn:hover {
        border-color: rgba(243, 201, 63, 0.55);
        background: rgba(246, 244, 243, 0.96);
    }
}

.scroll-top-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(243, 201, 63, 0.35), 0 12px 30px rgba(38, 38, 38, 0.10);
}

/* Hover discret sur cartes (PC uniquement) */
@media (hover: hover) and (pointer: fine) {
    .card-hover {
        transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease, background-color 220ms ease;
        will-change: transform;
    }

    .card-hover:hover {
        transform: translateY(-4px);
        border-color: rgba(243, 201, 63, 0.35);
        box-shadow:
            0 10px 30px rgba(38, 38, 38, 0.08),
            0 4px 12px rgba(38, 38, 38, 0.04);
    }
}

/* Style pour les cartes avec effet de profondeur subtile */
.card-natural {
    background: rgba(246, 244, 243, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(38, 38, 38, 0.05);
}

/* Accent doré avec effet de lumière */
.text-jaune-dore {
    color: var(--jaune-dore);
}

.bg-jaune-dore {
    background-color: var(--jaune-dore);
}

/* Amélioration de la lisibilité */
/* H1 en Manrope (mobile-first / lisibilité) */
h1 {
    font-family: 'Manrope', sans-serif;
    font-weight: 800;
    letter-spacing: -0.02em;
}

/* Arista Pro uniquement pour le mot-clé mis en avant */
.font-arista {
    font-family: 'Arista Pro', serif;
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* Badge premium: fondu blanc en bas à droite pour casser le bord net */
.badge-premium {
    position: relative;
    overflow: hidden;
}

.badge-premium::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    /* fondu vers le blanc cassé (charte) en bas à droite */
    background: radial-gradient(120px 70px at 100% 100%, rgba(246, 244, 243, 0) 0%, rgba(246, 244, 243, 0.25) 70%, rgba(246, 244, 243, 0.40) 100%);
}

/* Animation "loupe" sur le mot-clé (PC hover, mobile auto) */
.keyword-loupe {
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 24px rgba(243, 201, 63, 0.18);
    transition: filter 250ms ease, transform 250ms ease, box-shadow 250ms ease;
    -webkit-tap-highlight-color: transparent;
}

/* Badge "Opticien Lunetier" : taille auto sur mobile, 1 ligne */
.keyword-fit {
    font-size: clamp(1.6rem, 9vw, 3rem); /* remplit mieux l’écran sur mobile */
}

@media (min-width: 768px) {
    .keyword-fit {
        font-size: inherit; /* sur desktop, reprend la taille du H1 */
    }
}

/* Halo lumineux qui "balaye" le badge */
.keyword-loupe::after {
    content: "";
    position: absolute;
    inset: -30% -40%;
    opacity: 0;
    pointer-events: none;
    transform: translateX(-40%);
    background: radial-gradient(220px 120px at 30% 60%, rgba(246, 244, 243, 0.0) 0%, rgba(246, 244, 243, 0.45) 35%, rgba(246, 244, 243, 0.0) 70%);
    transition: opacity 250ms ease;
}

/* Hover (PC) */
@media (hover: hover) and (pointer: fine) {
    .keyword-loupe:hover {
        filter: saturate(1.05) brightness(1.02);
        transform: translateY(-1px);
        box-shadow: 0 14px 28px rgba(243, 201, 63, 0.22);
    }

    .keyword-loupe:hover::after {
        opacity: 1;
        animation: loupeSweep 900ms ease-out forwards;
    }
}

/* Mobile: animation automatique (cali, amusant, doux) */
@media (hover: none) and (pointer: coarse) {
    .keyword-loupe::after {
        opacity: 1;
        animation: loupeSweep 2200ms ease-in-out infinite;
    }
}

@keyframes loupeSweep {
    0%   { transform: translateX(-45%); }
    45%  { transform: translateX(10%); }
    100% { transform: translateX(55%); }
}

@media (prefers-reduced-motion: reduce) {
    .keyword-loupe,
    .keyword-loupe::after {
        animation: none !important;
        transition: none !important;
    }
}

/* (retiré) Gradient H1 : remplacé par un badge jaune dans le HTML */

h2 {
    font-family: 'Arista Pro', serif;
    font-weight: 700;
    letter-spacing: -0.01em;
}

/* Manrope pour les sous-titres et tout le reste pour une meilleure lisibilité */
h3, h4, h5, h6 {
    font-family: 'Manrope', sans-serif;
    font-weight: 600;
    letter-spacing: -0.01em;
}

/* Navigation et menus en Manrope pour la lisibilité */
nav, nav a, nav button {
    font-family: 'Manrope', sans-serif;
}

/* Boutons en Manrope */
button, a[class*="bg-"], a[class*="border-"] {
    font-family: 'Manrope', sans-serif;
}

/* Police Madi uniquement pour les citations et éléments très décoratifs */
.font-madi {
    font-family: 'MsMadi', cursive;
    font-weight: 400;
    font-size: 1.25rem;
    line-height: 1.4;
}

/* Paragraphes et texte courant en Manrope */
p, span, div, li, td, th, label, input, textarea, select {
    font-family: 'Manrope', sans-serif;
}

/* Badges et petits textes en Manrope */
span[class*="text-sm"], span[class*="text-xs"], .uppercase {
    font-family: 'Manrope', sans-serif;
    font-weight: 500;
}

/* Assurer que les titres h3 dans les cartes sont lisibles */
h3.text-xl {
    font-family: 'Manrope', sans-serif;
    font-weight: 600;
}

/* Espacement naturel et aéré */
section {
    padding: 5rem 0;
}

/* Section spécifique pour la page offres-remboursement-lentilles */
.sectionrbrsmt {
    padding: 1rem 0;
}

/* Effet de profondeur pour les images */
img {
    transition: transform 0.3s ease;
}

img:hover {
    transform: scale(1.02);
}

/* Style pour les boutons avec effet de matière */
.btn-primary {
    background: var(--jaune-dore);
    color: var(--gris-anthracite);
    box-shadow: 0 4px 14px 0 rgba(243, 201, 63, 0.25);
}

.btn-primary:hover {
    background: #E5B83A;
    box-shadow: 0 6px 20px 0 rgba(243, 201, 63, 0.35);
    transform: translateY(-1px);
}

/* Boutons RDV (hover orangé plus clair) */
.btn-rdv:hover {
    background-color: #FFD86A !important;
}

/* Navigation avec effet de transparence naturelle */
nav {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* Amélioration des contrastes pour l'accessibilité */
.text-gris-anthracite {
    color: var(--gris-anthracite);
}

.bg-gris-anthracite {
    background-color: var(--gris-anthracite);
}

/* Effets de lumière naturelle sur les éléments interactifs */
.hover-light {
    position: relative;
}

.hover-light::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, rgba(243, 201, 63, 0.1), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.hover-light:hover::before {
    opacity: 1;
}

/* Correction du hover pour les boutons Google Calendar */
[class*="hover:bg-jaune-dore"]:hover * {
    background-color: transparent !important;
    color: inherit !important;
}

[class*="hover:bg-jaune-dore"]:hover {
    background-color: #F3C93F !important;
}

/* Centrage parfait des icônes dans leurs conteneurs */
[class*="bg-jaune-dore/20"] {
    display: flex;
    align-items: center;
    justify-content: center;
}

[class*="bg-jaune-dore/20"] svg {
    display: block;
    margin: 0 auto;
}

/* Styles pour la galerie Collections (desktop). Sur mobile on passe en carousel via data-mobile-carousel. */
#gallery-thumbnails:not([data-mobile-carousel]) {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}

@media (min-width: 768px) {
    #gallery-thumbnails:not([data-mobile-carousel]) {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.75rem;
    }
}

.thumbnail-item {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    width: 100%;
}

.thumbnail-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(38, 38, 38, 0.15);
}

/* Style galerie luxueuse pour les collections */
.collection-item-luxury {
    box-shadow: 0 4px 12px rgba(38, 38, 38, 0.08);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.collection-item-luxury:hover {
    transform: scale(1.05);
    box-shadow: 0 16px 40px rgba(38, 38, 38, 0.25);
    z-index: 10;
}

.collection-item-luxury .collection-image-wrapper {
    overflow: hidden;
}

.collection-item-luxury:hover .collection-image-bw,
.collection-item-luxury:hover .collection-image-color {
    transform: scale(1.1);
    transition: transform 0.4s ease, opacity 0.4s ease;
}

/* Effet noir et blanc qui passe en couleur au survol pour les collections */
.collection-image-wrapper {
    position: relative;
    overflow: hidden;
}

.collection-image-bw {
    filter: grayscale(100%);
    transition: opacity 0.4s ease;
}

.collection-image-color {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.4s ease;
    object-fit: cover;
}

.collection-image-wrapper:hover .collection-image-bw {
    opacity: 0;
}

.collection-image-wrapper:hover .collection-image-color {
    opacity: 1;
}

/* Styles pour la visionneuse (Lightbox) */
#lightbox {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

#lightbox-image {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

#lightbox-title {
    animation: slideUp 0.3s ease-in-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Pluie de mini lunettes (activée via JS sur PC) */
.glasses-rain-layer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 40;
}

.glasses-rain-item {
    position: absolute;
    top: -12vh;
    left: 0;
    opacity: 0;
    transform: translate3d(var(--x, 50vw), 0, 0) rotate(var(--rot, 0deg));
    animation: glassesFall var(--dur, 7s) ease-in forwards;
    filter: drop-shadow(0 10px 18px rgba(38, 38, 38, 0.10));
    will-change: transform, opacity;
}

.glasses-rain-item svg {
    width: var(--size, 18px);
    height: var(--size, 18px);
    opacity: 0.55;
    color: rgba(38, 38, 38, 0.55);
}

@keyframes glassesFall {
    0% { opacity: 0; transform: translate3d(var(--x, 50vw), -6vh, 0) rotate(var(--rot, 0deg)); }
    8% { opacity: 0.55; }
    100% { opacity: 0; transform: translate3d(calc(var(--x, 50vw) + var(--drift, 40px)), 120vh, 0) rotate(calc(var(--rot, 0deg) + var(--spin, 120deg))); }
}

@media (prefers-reduced-motion: reduce) {
    .glasses-rain-item { animation: none !important; }
}

.carousel-btn {
    opacity: 0.9;
    transition: opacity 0.3s ease, transform 0.2s ease;
}

.carousel-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}

.carousel-btn:active {
    transform: scale(0.95);
}


/* Carrousel Maui Jim - Images en arrière-plan */
#maui-jim {
    position: relative;
    min-height: 500px;
}

#maui-jim-carousel {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

#maui-jim-carousel .carousel-container {
    display: flex;
    transition: transform 0.5s ease-in-out;
    height: 100%;
    width: 100%;
}

#maui-jim-carousel .carousel-slide {
    flex-shrink: 0;
    width: 100%;
    height: 100%;
    position: relative;
}

#maui-jim-carousel .carousel-slide img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    transition: opacity 0.5s ease-in-out;
    display: block;
}

/* Centrer l'image sur les lunettes pour la première image */
#maui-jim-carousel .carousel-slide:first-child img {
    object-position: center 30%;
}

/* Centrer l'image sur les lunettes pour la deuxième image */
#maui-jim-carousel .carousel-slide:last-child img {
    object-position: center 40%;
}

/* Bouton flip pour les numéros de téléphone FAQ (desktop uniquement) */
.phone-flip-btn {
    display: none;
}

@media (min-width: 768px) {
    .phone-button-container {
        perspective: 1000px;
        display: flex;
        justify-content: flex-start;
    }

    .phone-flip-btn {
        display: inline-flex;
        position: relative;
        width: auto;
        min-width: 200px;
        height: 56px;
        transform-style: preserve-3d;
        transition: transform 0.6s, width 0.6s ease-out;
        border: none;
    }

    .phone-flip-btn.flipped {
        transform: rotateY(180deg);
        width: auto;
        min-width: 480px;
        max-width: 100%;
    }

    .phone-flip-front,
    .phone-flip-back {
        position: absolute;
        width: 100%;
        height: 100%;
        backface-visibility: hidden;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 16px;
        left: 0;
        top: 0;
        padding: 0 24px;
        box-sizing: border-box;
    }

    .phone-flip-front {
        background-color: #F3C93F;
        color: #262626;
    }

    .phone-flip-back {
        background-color: #ffffff;
        color: #000000;
        transform: rotateY(180deg);
        white-space: nowrap;
        font-size: 16px;
        letter-spacing: 0.5px;
        overflow: visible;
        text-overflow: clip;
    }

    .phone-flip-back .phone-ou {
        color: #F3C93F;
        font-weight: bold;
        margin: 0 8px;
    }
}

/* Responsive pour tablettes et petits écrans desktop */
@media (min-width: 768px) and (max-width: 1024px) {
    .phone-flip-btn.flipped {
        min-width: 440px;
    }

    .phone-flip-back {
        font-size: 15px;
        padding: 0 20px;
    }
}

/* Responsive pour très petits écrans desktop */
@media (min-width: 768px) and (max-width: 900px) {
    .phone-flip-btn.flipped {
        min-width: 400px;
    }

    .phone-flip-back {
        font-size: 14px;
        padding: 0 18px;
        letter-spacing: 0.3px;
    }
}

/* Responsive pour écrans moyens */
@media (min-width: 1025px) and (max-width: 1280px) {
    .phone-flip-btn.flipped {
        min-width: 460px;
    }
}

#maui-jim-carousel .maui-jim-dot {
    cursor: pointer;
    transition: all 0.3s ease;
}

#maui-jim-carousel .maui-jim-dot.bg-white {
    width: 8px;
    height: 8px;
}

/* Lien Instagram avec les couleurs d'Instagram */
.instagram-link {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(225, 48, 108, 0.3);
}

.instagram-link:hover {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    box-shadow: 0 4px 12px rgba(225, 48, 108, 0.5);
}

.instagram-link svg {
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

/* Responsive pour le carrousel */
@media (max-width: 768px) {
    .carousel-btn {
        padding: 0.5rem;
    }
    
    .carousel-btn svg {
        width: 1.25rem;
        height: 1.25rem;
    }
    
    .carousel-slide img {
        height: 300px;
    }
}

