/* =================================================================
   COUPON SYSTEM
   ================================================================= */

/* --- 1. CONTAINER & MARQUEE --- */

.talitor-promo-container { 
    margin-bottom: 10px; 
    width: 100%; 
    overflow: hidden; 
    position: relative; 
}

.talitor-promo-title { 
    font-size: 17px; 
    font-weight: 700; 
    text-transform: uppercase; 
    color: #333; 
}

.talitor-marquee-mask { 
    width: 100%; 
    overflow: hidden; 
    padding: 0; 
}

/* Gradient mask for infinite scroll fading effect at edges */
.talitor-promo-container.has-scroll .talitor-marquee-mask { 
    -webkit-mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
    mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent); 
}

.talitor-tickets-track { 
    display: flex; 
    gap: 0; 
    width: max-content; 
}

/* Hardware acceleration and animation for active marquee */
.talitor-tickets-track.scroll-active { 
    animation: talitor-scroll 100s linear infinite; 
    will-change: transform; 
    transform: translateZ(0); 
}

.talitor-tickets-track.scroll-active:hover { 
    animation-play-state: paused; 
}

.talitor-tickets-track.scroll-inactive { 
    width: 100%; 
    flex-wrap: wrap; 
    justify-content: flex-start; 
    gap: 20px; 
}

@keyframes talitor-scroll { 
    0% { transform: translateX(0); } 
    100% { transform: translateX(-50%); } 
}


/* --- 2. TICKET DESIGN V16 --- */

.ticket-v16 { 
    display: flex; 
    width: 100%; 
    min-width: 320px; 
    max-width: 360px; 
    height: 140px; 
    margin-top: 8px; 
    filter: drop-shadow(2px 2px 3px rgba(0,0,0,0.15)); 
    transition: transform 0.2s; 
    background: transparent; 
    flex-shrink: 0; 
    margin-right: 20px; 
    -webkit-backface-visibility: hidden; 
    backface-visibility: hidden; 
    transform: translateZ(0); 
}

.scroll-inactive .ticket-v16 { 
    margin-right: 0; 
}

/* Left part of the ticket (perforated edge via radial-gradient) */
.ticket-v16-left { 
    flex: 0 0 90px; 
    width: 120px; 
    position: relative; 
    color: #fff; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    background-color: transparent; 
    background-image: radial-gradient(circle at 0% 50%, transparent 6px, var(--t-color) 6.5px), radial-gradient(circle at 100% 50%, transparent 6px, var(--t-color) 6.5px); 
    background-position: 0 0, 100% 0; 
    background-size: 51% 18px; 
    background-repeat: repeat-y; 
    margin-right: -1px; 
    padding: 0; 
    will-change: transform; 
}

.v16-content-wrap { 
    display: flex; 
    flex-direction: row; 
    align-items: center; 
    justify-content: center; 
    gap: 8px; 
    height: 100%; 
    width: 100%; 
}

.v16-text { 
    writing-mode: vertical-rl; 
    transform: rotate(180deg); 
    font-size: 9px; 
    font-weight: 700; 
    letter-spacing: 2px; 
    text-transform: uppercase; 
    white-space: nowrap; 
    opacity: 0.9; 
    margin-left: 5px; 
}

.v16-line { 
    width: 1px; 
    height: 70%; 
    background-color: rgba(255,255,255,0.3); 
}

.v16-code-group { 
    display: flex; 
    flex-direction: column-reverse; 
    align-items: center; 
    margin-right: 5px; 
}

.v16-label { 
    writing-mode: vertical-rl; 
    transform: rotate(180deg); 
    font-size: 9px; 
    font-weight: 600; 
    opacity: 0.9; 
    text-transform: uppercase; 
    margin-top: 4px; 
}

.v16-code-box { 
    writing-mode: vertical-rl; 
    transform: rotate(180deg); 
    background-color: rgba(0,0,0,0.2); 
    color: #fff; 
    font-size: 15px; 
    font-weight: 800; 
    text-transform: uppercase; 
    padding: 4px 1px; 
    border-radius: 4px; 
    letter-spacing: 1px; 
    white-space: nowrap; 
}

/* Dynamic code box sizing modifiers */
.v16-code-box.size-medium { font-size: 12px; letter-spacing: 0.5px; } 
.v16-code-box.size-small { font-size: 10px; letter-spacing: 0; }

/* Right part of the ticket */
.ticket-v16-right { 
    flex-grow: 1; 
    position: relative; 
    padding: 15px; 
    background-color: transparent; 
    background-image: radial-gradient(circle at 0% 50%, transparent 6px, #fff 6.5px), radial-gradient(circle at 100% 50%, transparent 6px, #fff 6.5px); 
    background-position: 0 0, 100% 0; 
    background-size: 51% 18px; 
    background-repeat: repeat-y; 
    will-change: transform; 
}

.info-top { 
    position: absolute; 
    top: 12px; 
    left: 25px; 
    right: 10px; 
}

.talitor-card-amount { 
    font-size: 26px; 
    font-weight: 800; 
    color: var(--t-color); 
    line-height: 1; 
    margin-bottom: 2px; 
}

.desc { 
    font-size: 13px; 
    color: #333; 
    line-height: 1.2; 
    font-weight: 600; 
}

.info-role { 
    position: absolute; 
    top: 72px; 
    left: 0; 
    right: 0; 
    font-size: 9px; 
    font-weight: 700; 
    color: #d32f2f; 
    text-transform: uppercase; 
    line-height: 1.2; 
    margin: 0; 
}

.bottom-stack { 
    position: absolute; 
    bottom: 12px; 
    left: 25px; 
    max-width: calc(100% - 100px); 
    display: flex; 
    flex-direction: column; 
    gap: 3px; 
}

.info-restrict { 
    font-size: 10px; 
    color: #666; 
    line-height: 1.1; 
    font-style: italic; 
}

.info-expiry { 
    font-size: 11px; 
    font-weight: 300; 
    color: #000; 
    font-style: italic; 
    margin-top: 0; 
}

.ticket-actions { 
    position: absolute; 
    bottom: 9px; 
    right: 10px; 
    display: flex; 
    gap: 2px; 
    align-items: center; 
}

.copy-btn-bottom { 
    background: transparent; 
    color: #999; 
    border: 1px solid #ddd; 
    padding: 4px 8px; 
    font-size: 10px; 
    font-weight: 700; 
    border-radius: 4px; 
    cursor: pointer; 
    text-transform: uppercase; 
    transition: 0.2s; 
    box-shadow: none !important; 
    white-space: nowrap; 
}

.copy-btn-bottom:hover { 
    background: var(--t-color); 
    color: #fff; 
    border-color: var(--t-color); 
}

.terms-btn { 
    background: transparent; 
    border: none; 
    color: #777; 
    font-size: 9px; 
    font-weight: 600; 
    text-decoration: underline; 
    cursor: pointer; 
    padding: 2px 4px; 
    text-transform: uppercase; 
    box-shadow: none !important; 
    border-radius: 3px; 
    transition: 0.2s; 
}

.terms-btn:hover { 
    color: var(--t-color); 
    background: rgba(0,0,0,0.05); 
}


/* --- 3. POPUP (MODAL) --- */

.talitor-modal { 
    display: none; 
    position: fixed; 
    z-index: 99999; 
    left: 0; 
    top: 0; 
    width: 100%; 
    height: 100%; 
    overflow: auto; 
    background-color: rgba(0,0,0,0.6); 
    align-items: center; 
    justify-content: center; 
}

.talitor-modal-content { 
    background-color: #fefefe; 
    margin: auto; 
    padding: 0; 
    border: none; 
    width: 95%; 
    max-width: 650px; 
    border-radius: 12px; 
    overflow: hidden; 
    box-shadow: 0 10px 25px rgba(0,0,0,0.4); 
    animation: slideDown 0.3s;
    max-height: 85vh; 
    display: flex;
    flex-direction: column;
}

.talitor-modal-header { 
    padding: 20px 30px; 
    color: white; 
    display: flex; 
    flex-direction: column; 
    justify-content: center; 
    position: relative; 
    gap: 10px; 
}

.header-top-line { 
    font-size: 10px; 
    letter-spacing: 2px; 
    text-transform: uppercase; 
    opacity: 0.9; 
    font-weight: 700; 
}

.header-main-row { 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    width: 100%; 
    margin-top: 5px; 
}

.modal-amount { 
    font-size: 32px; 
    font-weight: 800; 
    line-height: 1; 
}

.modal-code-box { 
    background-color: rgba(0,0,0,0.25); 
    padding: 5px 12px; 
    border-radius: 4px; 
    font-size: 12px; 
    font-weight: 600; 
    display: flex; 
    align-items: center; 
    gap: 8px; 
}

.modal-code-val { 
    font-size: 18px; 
    font-weight: 800; 
    text-transform: uppercase; 
    letter-spacing: 1px; 
}

.close-modal { 
    position: absolute; 
    right: 20px; 
    top: 15px; 
    color: white; 
    font-size: 28px; 
    font-weight: bold; 
    cursor: pointer; 
    line-height: 1; 
    opacity: 0.8; 
}

.close-modal:hover { 
    opacity: 1; 
}

.talitor-modal-body { 
    padding: 30px; 
    overflow-y: auto; 
    flex: 1; 
}

.popup-desc { 
    font-size: 16px; 
    font-weight: 600; 
    color: #333; 
    text-align: center; 
    margin-bottom: 20px; 
    line-height: 1.4; 
}

.popup-subtitle { 
    font-size: 12px; 
    font-weight: 700; 
    text-transform: uppercase; 
    color: #999; 
    text-align: center; 
    border-bottom: 2px solid #eee; 
    padding-bottom: 10px; 
    margin-bottom: 15px; 
    letter-spacing: 1px; 
}

.talitor-details-list { 
    list-style: none; 
    padding: 0; 
    margin: 0; 
}

.talitor-details-list li { 
    padding: 10px 0; 
    border-bottom: 1px solid #f5f5f5; 
    font-size: 14px; 
    color: #444; 
    display: flex; 
    justify-content: space-between; 
    align-items: flex-start; 
}

.talitor-details-list li:last-child { 
    border-bottom: none; 
}

.talitor-details-list strong { 
    color: #222; 
    display: inline-block; 
    width: 40%; 
    font-weight: 600; 
    flex-shrink: 0; 
}

.combined-lines { 
    display: flex; 
    flex-direction: column; 
    align-items: flex-end; 
    text-align: right; 
}


/* --- 4. RESPONSIVE MOBILE (< 410px) --- */

@media (max-width: 410px) {
    .talitor-promo-container { margin-bottom: 8px; margin-top: 10px; }
    .ticket-v16 { max-width: 268px; min-width: 268px; height: 125px; }
    .ticket-v16-left { flex: 0 0 70px; width: 70px; }
    .v16-text { font-size: 7px; }
    .v16-code-box { font-size: 11px; }
    .v16-code-box.size-medium { font-size: 10px; } 
    .v16-code-box.size-small { font-size: 9px; }
    .info-top { left: 17px; top: 9px; }
    .talitor-card-amount { font-size: 16px; }
    .desc { font-size: 11px; }
    
    /* FIX: Added missing semicolon on left: 0 */
    .info-role { font-size: 7px; top: 63px; left: 0; }
    
    .bottom-stack { bottom: 10px; left: 18px; max-width: 80%; gap: 4px; }
    .info-restrict { font-size: 9px; }
    .info-expiry { font-size: 10px; font-weight: 300; }
    .ticket-actions { top: 0; bottom: 0; right: 0; left: 0; width: 100%; height: 100%; pointer-events: none; display: block; }
    .copy-btn-bottom { padding: 2px 4px; pointer-events: auto; position: absolute; bottom: 6px; right: 10px; }
    .terms-btn { font-size: 8px; pointer-events: auto; position: absolute; top: 10px; right: 8px; }
    .talitor-modal { padding: 20px !important; }
    .talitor-modal-header { padding: 20px; }
    .talitor-modal-content { max-height: 80vh; }
    .talitor-details-list li { flex-direction: column; }
    .talitor-details-list strong { width: 100%; margin-bottom: 4px; }
    .combined-lines { align-items: flex-start; text-align: left; width: 100%; margin-top: 2px; }
    .modal-amount { font-size: 24px; }
    .modal-code-box { padding: 5px 8px; font-size: 10px; width: 100%; justify-content: center; }
    .modal-code-val { font-size: 14px; }
    .header-main-row { flex-direction: column; align-items: flex-start; gap: 10px; }
}


/* =================================================================
   ACCORDION ADDITIONS (CLEANED WITH GREY ARROW)
   ================================================================= */

/* --- ACCORDION LOGIC WITH SORT ICON --- */

.talitor-promo-header { 
    cursor: pointer; 
    display: inline-block; 
}

.talitor-promo-title { 
    display: flex; 
    align-items: center; 
    margin: 0; 
}

.talitor-promo-arrow {
    display: inline-block;
    margin-left: 8px;
    width: 25px;
    height: 25px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: auto 18px;
    /* Base64 encoded SVG identical to the sort button */
    background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNSIgaGVpZ2h0PSIyNSIgZmlsbD0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2U9IiNiYmIiPjxwYXRoIGQ9Ik02IDlsNiA2IDYtNiIvPjwvc3ZnPg==");
    transition: transform 0.4s ease;
}

/* Removes legacy text-based arrows if they exist */
.talitor-promo-arrow::after {
    content: none !important;
}

/* Arrow rotation when accordion is opened */
.talitor-promo-container.is-open .talitor-promo-arrow {
    transform: rotate(180deg);
}

/* --- ACCORDION BODY (GRID ANIMATION TRICK) --- */

.talitor-promo-accordion-body {
    display: grid;
    grid-template-rows: 0fr; /* Collapses the container natively */
    transition: grid-template-rows 0.4s ease, opacity 0.3s ease;
    opacity: 0;
    overflow: hidden; /* Prevents content bleeding during animation */
}

.talitor-promo-container.is-open .talitor-promo-accordion-body { 
    grid-template-rows: 1fr; /* Expands to exact content height natively */
    opacity: 1; 
}