/**
 * Lottery Core — Frontend CSS
 * Base layout only — colors and typography come from your theme/plugin CSS.
 * VOX.fr — https://www.vox.fr
 */

/* ── Wrapper ─────────────────────────────────────────────────────────────── */

.lottery-wrap {
    --lott-primary: #823F8C;
    --lott-bg-primary: #4E2654;
    --lott-primary-60: #9E5AA2;
    --lott-secondary: #DFB460;
    --lott-dark: #1A0D1C;
    --lott-light: #FBF8FB;
    --lott-grey: #C9C6C5;
    --lott-red: #A30000;

    margin: 0 auto;
    padding: 0;
    display: flex;
    flex-direction: column;
}

#lottery-selection.lottery-wrap{
    gap: 2rem;
}

/* ── Typography ──────────────────────────────────────────────────────────── */

.lottery-title {
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 20px;
}

#lottery-checkout .lottery-section-title {
    font-size: 1.6rem;
    font-weight: 900;
    margin: 1.8rem 0 0.9rem;
}
#lottery-checkout .lottery-section-title:first-child{
    margin-top: 0;
}

.lottery-label,
.lottery-subtitle {
    text-align: center;
    font-size: 0.95rem;
    margin-bottom: 12px;
}

/* ── Selected zone ───────────────────────────────────────────────────────── */

#lottery-selection .lottery-selected-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ── Skeleton placeholder ────────────────────────────────────────────────── */

.lottery-ticket-skeleton {
    cursor: default;
    opacity: 0.55;
    border-style: dashed;
}

/* ── Slot display (monospace keeps width stable during scramble) ─────────── */

.lottery-slot-display {
    display: inline-block;
    font-variant-numeric: tabular-nums;
}
.lottery-ticket-skeleton[disabled] .lottery-slot-display {
    filter: blur(4px);
}

/* ── Animating state ─────────────────────────────────────────────────────── */

.lottery-ticket-animating {
    opacity: 1;
    border-style: solid;
    /* Very subtle background pulse during scramble. */
    animation: lottery-slot-pulse 0.55s ease-in-out;
}

@keyframes lottery-slot-pulse {
    0%   { background-color: transparent; }
    40%  { background-color: rgba(201, 168, 76, 0.12); }
    100% { background-color: transparent; }
}

/* ── Reveal pop (fires once when number locks in) ────────────────────────── */

.lottery-ticket-revealed {
    animation: lottery-slot-pop 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes lottery-slot-pop {
    0%   { transform: scale(1); }
    55%  { transform: scale(1.045); }
    100% { transform: scale(1); }
}

/* ── Ticket grids ────────────────────────────────────────────────────────── */

#lottery-selection .lottery-ticket-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    width: 100%;
}

/* Selected tickets use the same grid */
#lottery-selection .lottery-ticket-grid--selected .lottery-ticket-selected {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-radius: 8px;
    background: var(--lott-secondary);
    color: var(--lott-dark);
    font-weight: 700;
    position: relative;
}

#lottery-selection .lottery-ticket-remove {
    background: none;
    border: none;
    color: var(--lott-dark);
    font-size: 1rem;
    cursor: pointer;
    padding: 0 0 0 8px;
    line-height: 1;
}

/* Proposed ticket buttons */
#lottery-selection .lottery-ticket-btn {
    display: block;
    width: 100%;
    padding: 1.5rem;
    background: var(--lott-light);
    color: var(--lott-dark);
    font-family: "Happy Monkey", serif;
    font-size: 2rem;
    font-weight: 400;
    text-align: center;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;

    border-radius: 0.25rem;
    border: 1px solid var(--lott-secondary);
    border-left-width: 0.5rem;
}

#lottery-selection .lottery-ticket-btn:hover {
    background: #f5edd8;
}

#lottery-selection .lottery-ticket-btn.is-selected {
    background: var(--lott-secondary);
    color: var(--lott-dark);
}

/* ── "See more" / links ──────────────────────────────────────────────────── */

#lottery-selection .lottery-more-wrap {
    text-align: center;
}

#lottery-selection .lottery-link {
    font-size: 0.95rem;
    text-decoration: underline;
    cursor: pointer;
    background: none;
    border: none;
    color: inherit;
}

/* ── Cart summary bar (selection page) ──────────────────────────────────── */

.lottery-cart-summary {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 1rem 0;
    border-top: 1px solid #C9C6C5;
    border-bottom: 1px solid #C9C6C5;
}

.lottery-cart-count  { flex: 2; }
.lottery-cart-price  { font-weight: 700; }

/* ── Cart page ───────────────────────────────────────────────────────────── */

.lottery-cart-wrap {
    background: var(--lott-bg-primary);
    color: var(--lott-light);
    border-top: 1px solid var(--lott-primary-60);
    border-bottom: 1px solid var(--lott-primary-60);
    padding-bottom: 1.25rem;
}

.lottery-cart-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 0 0;
}

.lottery-cart-row-icon  { color: var(--lott-light); font-size: 1.1rem; cursor: pointer}
.lottery-cart-row-label { flex: 1; }
.lottery-cart-row-price { font-weight: 600; white-space: nowrap; }

#lottery-cart .lottery-cart-empty{
    padding: 2.2rem 0;
    text-align: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 0.25rem;
    margin: 1.4rem 0 1rem 0;
    color: rgba(255, 255, 255, 0.7);
}

#lottery-cart .lottery-cart-sep {
    border: none;
    border-top: 1px solid var(--lott-primary-60);
    margin: 1.25rem 0;
}

.lottery-cart-total-row {
    display: flex;
    justify-content: space-between;
    font-weight: 700;
    font-size: 1.1rem;
}

#lottery-cart-items .lottery-cart-row-remove {
    border: none;
    cursor: pointer;
    aspect-ratio: 1;
    padding: 0 0.8rem;
    font-size: 0.8rem;
    transition: opacity 0.15s;
}

.lottery-cart-row-remove:hover:not(:disabled) {
    opacity: 0.7;
}

.lottery-cart-row-remove:disabled {
    cursor: wait;
}

/* ── Checkout form ───────────────────────────────────────────────────────── */

.lottery-field {
    margin-bottom: 16px;
}

.lottery-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 0.95rem;
}

.lottery-wrap .lottery-field input[type="text"],
.lottery-wrap .lottery-field input[type="email"] {
    display: block;
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid var(--lott-grey);
    border-radius: 6px;
    font-size: 1rem;
    box-sizing: border-box;
}

.lottery-field-hint {
    display: block;
    font-size: 0.88rem;
    line-height: 1.2rem;
    color: var(--lott-red);
    margin-top: 0.75rem;
}

.lottery-field--checkbox {
    margin-top: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

/* Custom checkbox — hidden native input, replaced by styled ::before */
.lottery-field--checkbox input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    flex-shrink: 0;
    width: 1.6rem;
    height: 1.6rem;
    margin-top: 0.1rem;
    border: 2px solid var(--lott-grey);
    border-radius: 4px;
    background: var(--lott-light);
    cursor: pointer;
    position: relative;
    transition: border-color 0.15s, background 0.15s;
}

.lottery-field--checkbox input[type="checkbox"]:hover {
    border-color: var(--lott-primary);
}

.lottery-field--checkbox input[type="checkbox"]:checked {
    background: var(--lott-primary);
    border-color: var(--lott-primary);
}

/* Checkmark via clip-path — no extra element needed */
.lottery-field--checkbox input[type="checkbox"]:checked::after {
    content: '';
    display: block;
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0.35rem;
    height: 0.65rem;
    border: 2px solid #fff;
    border-top: none;
    border-left: none;
    transform: translate(-50%, -60%) rotate(45deg);
}

.lottery-field--checkbox input[type="checkbox"]:focus-visible {
    outline: 2px solid var(--lott-primary);
    outline-offset: 2px;
}

.lottery-field--checkbox label {
    font-weight: 400;
    cursor: pointer;
    padding-top: 0.15rem;
}

/* Option boxes (Livraison / Paiement) */
.lottery-option-box {
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
}

.lottery-option-box--selected {
    border-color: var(--lott-primary);
}

.lottery-option-box strong { font-size: 1rem; }
.lottery-option-box span   { font-size: 0.88rem; color: #555; }

.lottery-checkout__notice{
    background: rgb(244 220 247);
    padding: 1rem 1.3rem;
    border-radius: 0.5rem;
    line-height: 1.3;
    margin: 1rem 0;
}

.lottery-checkout__notice-title{
    padding-bottom: 0.5rem;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */

.lottery-btn {
    display: inline-block;
    padding: 14px 28px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: opacity 0.15s;
    border: none;
}

.lottery-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.lottery-btn--primary {
    background: var(--lott-primary);
    color: #fff;
}

.lottery-btn--primary:hover:not(:disabled) {
    opacity: 0.88;
}

.lottery-wrap .lottery-btn--ghost,
.lottery-wrap .lottery-btn--ghost:hover,
.lottery-wrap .lottery-btn--ghost:focus {
    background: transparent;
    border-bottom: 2px solid var(--lott-dark);
    color: var(--lott-dark);
    border-radius: 0;
    padding: 0;
}
.lottery-wrap .lottery-btn--ghost:hover,
.lottery-wrap .lottery-btn--ghost:focus {
    border-bottom-color: var(--lott-primary);
    color: var(--lott-primary);
}

.lottery-wrap .lottery-btn--full {
    display: block;
    width: 100%;
    margin-top: 20px;
}

/* ── Misc ────────────────────────────────────────────────────────────────── */

.lottery-pay-hint {
    text-align: center;
    font-size: 0.82rem;
    color: #666;
    margin-top: 8px;
}

.lottery-mock-notice {
    text-align: center;
    font-size: 0.85rem;
    color: var(--lott-red);
    margin-top: 8px;
}

.lottery-notice {
    text-align: center;
    color: #666;
    padding: 1.6rem;
    border: 1px solid #efefef;
    border-radius: 3px;
    background-color: #f1f1f1;
    line-height: 1.5rem;
}

.lottery-error {
    background: #FCEEEE;
    color: var(--lott-red);
    border: 1px solid #F5CCCC;
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 0.9rem;
    margin-top: 12px;
}

.lottery-loading {
    text-align: center;
    color: #999;
    padding: 20px;
    grid-column: 1 / -1;
}
