/* ========================================
   MEMOART V21 - ESTHÉTIQUE FINALE
   Contient : Layout, Grid, et TOUS les Templates
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&family=Bebas+Neue&family=Roboto:wght@300;400;500;700&family=Circular&family=Great+Vibes&family=Satisfy&family=Quicksand:wght@400;500;600;700&family=Oswald:wght@400;700&display=swap');

/* --- 1. LAYOUT & GRID (UNCHANGED) --- */
.preview-zone {
    text-align: center;
}

.preview-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: #1a1a1a;
}

/* CONTAINER PRINCIPAL */
.preview-container {
    position: relative;
    width: 100%;
    max-width: 350px;
    aspect-ratio: 3/4;
    margin: 0 auto 20px;
    background: transparent;
    border-radius: 4px;
    overflow: hidden !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

#frame-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    background: #FFFFFF;
}

#previewImage {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1);
    transform-origin: center center;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    object-fit: fill;
    /* Géré par JS V17 */
    z-index: 5 !important;
    opacity: 1 !important;
    display: block;
    cursor: grab;
    will-change: transform;
}

#previewImage:active {
    cursor: grabbing;
}

#templateOverlay {
    position: absolute;
    inset: 0;
    z-index: 10 !important;
    pointer-events: none;
    /* Drag Friendly */
}

.frame-border {
    position: absolute;
    inset: 0;
    z-index: 20 !important;
    pointer-events: none;
    border: 12px solid white;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.05);
}

.frame-border.frame-black {
    border-color: #1a1a1a;
}

/* UPLOAD & CONTROLS */
#uploadZone {
    position: absolute;
    inset: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #fff9f5;
    border: 2px dashed #e0e0e0;
    cursor: pointer;
    transition: all 0.2s;
}

#uploadZone:hover {
    background: #fff;
    border-color: #1a1a1a;
}

#uploadZone.hidden {
    display: none !important;
}

.upload-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: #1a1a1a;
}

.upload-text {
    font-family: 'Playfair Display', serif;
    font-size: 1.1rem;
    color: #1a1a1a;
}

.upload-hint {
    font-size: 0.8rem;
    color: #888;
    margin-top: 5px;
}

.controls-bar {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: center;
    margin-top: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.controls-bar.visible {
    opacity: 1;
    pointer-events: all;
}

.btn-secondary {
    padding: 8px 16px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    border-color: #1a1a1a;
    background: #f9f9f9;
}

/* CONFIG ZONE */
.config-zone {
    padding: 20px;
    background: #fff;
    border-radius: 16px;
}

.config-section {
    margin-bottom: 25px;
}

.config-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.1rem;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.template-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.template-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.template-btn:hover {
    border-color: #b0b0b0;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.template-btn.active {
    background: #1a1a1a;
    border-color: #1a1a1a;
    color: white;
}

.template-btn .icon {
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.template-btn .label {
    font-family: 'Playfair Display', serif;
    font-size: 0.75rem;
    font-weight: 500;
}

/* --- BADGE TOP (V30) --- */
.template-btn {
    position: relative;
    /* Essential for badge positioning */
}

.badge-top {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #000;
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    z-index: 10;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.template-btn.is-popular {
    border: 2px solid #000;
    /* Pre-select effect */
}

.input-group {
    margin-bottom: 15px;
}

.input-label {
    display: block;
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 6px;
}

.input-field {
    width: 100%;
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    transition: border-color 0.2s;
}

.input-field:focus {
    outline: none;
    border-color: #1a1a1a;
}

.size-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.size-btn {
    padding: 12px 5px;
    text-align: center;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.size-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    border-color: #ccc;
}

.size-btn:active {
    transform: scale(0.98);
}

/* PRICE ANIMATION (JS) */
.fade-price {
    opacity: 0;
    transform: translateY(5px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.size-btn.active {
    background: #f5f5f5;
    border-color: #1a1a1a;
    font-weight: 600;
}

.size-name {
    font-size: 0.85rem;
    display: block;
}

.size-price {
    font-size: 0.75rem;
    color: #888;
    margin-top: 2px;
    display: block;
}

/* --- LAUNCH BADGE (V29) --- */
.launch-badge {
    background-color: #333;
    color: white;
    padding: 3px 6px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    border-radius: 4px;
    margin-left: 10px;
    align-self: center;
    /* Vertically center in flex container */
    display: inline-block;
}

@media (min-width: 900px) {
    .product-layout {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 60px;
        align-items: start;
        max-width: 1000px;
        margin: 0 auto;
    }
}


/* --- 2. TEMPLATES CSS (V21 FINAL POLISH) --- */

/* RESET OVERLAYS */
[class^="overlay-"] {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

/* === NETFLIX (PARFAIT V17) === */
.overlay-netflix {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    font-family: 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.6) 40%, transparent 100%);
}

.netflix-genre {
    position: absolute;
    top: 20px;
    left: 20px;
    background: #E50914;
    color: white;
    padding: 2px 4px;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.2rem;
    letter-spacing: 1px;
    line-height: 1;
    text-transform: uppercase;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
}

.netflix-genre::before {
    content: '';
    display: inline-block;
    width: 2px;
    height: 100%;
    background: rgba(0, 0, 0, 0.1);
    margin-right: 4px;
}

.netflix-content {
    padding: 20px 25px 35px;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    background: transparent;
}

.netflix-tag {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
}

.netflix-tag-icon {
    width: 14px;
    height: 14px;
    background: #E50914;
    border-radius: 2px;
}

.netflix-tag-text {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: #e5e5e5;
}

.netflix-title {
    font-family: 'Impact', 'Bebas Neue', sans-serif;
    font-size: 2.2rem;
    line-height: 0.95;
    text-transform: uppercase;
    margin-bottom: 12px;
    letter-spacing: -0.5px;
}

.netflix-buttons {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.netflix-btn-lecture {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    color: black;
    padding: 8px 18px;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 700;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.netflix-btn-lecture::before {
    content: '▶';
    font-size: 0.8rem;
}

.netflix-btn-icon {
    width: 32px;
    height: 32px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.1rem;
    background: rgba(0, 0, 0, 0.3);
}

.netflix-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.8rem;
    font-weight: 500;
}

.netflix-match {
    color: #46D369;
    font-weight: 700;
}

.netflix-hd {
    border: 1px solid #999;
    padding: 0 4px;
    border-radius: 2px;
    font-size: 0.6rem;
}

.netflix-description {
    margin-top: 8px;
    font-size: 0.8rem;
    line-height: 1.3;
    color: #dedede;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.netflix-photo-zone {
    display: none;
}


/* === SPOTIFY (V21 - LOGO FIX & IMMERSIVE) === */
.overlay-spotify {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    font-family: 'Circular', 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.6) 40%, transparent 100%);
}

/* FIX V21: LOGO ABSOLU DISCRET */
.spotify-logo {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 30px;
    /* Petit et discret */
    height: 30px;
    z-index: 30;
    /* Si c'est une image dans le HTML/JS, on s'assure qu'elle fit */
}

.spotify-logo svg,
.spotify-logo img {
    width: 100%;
    height: 100%;
    fill: white;
}


.spotify-cover-zone {
    flex: 1;
    background: transparent;
}

.spotify-cover-placeholder {
    display: none;
}

.spotify-content {
    background: transparent;
    padding: 10px 25px 35px;
    z-index: 20;
    width: 100%;
    box-sizing: border-box;
}

.spotify-track-info {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 20px;
}

.spotify-track-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.spotify-title {
    color: white;
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 4px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.spotify-artist {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
    font-weight: 500;
}

.spotify-like {
    color: #1DB954;
    font-size: 1.6rem;
    padding-left: 15px;
    margin-bottom: 5px;
}

.spotify-progress-container {
    width: 100%;
    margin-bottom: 5px;
}

.spotify-progress-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    width: 100%;
    overflow: hidden;
}

.spotify-progress-fill {
    width: 30%;
    height: 100%;
    background: #1DB954;
    position: relative;
}

.spotify-progress-fill::after {
    content: '';
    position: absolute;
    right: 0;
    top: -2px;
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.spotify-time {
    display: flex;
    justify-content: space-between;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.75rem;
    margin-top: 6px;
}

.spotify-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 15px;
    padding: 0 10px;
}

.spotify-ctrl-btn {
    color: white;
    font-size: 1.8rem;
    opacity: 0.9;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.spotify-play-btn {
    width: 55px;
    height: 55px;
    background: #1DB954;
    color: black;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    padding-left: 4px;
}


/* === INSTAGRAM (V21 - FOOTER STRUCTURÉ) === */
.overlay-instagram {
    display: flex;
    flex-direction: column;
}

.insta-header {
    background: white;
    padding: 12px 15px;
    display: flex;
    align-items: center;
    z-index: 20;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.05);
}

.insta-avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    padding: 2px;
    border-radius: 50%;
    margin-right: 10px;
}

.insta-avatar-inner {
    width: 100%;
    height: 100%;
    background: #ddd;
    border-radius: 50%;
}

.insta-user-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.insta-username {
    font-weight: 600;
    font-size: 0.85rem;
    color: #262626;
}

.insta-location {
    font-size: 0.75rem;
    color: #262626;
}

.insta-more {
    font-weight: 700;
    color: #262626;
}

.insta-photo-zone {
    flex: 1;
    background: transparent;
}

.insta-footer {
    background: white;
    padding: 12px 15px;
    z-index: 20;
    box-shadow: 0 -1px 5px rgba(0, 0, 0, 0.05);
    /* FIX V21: COLONNE STRICTE */
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.insta-actions {
    display: flex;
    align-items: center;
    margin-bottom: 0;
}

.insta-actions-left {
    display: flex;
    gap: 16px;
}

.insta-action-icon svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: #262626;
    stroke-width: 1.8;
}

.insta-bookmark {
    margin-left: auto;
}

.insta-likes {
    font-weight: 600;
    font-size: 0.9rem;
    color: #262626;
    margin-bottom: 0;
    text-align: left;
}

.insta-caption {
    font-size: 0.9rem;
    color: #262626;
    line-height: 1.4;
    text-align: left;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.insta-caption-user {
    font-weight: 600;
    margin-right: 5px;
}


/* === MARIAGE (UNCHANGED) === */
.overlay-mariage {
    box-sizing: border-box;
    border: 30px solid white;
    background: transparent;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 20px;
}

.mariage-header {
    text-align: center;
    background: rgba(255, 255, 255, 0.95);
    padding: 15px;
    border-radius: 2px;
}

.mariage-names {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    color: #1a1a1a;
    font-weight: 700;
    margin-bottom: 5px;
}

.mariage-divider {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 8px 0;
    opacity: 0.5;
}

.mariage-divider-line {
    width: 30px;
    height: 1px;
    background: #000;
}

.mariage-divider-diamond {
    width: 6px;
    height: 6px;
    background: #000;
    transform: rotate(45deg);
}

.mariage-date {
    font-family: 'Playfair Display', serif;
    font-size: 1rem;
    color: #666;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.mariage-footer {
    text-align: center;
    padding: 10px;
}

.mariage-text {
    font-family: 'Great Vibes', cursive;
    font-size: 1.5rem;
    color: #444;
    text-shadow: 0 1px 3px white;
}

.mariage-heart {
    color: #d4a5a5;
}

.mariage-corner {
    position: absolute;
    width: 40px;
    height: 40px;
    border: 1px solid #1a1a1a;
    opacity: 0.3;
}

.mariage-corner.top-left {
    top: 15px;
    left: 15px;
    border-right: none;
    border-bottom: none;
}

.mariage-corner.top-right {
    top: 15px;
    right: 15px;
    border-left: none;
    border-bottom: none;
}

.mariage-corner.bottom-left {
    bottom: 15px;
    left: 15px;
    border-right: none;
    border-top: none;
}

.mariage-corner.bottom-right {
    bottom: 15px;
    right: 15px;
    border-left: none;
    border-top: none;
}


/* === BÉBÉ (V22 - DOUCEUR & ÉMOTION) === */
.overlay-bebe {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    /* Cadre interne blanc doux */
    box-shadow: inset 0 0 0 15px rgba(255, 255, 255, 0.8);
    /* Dégradé bas subtil */
    background: linear-gradient(to top, rgba(255, 255, 255, 0.6) 0%, transparent 40%);
    padding-bottom: 30px;
}

.bebe-footer {
    text-align: center;
    /* Plus de boîte flottante, direct sur le dégradé */
    text-shadow: 0 2px 10px rgba(255, 255, 255, 0.8);
    background: transparent;
    box-shadow: none;
    padding: 0;
}

.bebe-footer::before {
    content: none;
}

/* On retire l'emoji V21 */

.bebe-name {
    font-family: 'Great Vibes', cursive;
    /* Elegant Script */
    font-size: 3rem;
    color: #4a4a4a;
    /* Gris doux */
    font-weight: 400;
    margin-bottom: 5px;
    line-height: 1;
}

.bebe-date {
    font-family: 'Quicksand', sans-serif;
    font-size: 1rem;
    color: #666;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.bebe-date::after {
    content: '♡';
    color: #eebbcc;
    font-size: 1.2rem;
}

.bebe-photo-zone,
.bebe-icon {
    display: none;
}


/* === VACANCES (V22 - SOUVENIR PREMIUM) === */
.overlay-vacances {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    /* Vignettage sombre */
    box-shadow: inset 0 0 100px rgba(0, 0, 0, 0.3);
    padding-bottom: 40px;
}

.vacances-footer {
    position: static;
    /* Centré en bas */
    text-align: center;
    transform: none;
    /* Plus de biais */
}

/* Icone Boussole/Avion */
.vacances-footer::before {
    content: '✈';
    /* Avion minimaliste */
    display: block;
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 15px;
}

.vacances-title {
    font-family: 'Playfair Display', serif;
    /* Elegant Serif */
    font-size: 2rem;
    color: #fff;
    /* Crème/Blanc */
    text-transform: uppercase;
    letter-spacing: 3px;
    font-weight: 400;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    margin-bottom: 5px;
}

.vacances-location {
    font-family: 'Roboto', sans-serif;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.5);
}


.vacances-photo-zone {
    display: none;
}

/* ========================================
   REVIEWS GRID (IMPORTED FROM PAGES.CSS)
   ======================================== */
.reviews-masonry {
    padding: 60px 0;
    background: #F9F5F0;
    /* Cream background */
    margin-top: 40px;
    /* Add margin to separate from previous section */
}

/* Container: Force Grid */
.masonry-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

/* Card Style */
.review-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: transform 0.3s ease;
}

.review-card:hover {
    transform: translateY(-5px);
}

/* Image Style - Force Square */
.review-image {
    width: 100%;
    padding-bottom: 100%;
    position: relative;
    overflow: hidden;
    margin: 0;
}

.review-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Content Style */
.review-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.review-stars {
    color: #FFC107;
    font-size: 0.9rem;
    margin-bottom: 12px;
}

.review-text {
    font-size: 0.95rem;
    color: #444;
    line-height: 1.6;
    margin-bottom: 15px;
    font-style: italic;
    flex-grow: 1;
}

.review-author {
    font-weight: 700;
    font-size: 0.9rem;
    color: #1a1a1a;
}

/* Responsive */
@media (max-width: 1024px) {
    .masonry-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .masonry-grid {
        grid-template-columns: 1fr;
    }
}