@import url('https://fonts.googleapis.com/css2?family=Mountains+of+Christmas:wght@400;700&family=Nunito:wght@400;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-red: #c8102e;
    --primary-green: #228b22;
    --gold: #ffd700;
    --dark-green: #0f5132;
    --light-bg: #fff9f0;
    --card-bg: #ffffff;
    --shadow: rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Nunito', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 25%, #f093fb 50%, #4facfe 75%, #00f2fe 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    min-height: 100vh;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
    margin: 0;
    box-sizing: border-box;
    width: 100%;
}

html {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Flocons de neige */
.snowflakes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    overflow: hidden;
}

.snowflake {
    position: absolute;
    top: -10px;
    font-size: 20px;
    color: white;
    opacity: 0.8;
    animation: snowfall linear infinite;
}

@keyframes snowfall {
    0% {
        transform: translateY(0) translateX(0) rotate(0deg);
        opacity: 0.8;
    }
    100% {
        transform: translateY(100vh) translateX(100px) rotate(360deg);
        opacity: 0;
    }
}

.snowflake:nth-child(1) { left: 10%; animation-duration: 10s; animation-delay: 0s; }
.snowflake:nth-child(2) { left: 20%; animation-duration: 12s; animation-delay: 1s; }
.snowflake:nth-child(3) { left: 30%; animation-duration: 11s; animation-delay: 2s; }
.snowflake:nth-child(4) { left: 40%; animation-duration: 13s; animation-delay: 0.5s; }
.snowflake:nth-child(5) { left: 50%; animation-duration: 10s; animation-delay: 1.5s; }
.snowflake:nth-child(6) { left: 60%; animation-duration: 12s; animation-delay: 2.5s; }
.snowflake:nth-child(7) { left: 70%; animation-duration: 11s; animation-delay: 0.8s; }
.snowflake:nth-child(8) { left: 80%; animation-duration: 13s; animation-delay: 1.2s; }
.snowflake:nth-child(9) { left: 90%; animation-duration: 10s; animation-delay: 2.2s; }
.snowflake:nth-child(10) { left: 15%; animation-duration: 12s; animation-delay: 0.3s; }
.snowflake:nth-child(11) { left: 35%; animation-duration: 11s; animation-delay: 1.8s; }
.snowflake:nth-child(12) { left: 65%; animation-duration: 13s; animation-delay: 0.7s; }

/* Header */
header {
    text-align: center;
    margin-bottom: 40px;
    padding: 40px 20px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 10px 30px var(--shadow);
    position: relative;
    z-index: 10;
    animation: bounceIn 1s ease-out;
    width: 100%;
    box-sizing: border-box;
}

.header-content {
    max-width: 800px;
    margin: 0 auto;
}

@keyframes bounceIn {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

header h1 {
    font-family: 'Mountains of Christmas', cursive;
    font-size: 3.5rem;
    color: var(--primary-red);
    margin-bottom: 10px;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.2);
    animation: wiggle 3s ease-in-out infinite;
}

@keyframes wiggle {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-2deg); }
    75% { transform: rotate(2deg); }
}

.subtitle {
    font-size: 1.3rem;
    color: var(--dark-green);
    font-weight: 600;
    margin-bottom: 15px;
}

.header-decoration {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 15px;
}

.header-decoration .decoration {
    font-size: 2rem;
    animation: float 3s ease-in-out infinite;
}

.header-decoration .decoration:nth-child(2) {
    animation-delay: 0.5s;
}

.header-decoration .decoration:nth-child(3) {
    animation-delay: 1s;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

/* Intro Section */
.intro-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 40px;
    text-align: center;
    box-shadow: 0 8px 25px var(--shadow);
    position: relative;
    z-index: 10;
}

.intro-text {
    font-size: 1.1rem;
    color: #555;
    line-height: 1.8;
    margin-bottom: 20px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.product-count {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary-red), #ff6b6b);
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    font-weight: 700;
    font-size: 1.1rem;
    box-shadow: 0 4px 15px rgba(200, 16, 46, 0.3);
}

.product-count span {
    font-size: 1.3rem;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    z-index: 10;
    padding: 0 20px;
    box-sizing: border-box;
}

/* Grille de cadeaux */
.gifts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

/* Carte de cadeau (fiche produit) */
.gift-card {
    background: var(--card-bg);
    border-radius: 20px;
    overflow: visible;
    box-shadow: 0 8px 25px var(--shadow);
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    position: relative;
    display: flex;
    flex-direction: column;
    animation: fadeInUp 0.6s ease-out backwards;
    cursor: default;
}

.gift-image-link,
.gift-image-link > div {
    overflow: hidden;
    border-radius: 20px 20px 0 0;
}

.gift-card a,
.gift-card button {
    pointer-events: auto;
    position: relative;
    z-index: 20;
}

.gift-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transform: rotate(45deg);
    transition: all 0.6s;
    opacity: 0;
    pointer-events: none;
    z-index: 1;
}

.gift-card:hover::before {
    left: 100%;
    opacity: 1;
}

.gift-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.25);
}

.gift-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: linear-gradient(135deg, var(--gold), #ffeb3b);
    color: #333;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    z-index: 100;
    box-shadow: 0 3px 10px rgba(255, 215, 0, 0.4);
    animation: pulse 2s ease-in-out infinite;
    display: block !important;
    min-width: 50px;
    text-align: center;
    white-space: nowrap;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: none;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

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

.gift-card:nth-child(1) { animation-delay: 0.1s; }
.gift-card:nth-child(2) { animation-delay: 0.2s; }
.gift-card:nth-child(3) { animation-delay: 0.3s; }
.gift-card:nth-child(4) { animation-delay: 0.4s; }
.gift-card:nth-child(5) { animation-delay: 0.5s; }
.gift-card:nth-child(6) { animation-delay: 0.6s; }
.gift-card:nth-child(7) { animation-delay: 0.7s; }
.gift-card:nth-child(8) { animation-delay: 0.8s; }
.gift-card:nth-child(9) { animation-delay: 0.9s; }
.gift-card:nth-child(10) { animation-delay: 1s; }
.gift-card:nth-child(11) { animation-delay: 1.1s; }
.gift-card:nth-child(12) { animation-delay: 1.2s; }
.gift-card:nth-child(13) { animation-delay: 1.3s; }
.gift-card:nth-child(14) { animation-delay: 1.4s; }
.gift-card:nth-child(15) { animation-delay: 1.5s; }
.gift-card:nth-child(16) { animation-delay: 1.6s; }

.gift-image-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.gift-image {
    width: 100%;
    height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.gift-image-link:hover .gift-image {
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.gift-emoji {
    font-size: 6rem;
    filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.2));
    animation: bounce 2s ease-in-out infinite;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.gift-product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gift-card:hover .gift-product-image {
    transform: scale(1.05);
}

.gift-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gift-info {
    padding: 25px;
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 10;
}

.gift-category {
    font-size: 0.85rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    font-weight: 600;
}

.gift-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 12px;
    line-height: 1.3;
    min-height: 60px;
}

.gift-description {
    font-size: 0.95rem;
    color: #666;
    line-height: 1.6;
    margin-bottom: 20px;
    flex: 1;
}

.gift-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--primary-red), #ff6b6b);
    color: white;
    text-decoration: none;
    padding: 14px 24px;
    border-radius: 25px;
    font-weight: 700;
    font-size: 1rem;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(200, 16, 46, 0.3);
    margin-top: auto;
    width: 100%;
    text-align: center;
    position: relative;
    z-index: 10;
    cursor: pointer;
    pointer-events: auto;
}

.gift-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(200, 16, 46, 0.5);
    background: linear-gradient(135deg, #ff6b6b, var(--primary-red));
}

.gift-link .link-icon {
    transition: transform 0.3s;
}

.gift-link:hover .link-icon {
    transform: rotate(45deg) scale(1.2);
}

.gift-link span:first-child {
    display: flex;
    align-items: center;
    gap: 5px;
}

.gift-no-link {
    background: linear-gradient(135deg, var(--primary-green), #32cd32);
    color: white;
    padding: 14px 24px;
    border-radius: 25px;
    font-weight: 700;
    font-size: 1rem;
    text-align: center;
    margin-top: auto;
    box-shadow: 0 4px 15px rgba(34, 139, 34, 0.3);
}

/* Footer */
footer {
    text-align: center;
    padding: 30px 20px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 10px 30px var(--shadow);
    margin-top: 40px;
    position: relative;
    z-index: 10;
}

footer p {
    font-size: 1.2rem;
    color: var(--dark-green);
    margin-bottom: 10px;
    font-weight: 600;
}

.footer-note {
    font-size: 0.9rem;
    color: #888;
    font-style: italic;
}

/* Responsive */
@media (max-width: 768px) {
    header h1 {
        font-size: 2.5rem;
    }

    .subtitle {
        font-size: 1.1rem;
    }

    .gifts-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .gift-card {
        max-width: 100%;
    }

    .gift-image {
        height: 220px;
    }

    .gift-emoji {
        font-size: 4rem;
    }

    .gift-info {
        padding: 20px;
    }

    .gift-title {
        font-size: 1.3rem;
        min-height: auto;
    }

    .gift-description {
        font-size: 0.9rem;
    }

    .modal-content {
        padding: 25px;
        margin: 10% auto;
    }

    #results-modal h2 {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 2rem;
    }

    .gift-image {
        height: 200px;
    }

    .gift-emoji {
        font-size: 3.5rem;
    }

    .gift-link {
        padding: 12px 20px;
        font-size: 0.9rem;
    }
}

