/* Gift Card Styles */
/* Apply border-box sizing to all elements for consistent sizing */
*, *:before, *:after {
    box-sizing: border-box;
}

/* Page background */
.gift-card-page {
    background-color: #222222;
    min-height: 100vh;
    padding: 30px 10px; /* Add horizontal padding */
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    box-sizing: border-box; /* Include padding in width calculation */
    overflow-x: hidden; /* Prevent horizontal scrolling */
}

/* Container styles */
.gift-card-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 80px 20px 20px;
    text-align: center;
    height: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Logo container */
.logo-container {
    margin-bottom: 40px;
}

.logo-container img {
    max-height: 100px;
    width: auto;
    filter: brightness(1.2); /* Make logo stand out against dark background */
}

/* Gift card wrapper */
.gift-card-wrapper {
    perspective: 1000px;
    margin: 0 auto 50px;
    width: 100%;
    max-width: 500px;
    /* Credit card aspect ratio is approximately 1.586:1 (85.60mm × 53.98mm) */
    aspect-ratio: 1.586 / 1;
    min-width: 320px; /* Minimum width on mobile */
    cursor: pointer; /* Indicate it's clickable */
}

/* Gift card */
.gift-card {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    will-change: transform; /* Hardware acceleration hint */
}

/* Flip animation when .flipped class is added */
.gift-card.flipped .gift-card-inner {
    transform: rotateY(180deg);
}

/* Gift card inner container for 3D effect */
.gift-card-inner {
    background-color: #222222;
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Gift card front and back */
.gift-card-front,
.gift-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Front of the card with logo image */
.gift-card-front {
    background: url('https://elixirdudesir.fr/wp-content/uploads/2025/05/LOGO_CARTE.png') center center no-repeat;
    background-size: cover;
    color: #222;
}

/* Back of the card with dark background */
.gift-card-back {
    background: #1b1b1b;
    color: white;
    transform: rotateY(180deg);
    position: relative;
}

/* Flip arrow icon */
.flip-arrow-icon {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    background-color: rgba(171, 138, 98, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.3s ease, background-color 0.3s ease;
}

.gift-card-wrapper:hover .flip-arrow-icon {
    opacity: 1;
}

.flip-arrow-icon:hover {
    background-color: rgba(171, 138, 98, 0.5);
}

.flip-arrow-icon i {
    color: #ab8a62;
    font-size: 18px;
}

/* Gift card content */
.gift-card-content {
    padding: 30px;
    text-align: center;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: end;
}

.gift-card-back .gift-card-content {
    justify-content: space-between;
}

/* Card logo on front */
.card-logo {
    margin: 0 auto 20px;
    max-width: 200px;
}

.card-logo img {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.2));
}

/* Click instruction */
.card-instruction {
    font-size: 16px;
    font-style: italic;
    opacity: 0.8;
    font-family: 'Barlow Condensed', sans-serif;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #fff;
    position: absolute;
    top: -50px;
    left: 0;
    width: 100%;
    text-align: center;
    z-index: 10;
}

.gift-card-content h2 {
    font-size: 32px;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 3px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    font-family: 'Barlow Condensed', sans-serif;
    color: #ab8a62;
}

.gift-card-amount {
    font-size: 52px;
    font-weight: bold;
    margin-bottom: 20px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    color: #ab8a62;
}

/* Promo code on the card */
.promo-code-container {
    margin-top: 20px;
}

.promo-code-label {
    font-size: 16px;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 3px;
    font-family: 'Barlow Condensed', sans-serif;
    color: #ab8a62;
}

.promo-code-area {
    position: relative;
    width: 80%;
    height: 60px;
    margin: 0 auto;
    background-color: rgba(171, 138, 98, 0.1);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(171, 138, 98, 0.3);
}

.promo-code-reveal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    letter-spacing: 3px;
    color: #ab8a62;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.5s;
    font-family: 'Barlow Condensed', sans-serif;
}

.promo-code-reveal.revealed {
    opacity: 1;
}

.scratch-area {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

/* Gift message on the back */
.gift-message {
    margin-top: 20px;
}

.gift-message-label {
    font-size: 16px;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.gift-message p {
    font-size: 16px;
    line-height: 1.6;
    color: #fff;
    font-style: italic;
}

/* Gift card details below the card */
.gift-card-details {
    max-width: 500px;
    margin: 0 auto;
    padding: 30px;
    background-color: rgba(171, 138, 98, 0.05);
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    color: #fff;
    border: 1px solid rgba(171, 138, 98, 0.2);
}

.gift-card-details h3 {
    font-size: 18px;
    margin-bottom: 10px;
    color: #ab8a62;
    font-family: 'Barlow Condensed', sans-serif;
    text-transform: uppercase;
    letter-spacing: 3px;
    padding-bottom: 5px;
    border-bottom: 1px solid rgba(171, 138, 98, 0.3);
}

.gift-card-details p {
    font-size: 16px;
    line-height: 1.6;
    color: #ddd;
    font-style: italic;
}

/* 3D effect using CSS variables for better performance */
:root {
    --rotateY: 0deg;
    --rotateX: 0deg;
}

.gift-card {
    transform: perspective(1000px) rotateY(var(--rotateY)) rotateX(var(--rotateX));
}

/* Additional hover effect for desktop */
.gift-card-wrapper:hover .gift-card {
    transform: perspective(1000px) rotateY(var(--rotateY)) rotateX(var(--rotateX));
}

/* Responsive styles */
@media (max-width: 768px) {
    .gift-card-container {
        padding: 60px 15px 15px;
    }

    .logo-container {
        margin-bottom: 30px;
    }

    .logo-container img {
        max-height: 80px;
    }

    .gift-card-wrapper {
        margin-bottom: 40px;
        /* Keep aspect ratio, don't change height */
    }

    .gift-card-content h2 {
        font-size: 26px;
    }

    .gift-card-amount {
        font-size: 40px;
    }

    .promo-code-area {
        height: 50px;
        width: 90%; /* Wider on mobile for better touch targets */
    }

    .promo-code-reveal {
        font-size: 20px;
    }

    .gift-card-details {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .gift-card-container {
        padding: 40px 10px 10px;
    }

    .logo-container img {
        max-height: 60px;
    }

    .gift-card-wrapper {
        /* Keep aspect ratio, don't change height */
        margin-bottom: 30px;
    }

    .gift-card-content {
        padding: 20px;
    }

    .gift-card-content h2 {
        font-size: 22px;
        margin-bottom: 15px;
    }

    .gift-card-amount {
        font-size: 34px;
        margin-bottom: 15px;
    }

    .promo-code-area {
        height: 45px;
        width: 95%; /* Even wider on smaller screens */
    }

    .promo-code-reveal {
        font-size: 18px;
    }

    .flip-arrow-icon {
        width: 35px;
        height: 35px;
    }

    .card-instruction {
        font-size: 14px;
    }

    .gift-card-details {
        padding: 15px;
    }

    .gift-card-details h3 {
        font-size: 16px;
    }

    .gift-card-details p {
        font-size: 14px;
    }
}

/* Extra small screens */
@media (max-width: 375px) {
    .gift-card-wrapper {
        min-width: 280px; /* Smaller minimum width for very small screens */
    }

    .gift-card-content {
        padding: 15px;
    }

    .gift-card-content h2 {
        font-size: 20px;
        margin-bottom: 10px;
    }

    .gift-card-amount {
        font-size: 30px;
        margin-bottom: 10px;
    }

    .promo-code-label {
        font-size: 14px;
    }

    .promo-code-area {
        height: 40px;
    }

    .promo-code-reveal {
        font-size: 16px;
    }

    .card-instruction {
        font-size: 12px;
        top: -25px;
    }
}
