/* 
   PROJECT TICKET MASTER (2026)
   "Authentic Coupon Aesthetic" - Tangible, Perforated, Action-Oriented.
   Français Intégral.
*/

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;700&family=Rubik:wght@400;500;700;900&display=swap');

:root {
    /* PALETTE COUPON */
    --bg-canvas: #f0f2f5;
    --paper-white: #ffffff;

    /* Action Colors */
    --ticket-yellow: #FFD600;
    /* "Gagnant" */
    --ticket-red: #FF3B30;
    /* "Promo" */
    --ticket-blue: #007AFF;
    /* "Bleu Ticket" */
    --ticket-green: #34C759;
    /* "Validé" */

    /* IGV THEME (ORANGE) */
    --igv-purple-start: #ff7828;
    /* Primary Orange */
    --igv-purple-end: #ff8e4d;
    /* Lighter end for gradient */
    --igv-accent: #ff7828;
    /* Consistent Action Color */

    --text-ink: #1c1c1e;
    --text-faded: #8e8e93;

    /* SHAPES */
    --dash-border: 2px dashed #d1d1d6;
    --radius-ticket: 16px;

    /* TEXTURE */
    --shadow-paper: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

body {
    background-color: var(--bg-canvas);
    /* Pattern léger de papier millimétré */
    background-image: radial-gradient(#d1d1d6 1px, transparent 1px);
    background-size: 20px 20px;

    font-family: 'Space Grotesk', sans-serif;
    color: var(--text-ink);
    -webkit-font-smoothing: antialiased;
    line-height: 1.5;
    padding-bottom: 100px;
}

h1,
h2,
h3,
h4,
.ticket-font {
    font-family: 'Rubik', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

a {
    text-decoration: none !important;
    color: inherit;
    transition: 0.2s ease;
}

/* LAYOUT UTILS */
.hero-igv {
    background-color: var(--igv-purple-start);
    /* Fallback / Base Color */

    /* Image + Overlay Gradient */
    background-image:
        linear-gradient(to bottom, rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.6)),
        /* Dark Overlay for Text Readability */
        url('../images/header_bg.webp');
    /* Corrected Filename */

    background-size: cover;
    background-position: center top;

    color: white;
    padding-top: 15px;
    padding-bottom: 80px;
    /* More breathing room */

    /* Flatter, cleaner curve */
    border-bottom-left-radius: 20% 15px;
    border-bottom-right-radius: 20% 15px;

    /* Black Shadow as requested */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);

    position: relative;
    z-index: 10;
    margin-bottom: 30px;
}

/* SEARCH BAR PREMIUM */
.search-container {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.search-container:focus-within {
    transform: scale(1.02) translateY(-2px);
}

.search-input-group {
    background: #fff;
    border-radius: 50px;
    padding: 6px;
    display: flex;
    align-items: center;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.search-container:focus-within .search-input-group {
    border-color: var(--igv-accent);
    box-shadow: 0 15px 35px rgba(255, 120, 40, 0.2);
}

.search-icon-box {
    padding: 0 15px;
    color: var(--text-faded);
    font-size: 18px;
    transition: color 0.3s ease;
}

.search-container:focus-within .search-icon-box {
    color: var(--igv-accent);
}

.search-input {
    border: none;
    outline: none;
    flex-grow: 1;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-ink);
    padding: 10px 0;
}

.search-btn {
    background: var(--igv-accent);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 10px 25px;
    font-weight: 700;
    font-family: 'Rubik', sans-serif;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.search-btn:hover {
    background: var(--igv-purple-end);
    box-shadow: 0 4px 15px rgba(255, 120, 40, 0.4);
    transform: scale(1.05);
}

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

/* TICKET FILTERING ANIMATION */
.coupon-ticket {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease, box-shadow 0.2s;
    transform-origin: center center;
}

.coupon-ticket.hidden {
    opacity: 0;
    transform: scale(0.8);
    pointer-events: none;
    display: none;
    /* We'll use JS to set display none after animation or just use opacity/scale for smooth grid reflow if using a flex/grid setup */
}

/* Re-layout for filtered grid */
.ticket-grid.filtering .coupon-ticket.hidden {
    position: absolute;
    visibility: hidden;
}

.no-results {
    text-align: center;
    padding: 60px 20px;
    display: none;
}

.no-results i {
    font-size: 48px;
    color: var(--text-faded);
    margin-bottom: 20px;
    display: block;
}

.no-results h3 {
    font-size: 20px;
    margin-bottom: 10px;
}

/* Override sticky header for this layout */
header {
    background: transparent;
    border: none;
    box-shadow: none;
    position: relative;
    top: auto;
    z-index: 20;
}

.bottom-nav {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-ink);
    border-radius: 50px;
    padding: 12px 30px;
    display: flex;
    justify-content: space-between;
    gap: 30px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    z-index: 9999;
}

.bottom-nav-item {
    color: #8e8e93;
    font-size: 20px;
}

.bottom-nav-item.active {
    color: var(--ticket-yellow);
}

/* ============================
   COMPONENT: THE TICKET CARD
   ============================ */

/* ============================
   COMPONENT: THE TICKET CARD (COMPACT MOBILE)
   ============================ */

.ticket-grid {
    padding: 15px;
    display: grid;
    /* Mobile: 2 Columns for Density */
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

@media (min-width: 768px) {
    .ticket-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 30px;
        padding: 40px;
        max-width: 1200px;
        margin: 0 auto;
    }
}

.coupon-ticket {
    background: var(--paper-white);
    border-radius: 12px;
    /* Slightly tighter radius */
    position: relative;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    /* Simulated Perforations */
    mask-image: radial-gradient(circle at 0px 70%, transparent 5px, black 6px),
        radial-gradient(circle at 100% 70%, transparent 5px, black 6px);
    mask-position: 0 0, 0 0;
    mask-size: 100% 100%;
    mask-repeat: no-repeat;
    border: 1px solid #e0e0e0;
    height: 345px;
    /* FIXED HEIGHT (Reduced gap) */
}

.coupon-ticket:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-paper);
    border-color: var(--ticket-blue);
}

/* Perforation pseudo-element removed to place dots under title/rating */
.coupon-ticket::after {
    display: none;
}

.ticket-visual {
    height: 100px;
    /* Reduced from 140px */
    background: #f8f9fa;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    height: 140px;
    /* Slightly larger visual area */
    flex-shrink: 0;
}

.ticket-img {
    max-width: 100%;
    max-height: 80px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
    transform: rotate(-2deg);
    /* Dynamic tilt */
}

/* UNFINISHED SCRATCH EFFECT */
.scratch-unfinished {
    /* Deprecated in new logic, but kept for safety */
    display: inline-block;
    background: #d1d1d6;
    /* Fallback */
    background: repeating-linear-gradient(45deg,
            #c0c0c5,
            #c0c0c5 5px,
            #dcdce1 5px,
            #dcdce1 10px);
    color: transparent;
    text-shadow: 0 0 8px rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    padding: 0 8px;
    margin-left: 5px;
    position: relative;
    border: 1px dashed #a0a0a5;
    cursor: help;
}

/* Simulated 'scratch marks' or dust */
.scratch-unfinished::after {
    content: '????';
    color: rgba(0, 0, 0, 0.3);
    font-size: 14px;
    text-shadow: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: monospace;
}

/* Validation Group Fade In */
.unlock-group {
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.unlock-group.show {
    opacity: 1;
}

/* TICKET BODY */
.ticket-body {
    padding: 15px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    /* Fills remaining space */
    justify-content: space-between;
    /* Pushes content apart */
}

.ticket-title {
    font-size: 18px;
    /* BIG & BOLD */
    font-weight: 800;
    color: #000;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.2;
}

.ticket-rating {
    font-size: 10px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    display: flex;
    gap: 2px;
    border-bottom: 2px dashed #e0e0e0;
    /* The dots moved here */
    width: 100%;
}

.ticket-desc {
    font-size: 12px;
    color: #666;
    line-height: 1.4;
    margin-bottom: 10px;

    /* TRUNCATION MAGIC */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    /* Max 3 lines */
    line-clamp: 3;
    /* Standard property */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 3.6em;
    /* Keeps alignment even if text is short */
    margin-bottom: 8px;
    /* Breathing room */
}

.ticket-stock {
    font-size: 12px;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 8px;
    /* Spacing below stock */
    display: flex;
    align-items: center;
    gap: 6px;
}

/* RESTORED TICKET BADGE */
.ticket-badge {
    background: var(--ticket-yellow);
    color: #000;
    font-size: 9px;
    font-weight: 700;
    padding: 3px 6px;
    border-radius: 4px;
    position: absolute;
    top: 6px;
    left: 6px;
    text-transform: uppercase;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    z-index: 2;
}

.btn-scratch {
    background: var(--text-ink);
    /* Back to Black */
    color: #fff !important;
    font-family: 'Rubik', sans-serif;
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    padding: 10px 4px;
    border-radius: 6px;
    border: none;
    width: 100%;
    margin-top: auto;
    /* Pushes button to bottom */
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
    transition: background 0.2s, transform 0.2s;
}

.btn-scratch:hover {
    background: #000;
    /* Deep black on hover */
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn-scratch::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent 45%, rgba(255, 255, 255, 0.2) 50%, transparent 55%);
    background-size: 200% 200%;
    animation: shine 3s infinite;
}

@keyframes shine {
    0% {
        background-position: 150% 150%;
    }

    100% {
        background-position: -50% -50%;
    }
}

/* ============================
   COMPONENT: BIG TICKET (Product Page)
   ============================ */

.big-ticket-container {
    max-width: 800px;
    margin: 40px auto;
    padding: 0 20px;
}

.big-ticket {
    background: #fff;
    border: 4px solid var(--text-ink);
    border-radius: 20px;
    position: relative;
    overflow: hidden;
    box-shadow: 10px 10px 0px rgba(0, 0, 0, 0.1);
}

.big-ticket-header {
    background: var(--text-ink);
    color: #fff;
    padding: 20px;
    text-align: center;
    border-bottom: 2px dashed #fff;
}

.big-ticket-body {
    padding: 40px;
    text-align: center;
    background-image: radial-gradient(#f0f0f0 2px, transparent 2px);
    background-size: 15px 15px;
}

.scratch-area {
    background: #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    margin: 30px 0;
    border: 2px dashed #bbb;
    position: relative;
}

.scratch-overlay {
    background: linear-gradient(135deg, #d1d1d6 0%, #b0b0b6 100%);
    color: #555;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    letter-spacing: 1px;
    border-radius: 8px;
    height: 80px;
    text-shadow: 1px 1px 0px rgba(255, 255, 255, 0.5);
}

.scratch-reveal {
    font-family: monospace;
    font-size: 24px;
    letter-spacing: 4px;
    font-weight: 700;
    color: var(--text-ink);
}

/* MODAL FIX */
.modal-content {
    border-radius: 0 !important;
    border: 4px solid #000 !important;
    box-shadow: 10px 10px 0px #000 !important;
}

.checkout-header {
    background: #000;
    color: #fff;
    padding: 15px;
    text-align: center;
    font-family: 'Rubik', sans-serif;
    text-transform: uppercase;
}

.checkout-body {
    padding: 30px;
    text-align: center;
    background: #fff;
}

/* Selection Cards Redesign */
.scratch-area {
    border: 2px dashed #ddd !important;
    background: #fdfdfd;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.05);
}

.selection-card {
    display: flex;
    align-items: center;
    background: #fff !important;
    border: 1px solid #e0e0e0 !important;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.selection-card:hover {
    transform: translateY(-2px);
    border-color: var(--igv-accent) !important;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
}

.selection-badge-side {
    width: 60px;
    min-width: 60px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-right: 1px dashed #e0e0e0;
    background: #fcfcfc;
}

.selection-badge-inner {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    /* Square with rounded corners, NO MORE OVAL */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 800;
    text-align: center;
    line-height: 1.1;
    text-transform: uppercase;
    padding: 5px;
}

.selection-info-side {
    flex-grow: 1;
    padding: 12px 15px;
    text-align: left;
}

.selection-title {
    font-weight: 700;
    font-size: 14px;
    color: #1a1a1a;
    line-height: 1.2;
    margin-bottom: 2px;
}

.selection-sub {
    font-size: 11px;
    color: #888;
}

.selection-action-side {
    padding-right: 15px;
}

/* Mobile adjustments */
@media (max-width: 576px) {
    .selection-badge-side {
        width: 50px;
        min-width: 50px;
        height: 60px;
    }

    .selection-badge-inner {
        width: 40px;
        height: 40px;
        font-size: 9px;
    }

    .selection-title {
        font-size: 13px;
    }
}

/* Premium Unlock Animation */
@keyframes pulse-glow {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 193, 7, 0.7);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(255, 193, 7, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(255, 193, 7, 0);
    }
}

.unlock-group.show .unlock {
    animation: pulse-glow 2s infinite;
    background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%) !important;
    border: none !important;
}

.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}