/* Variables de couleurs */
:root {
    --primary-color: #6a1b9a;
    --secondary-color: #4a148c;
    --accent-color: #9c27b0;
    --text-light: #ffffff;
    --text-dark: #333333;
    --gradient-primary: linear-gradient(135deg, #6a1b9a 0%, #4a148c 100%);
    --gradient-header: linear-gradient(rgba(74, 20, 140, 0.8), rgba(106, 27, 154, 0.8));
}

/* Optimisations de performance */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

/* Préchargement des images critiques */
.preload {
    content-visibility: auto;
    contain-intrinsic-size: 1px 500px;
}

/* Optimisation des transitions */
.optimized-transition {
    will-change: transform;
    transform: translateZ(0);
}

/* Optimisations pour les images */
img {
    /* Les attributs loading et decoding sont des attributs HTML, pas CSS */
    /* Ils doivent être définis directement dans les balises <img> */
}

/* Critical images - optimisations spécifiques */
img.critical {
    /* Pas de lazy loading pour les images critiques */
}

/* Carrousel de produits */
.product-carousel {
    background: #f0f0f0;
    padding: 60px 0;
    overflow: hidden;
    position: relative;
    min-height: 500px;
}

.carousel-container {
    width: 100%;
    overflow: hidden;
    height: 400px;
    display: flex;
    align-items: center;
    margin-top: 40px;
    position: relative;
}

.carousel-track {
    display: flex;
    gap: 20px;
    width: fit-content;
    transition: transform 0.1s ease;
    will-change: transform;
}

.carousel-item {
    flex-shrink: 0;
    width: 280px;
    height: 380px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    background: white;
    position: relative;
}

.carousel-item:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
    z-index: 10;
}

.carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.carousel-item:hover img {
    transform: scale(1.05);
}

/* Effet de fondu sur les bords */
.carousel-container::before,
.carousel-container::after {
    content: '';
    position: absolute;
    top: 0;
    width: 100px;
    height: 100%;
    z-index: 5;
    pointer-events: none;
}

.carousel-container::before {
    left: 0;
    background: linear-gradient(to right, #f0f0f0, transparent);
}

.carousel-container::after {
    right: 0;
    background: linear-gradient(to left, #f0f0f0, transparent);
}

@media (max-width: 768px) {
    .carousel-item {
        width: 250px;
        height: 350px;
    }
    
    .carousel-track {
        gap: 15px;
    }
    
    .carousel-container {
        height: 370px;
    }
}

@media (max-width: 576px) {
    .carousel-item {
        width: 200px;
        height: 300px;
    }
    
    .carousel-container {
        height: 320px;
    }
}

/* Styles globaux */
body {
    font-family: 'Roboto', sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
    font-display: swap;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Header et Navigation */
.navbar {
    background: var(--gradient-primary) !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.navbar-dark .navbar-nav .nav-link {
    color: var(--text-light);
    font-weight: 500;
    transition: color 0.3s ease;
}

.navbar-dark .navbar-nav .nav-link:hover {
    color: rgba(255,255,255,0.9);
    transform: translateY(-2px);
}

/* Hero Section */
.hero {
    position: relative;
    background: url('../images/header.jpeg') no-repeat center center;
    background-size: cover;
    min-height: 100vh;
    padding: 100px 0;
    display: flex;
    align-items: center;
    text-align: center;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4); /* Overlay légèrement plus transparent pour mieux voir l'image */
    z-index: 1;
}

.hero .container {
    position: relative;
    z-index: 2; /* Place le contenu au-dessus de l'overlay */
}

.hero h1 {
    color: #ffffff;
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.hero .lead {
    color: #ffffff;
    font-size: 1.8rem;
    margin-bottom: 2rem;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
}

.hero img.rounded-circle {
    border: 4px solid #ffffff;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
    margin-bottom: 2rem;
    position: relative;
    z-index: 2;
}

/* Sections */
section {
    padding: 80px 0;
}

section:nth-child(odd) {
    background-color: #f8f9fa;
}

.section-title {
    color: var(--primary-color);
    margin-bottom: 3rem;
    position: relative;
    text-align: center;
}

/* Cards et conteneurs */
.card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
}

.artist-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.artist-card:hover {
    transform: translateY(-5px);
}

.artist-card img {
    width: 100%;
    height: 300px;
    object-fit: cover;
}

/* Boutons */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    padding: 10px 25px;
    border-radius: 25px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    transform: translateY(-2px);
}

/* Store button glow effect */
.store-btn {
    padding: 15px 40px;
    font-size: 1.2rem;
    border-radius: 50px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: glow 2s ease-in-out infinite alternate;
    position: relative;
}

.store-btn::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    border-radius: 50px;
    background: linear-gradient(45deg, #6a1b9a, #9c27b0, #4a148c);
    z-index: -1;
    filter: blur(15px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.store-btn:hover::before {
    opacity: 1;
}

@keyframes glow {
    from {
        box-shadow: 0 0 5px rgba(255,255,255,0.6),
                    0 0 10px rgba(255,255,255,0.4),
                    0 0 15px rgba(106,27,154,0.3),
                    0 0 20px rgba(106,27,154,0.2);
    }
    to {
        box-shadow: 0 0 10px rgba(255,255,255,0.8),
                    0 0 20px rgba(255,255,255,0.6),
                    0 0 30px rgba(106,27,154,0.4),
                    0 0 40px rgba(106,27,154,0.3);
    }
}

/* Timeline */
.timeline {
    position: relative;
    padding: 20px 0;
}

.timeline-item {
    padding: 20px;
    margin-bottom: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Chatbot */
.chatbot-container {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 350px;
    height: 450px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    display: none;
    z-index: 1000;
    overflow: hidden;
}

.chatbot-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #8e44ad 0%, #9b59b6 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s;
}

.chatbot-toggle:hover {
    transform: scale(1.1);
    background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%);
}

.chatbot-toggle i {
    color: white;
    font-size: 24px;
}

.chatbot-header {
    background: linear-gradient(135deg, #8e44ad 0%, #9b59b6 100%);
    color: white;
    padding: 15px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chatbot-messages {
    height: calc(100% - 110px);
    padding: 15px;
    overflow-y: auto;
}

.chatbot-input {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 10px;
    background: #f8f9fa;
}

.chatbot-input input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
}

.chatbot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 350px;
    max-height: 500px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    overflow: hidden;
}

.chatbot-header {
    background: #343a40;
    color: white;
    padding: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chatbot-messages {
    height: 350px;
    overflow-y: auto;
    padding: 15px;
}

.chatbot-input {
    padding: 10px;
    border-top: 1px solid #eee;
}

.chatbot-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #343a40;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 999;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.message {
    margin-bottom: 10px;
    padding: 8px 12px;
    border-radius: 15px;
    max-width: 80%;
}

.user-message {
    background: #e9ecef;
    margin-left: auto;
}

.bot-message {
    background: #007bff;
    color: white;
}

/* Animations */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Footer */
footer {
    background: var(--gradient-primary) !important;
    color: var(--text-light);
    padding: 40px 0;
}

footer a {
    color: var(--text-light);
    text-decoration: none;
    transition: opacity 0.3s ease;
}

footer a:hover {
    opacity: 0.8;
    color: var(--text-light);
}

/* Chatbot */
.chatbot-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #007bff;
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    z-index: 1000;
}

.chatbot-container {
    display: none;
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 300px;
    height: 400px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
}

.chatbot-header {
    padding: 15px;
    background: #007bff;
    color: white;
    border-radius: 10px 10px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
}

.chatbot-messages {
    height: 300px;
    padding: 15px;
    overflow-y: auto;
}

.message {
    margin: 10px 0;
    padding: 10px;
    border-radius: 10px;
    max-width: 80%;
}

.user-message {
    background: #e9ecef;
    margin-left: auto;
}

.bot-message {
    background: #007bff;
    color: white;
}

.chatbot-input {
    padding: 15px;
    border-top: 1px solid #dee2e6;
}

.chatbot-input input {
    width: 100%;
    padding: 8px;
    border: 1px solid #dee2e6;
    border-radius: 5px;
}

/* Footer styles */
.footer {
    background: #333;
    color: white;
    padding: 20px 0;
    text-align: center;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.footer-links a {
    color: white;
    text-decoration: none;
    margin: 0 10px;
}

.footer-links a:hover {
    text-decoration: underline;
}

/* Store Section Styles */
.bg-gradient {
    background: var(--gradient-primary);
}

.store-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.store-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

.store-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.store-card .card-title {
    color: var(--primary-color);
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.store-card .card-text {
    color: var(--text-dark);
    font-size: 1.1rem;
    line-height: 1.6;
}

.features-list {
    margin: 1.5rem 0;
}

.features-list .badge {
    margin: 0.3rem;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
}

.store-btn {
    padding: 15px 40px;
    font-size: 1.2rem;
    border-radius: 50px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: glow 2s ease-in-out infinite alternate;
    position: relative;
}

.store-btn::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    border-radius: 50px;
    background: linear-gradient(45deg, #6a1b9a, #9c27b0, #4a148c);
    z-index: -1;
    filter: blur(15px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.store-btn:hover::before {
    opacity: 1;
}

@keyframes glow {
    from {
        box-shadow: 0 0 5px rgba(255,255,255,0.6),
                    0 0 10px rgba(255,255,255,0.4),
                    0 0 15px rgba(106,27,154,0.3),
                    0 0 20px rgba(106,27,154,0.2);
    }
    to {
        box-shadow: 0 0 10px rgba(255,255,255,0.8),
                    0 0 20px rgba(255,255,255,0.6),
                    0 0 30px rgba(106,27,154,0.4),
                    0 0 40px rgba(106,27,154,0.3);
    }
}

/* Store section responsive adjustments */
@media (max-width: 768px) {
    .store-card {
        margin-bottom: 2rem;
    }
    
    .store-icon {
        font-size: 2.5rem;
    }
    
    .store-card .card-title {
        font-size: 1.5rem;
    }
    
    .features-list .badge {
        font-size: 0.8rem;
    }
}

/* --- Klym89 / K89C logo helpers and responsive iframe --- */
/* Use these classes on <img> tags: .klym89-logo or .site-logo */
.klym89-logo,
.k89c-hero-logo,
.site-logo {
    width: 160px;       /* default display size - adjust if needed */
    max-width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
}

/* larger hero variation when needed */
.k89c-hero-logo {
    width: 260px;
    max-width: 45vw;
}

/* Responsive iframe wrapper (for Stripe climate badge or other embeds) */
.iframe-responsive {
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    display: block;
}

.iframe-responsive iframe,
.stripe-iframe {
    width: 100%;
    height: 48px; /* default small badge height; increase to 160px for larger embeds if necessary */
    border: 0;
    display: block;
}

@media (max-width: 576px) {
    .klym89-logo { width: 120px; }
    .k89c-hero-logo { width: 140px; }
    .iframe-responsive iframe, .stripe-iframe { height: 42px; }
}
