/* ═══════════════════════════════════════════
   AME FESTIVAL BOOKING – FRONTEND CSS v2
   ═══════════════════════════════════════════ */
:root {
    --ame-lav: #EEEAF6;
    --ame-pur: #8058A0;
    --ame-purd: #5A4394;
    --ame-wh: #fff;
    --ame-tx: #3D3C38;
    --ame-txl: #6B6B6B;
    --ame-acc: #B07FD0;
    --ame-gold: #C9A84C;
    --ame-green: #46a049;
    --ame-red: #d63638;
    --ame-r: 16px;
    --ame-rs: 8px;
    --ame-sh: 0 4px 24px rgba(90, 67, 148, .1);
    --ame-shl: 0 8px 40px rgba(90, 67, 148, .15);
    --ame-tr: .3s cubic-bezier(.4, 0, .2, 1);
    --ame-df: 'Playfair Display', Georgia, serif;
    --ame-db: 'DM Sans', sans-serif;
}

.ame-booking-wrap { font-family: var(--ame-db); color: var(--ame-tx); max-width: 1100px; margin: 0 auto; padding: 40px 20px; }
.ame-booking-wrap * { box-sizing: border-box; }
.ame-step { animation: ameFadeIn .4s ease; }
@keyframes ameFadeIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

/* ── CARD ── */
.ame-card { background: var(--ame-wh); border-radius: var(--ame-r); padding: 48px 40px; box-shadow: var(--ame-shl); position: relative; overflow: hidden; }
.ame-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: linear-gradient(90deg, var(--ame-purd), var(--ame-acc), var(--ame-gold)); }
.ame-card--center { text-align: center; max-width: 600px; margin: 0 auto; }
.ame-card__icon { width: 80px; height: 80px; margin: 0 auto 20px; background: var(--ame-lav); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 32px; color: var(--ame-purd); }
.ame-card__icon--success { background: #e8f5e9; color: var(--ame-green); font-size: 40px; }
.ame-card__title { font-family: var(--ame-df); font-size: clamp(1.6rem, 4vw, 2.2rem); font-weight: 700; color: var(--ame-purd); margin: 0 0 12px; line-height: 1.2; }
.ame-card__subtitle { font-size: 16px; color: var(--ame-txl); margin: 0 0 32px; line-height: 1.6; }
.ame-card__hint { font-size: 13px; color: var(--ame-txl); margin-top: 20px; }
.ame-card__hint i { color: var(--ame-pur); margin-right: 4px; }

/* ── INPUT ── */
.ame-input-group { display: flex; gap: 12px; max-width: 420px; margin: 0 auto; }
.ame-input { flex: 1; padding: 16px 20px; border: 2px solid var(--ame-lav); border-radius: var(--ame-rs); font-family: monospace; font-size: 18px; font-weight: 700; color: var(--ame-purd); letter-spacing: 2px; text-align: center; text-transform: uppercase; transition: border-color var(--ame-tr); outline: none; }
.ame-input:focus { border-color: var(--ame-pur); box-shadow: 0 0 0 3px rgba(128, 88, 160, .15); }
.ame-input::placeholder { color: #c5c5c5; letter-spacing: 3px; }

/* ── BUTTONS ── */
.ame-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 14px 28px; border-radius: 50px; font-family: var(--ame-db); font-size: 15px; font-weight: 600; text-transform: uppercase; letter-spacing: .8px; cursor: pointer; border: none; transition: all var(--ame-tr); text-decoration: none; }
.ame-btn--primary { background: var(--ame-purd); color: var(--ame-wh); box-shadow: 0 4px 20px rgba(90, 67, 148, .35); }
.ame-btn--primary:hover { background: var(--ame-pur); color: var(--ame-wh); transform: translateY(-2px); }
.ame-btn--outline { background: transparent; color: var(--ame-purd); border: 2px solid var(--ame-purd); }
.ame-btn--outline:hover { background: var(--ame-purd); color: var(--ame-wh); }
.ame-btn--small { padding: 10px 20px; font-size: 13px; }
.ame-btn--gold { background: var(--ame-gold); color: var(--ame-wh); box-shadow: 0 4px 20px rgba(201, 168, 76, .35); }
.ame-btn--gold:hover { background: #b8973e; color: var(--ame-wh); transform: translateY(-2px); }
.ame-btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; }

/* ── ALERT ── */
.ame-alert { padding: 14px 20px; border-radius: var(--ame-rs); font-size: 14px; font-weight: 500; margin-top: 16px; }
.ame-alert--error { background: #fef2f2; color: var(--ame-red); border: 1px solid #fecaca; }

/* ── HEADER BAR ── */
.ame-header-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 32px; flex-wrap: wrap; gap: 12px; }
.ame-back-btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; background: var(--ame-lav); border: none; border-radius: 50px; font-family: var(--ame-db); font-size: 14px; font-weight: 500; color: var(--ame-purd); cursor: pointer; transition: all var(--ame-tr); }
.ame-back-btn:hover { background: var(--ame-purd); color: var(--ame-wh); }
.ame-user-badge { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; background: var(--ame-wh); border-radius: 50px; box-shadow: var(--ame-sh); font-size: 13px; font-weight: 600; color: var(--ame-purd); }

/* ── DAYS GRID ── */
.ame-days-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; max-width: 500px; margin: 0 auto; }
.ame-day-card { background: var(--ame-lav); border: 3px solid transparent; border-radius: var(--ame-r); padding: 32px 20px; cursor: pointer; transition: all var(--ame-tr); text-align: center; }
.ame-day-card:hover { border-color: var(--ame-pur); transform: translateY(-4px); box-shadow: var(--ame-shl); }
.ame-day-card__icon { font-size: 32px; color: var(--ame-purd); margin-bottom: 12px; }
.ame-day-card__label { font-family: var(--ame-df); font-size: 1.5rem; font-weight: 700; color: var(--ame-purd); margin-bottom: 4px; }
.ame-day-card__sublabel { font-size: 14px; color: var(--ame-txl); }

/* ── SECTION TITLES ── */
.ame-section-title { font-family: var(--ame-df); font-size: clamp(1.6rem, 4vw, 2.2rem); font-weight: 700; color: var(--ame-purd); text-align: center; margin: 0 0 8px; }
.ame-section-subtitle { font-size: 16px; color: var(--ame-txl); text-align: center; margin: 0 0 40px; }

/* ── EXPERIENCE CARDS ── */
.ame-experiences-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 28px; }
.ame-exp-card { background: var(--ame-wh); border-radius: var(--ame-r); overflow: hidden; box-shadow: var(--ame-sh); transition: transform var(--ame-tr); }
.ame-exp-card:hover { transform: translateY(-4px); box-shadow: var(--ame-shl); }
.ame-exp-card__header { height: 140px; background: linear-gradient(135deg, var(--ame-purd), var(--ame-pur)); display: flex; align-items: center; justify-content: center; position: relative; }
.ame-exp-card__header--img { background-size: cover; background-position: center; }
.ame-exp-card__header--img::after { content: ''; position: absolute; inset: 0; background: linear-gradient(135deg, rgba(90,67,148,.7), rgba(128,88,160,.5)); }
.ame-exp-card__header-icon { font-size: 48px; color: rgba(255,255,255,.9); position: relative; z-index: 1; }
.ame-exp-card__price-tag { position: absolute; top: 12px; right: 12px; background: var(--ame-gold); color: var(--ame-wh); padding: 6px 16px; border-radius: 50px; font-size: 14px; font-weight: 700; z-index: 2; }
.ame-exp-card__body { padding: 24px; }
.ame-exp-card__title { font-family: var(--ame-df); font-size: 1.15rem; font-weight: 700; color: var(--ame-purd); margin: 0 0 8px; }
.ame-exp-card__desc { font-size: 14px; color: var(--ame-txl); line-height: 1.6; margin: 0 0 12px; }
.ame-exp-card__duration { font-size: 13px; color: var(--ame-pur); font-weight: 500; margin-bottom: 20px; }
.ame-exp-card__duration i { margin-right: 4px; }

/* ── SLOTS TITLE ── */
.ame-slots-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; color: var(--ame-txl); margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--ame-lav); }

/* ════════════════════════════════════════════
   SLOTS - ROW LAYOUT
   ════════════════════════════════════════════ */
.ame-slots-list { display: flex; flex-direction: column; gap: 10px; }

.ame-slot-row {
    display: grid;
    grid-template-columns: 70px 1fr auto auto;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--ame-lav);
    border-radius: 12px;
    border: 2px solid transparent;
    transition: all var(--ame-tr);
}
.ame-slot-row:hover { border-color: rgba(90, 67, 148, .15); }

/* ── Time ── */
.ame-slot-time {
    font-weight: 800;
    font-size: 17px;
    color: var(--ame-purd);
    font-family: var(--ame-df);
}

/* ── Availability ── */
.ame-slot-avail {
    font-size: 13px;
    color: var(--ame-txl);
    font-weight: 500;
}
.ame-slot-avail i { color: var(--ame-green); margin-right: 3px; font-size: 11px; }

/* ── Quantity selector ── */
.ame-qty {
    display: flex;
    align-items: center;
    background: var(--ame-wh);
    border: 2px solid rgba(90, 67, 148, .2);
    border-radius: 10px;
    overflow: hidden;
    height: 42px;
}

.ame-qty-minus, .ame-qty-plus {
    width: 38px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ame-wh);
    border: none;
    font-size: 18px;
    font-weight: 700;
    color: var(--ame-purd);
    cursor: pointer;
    transition: background var(--ame-tr);
    padding: 0;
    user-select: none;
    -webkit-user-select: none;
}
.ame-qty-minus:hover, .ame-qty-plus:hover { background: var(--ame-lav); }
.ame-qty-minus:active, .ame-qty-plus:active { background: rgba(90, 67, 148, .15); }

.ame-qty-val {
    width: 36px;
    text-align: center;
    font-weight: 800;
    font-size: 17px;
    color: var(--ame-purd);
    user-select: none;
    -webkit-user-select: none;
    border-left: 1px solid rgba(90, 67, 148, .12);
    border-right: 1px solid rgba(90, 67, 148, .12);
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ame-qty-label {
    font-size: 10px;
    color: var(--ame-txl);
    text-align: center;
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: .5px;
    font-weight: 600;
}

/* ── Reserve button ── */
.ame-slot-reserve {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: var(--ame-purd);
    color: var(--ame-wh);
    border: none;
    border-radius: 50px;
    font-family: var(--ame-db);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--ame-tr);
    white-space: nowrap;
    letter-spacing: .5px;
    text-transform: uppercase;
}
.ame-slot-reserve:hover { background: var(--ame-pur); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(90, 67, 148, .3); }

/* ── Booked slot ── */
.ame-slot-row--booked {
    background: #f0faf0;
    border-color: var(--ame-green);
    grid-template-columns: 70px 1fr auto;
}

.ame-slot-status {
    font-size: 13px;
    color: var(--ame-green);
    font-weight: 600;
}

.ame-slot-cancel {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 14px;
    background: var(--ame-wh);
    border: 2px solid var(--ame-red);
    border-radius: 50px;
    color: var(--ame-red);
    font-family: var(--ame-db);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--ame-tr);
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: .5px;
}
.ame-slot-cancel:hover { background: var(--ame-red); color: #fff; }

/* ── Full slot ── */
.ame-slot-row--full {
    opacity: .45;
    grid-template-columns: 70px 1fr;
}
.ame-slot-status--full { color: var(--ame-red); font-weight: 600; font-size: 13px; }

/* ════════════════════════════════════════════
   CONFIRM STEP
   ════════════════════════════════════════════ */
.ame-confirm-details { background: var(--ame-lav); border-radius: 12px; padding: 20px 24px; margin: 24px auto; max-width: 400px; text-align: left; }
.ame-confirm-details__row { display: flex; justify-content: space-between; padding: 10px 0; font-size: 15px; border-bottom: 1px solid rgba(90,67,148,.08); }
.ame-confirm-details__row:last-child { border-bottom: none; }
.ame-confirm-details__label { color: var(--ame-txl); font-weight: 500; }
.ame-confirm-details__value { color: var(--ame-purd); font-weight: 700; }
.ame-confirm-actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin-top: 28px; }

/* ── LOADING ── */
.ame-loading { text-align: center; padding: 60px 20px; color: var(--ame-txl); font-size: 15px; }
.ame-spinner { display: inline-block; width: 20px; height: 20px; border: 3px solid var(--ame-lav); border-top-color: var(--ame-purd); border-radius: 50%; animation: ameSpin .8s linear infinite; vertical-align: middle; margin-right: 6px; }
@keyframes ameSpin { to { transform: rotate(360deg); } }

.ame-empty { text-align: center; padding: 60px 20px; color: var(--ame-txl); }
.ame-empty i { font-size: 48px; color: var(--ame-lav); display: block; margin-bottom: 16px; }

/* ════════════════════════════════════════════
   TICKET POPUP
   ════════════════════════════════════════════ */
.ame-ticket-popup { position: fixed; bottom: 24px; right: 24px; width: 320px; background: var(--ame-wh); border-radius: var(--ame-r); box-shadow: 0 12px 48px rgba(90, 67, 148, .25), 0 0 0 1px rgba(90, 67, 148, .08); padding: 28px 24px; text-align: center; z-index: 99999; transform: translateY(120%) scale(.95); opacity: 0; transition: all .4s cubic-bezier(.4, 0, .2, 1); overflow: hidden; }
.ame-ticket-popup::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: linear-gradient(90deg, var(--ame-purd), var(--ame-acc), var(--ame-gold)); }
.ame-ticket-popup--visible { transform: translateY(0) scale(1); opacity: 1; }
.ame-ticket-popup__close { position: absolute; top: 12px; right: 14px; background: none; border: none; font-size: 22px; color: var(--ame-txl); cursor: pointer; line-height: 1; padding: 0; transition: color var(--ame-tr); }
.ame-ticket-popup__close:hover { color: var(--ame-purd); }
.ame-ticket-popup__icon { width: 52px; height: 52px; margin: 0 auto 12px; background: var(--ame-lav); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 22px; color: var(--ame-purd); }
.ame-ticket-popup__greeting { font-family: var(--ame-df); font-size: 16px; font-weight: 700; color: var(--ame-purd); margin: 0 0 4px; }
.ame-ticket-popup__label { font-size: 12px; color: var(--ame-txl); margin: 0 0 8px; text-transform: uppercase; letter-spacing: 1px; font-weight: 600; }
.ame-ticket-popup__code { font-family: monospace; font-size: 22px; font-weight: 800; color: var(--ame-purd); letter-spacing: 2px; background: var(--ame-lav); padding: 10px 16px; border-radius: var(--ame-rs); margin: 0 0 6px; display: inline-block; }
.ame-ticket-popup__type { font-size: 13px; color: var(--ame-pur); font-weight: 600; margin: 0 0 12px; }
.ame-ticket-popup__hint { font-size: 12px; color: var(--ame-txl); margin: 0 0 16px; }

/* ════════════════════════════════════════════
   SIDEBAR DE EXPERIENCIAS
   ════════════════════════════════════════════ */
.ame-sidebar-toggle {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 9998;
    background: linear-gradient(135deg, var(--ame-purd), var(--ame-pur));
    color: #fff;
    border: none;
    padding: 16px 12px;
    border-radius: 16px 0 0 16px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    font-family: var(--ame-db);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: -4px 0 24px rgba(90, 67, 148, 0.3);
    transition: all var(--ame-tr);
    writing-mode: vertical-rl;
    text-orientation: mixed;
}
.ame-sidebar-toggle:hover {
    padding-right: 18px;
    background: linear-gradient(135deg, var(--ame-pur), var(--ame-purd));
    box-shadow: -6px 0 32px rgba(90, 67, 148, 0.4);
}
.ame-sidebar-toggle i { font-size: 20px; writing-mode: horizontal-tb; }
.ame-sidebar-toggle__label { writing-mode: vertical-rl; text-orientation: mixed; }

.ame-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: 380px;
    max-width: 90vw;
    height: 100vh;
    background: var(--ame-wh);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    box-shadow: -8px 0 40px rgba(90, 67, 148, 0.2);
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    visibility: hidden;
}
.ame-sidebar--open { 
    transform: translateX(0); 
    visibility: visible;
}

.ame-sidebar__header {
    padding: 24px;
    background: linear-gradient(135deg, var(--ame-purd), var(--ame-pur));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}
.ame-sidebar__title {
    margin: 0;
    font-family: var(--ame-df);
    font-size: 1.3rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}
.ame-sidebar__title i { font-size: 18px; }
.ame-sidebar__close {
    background: rgba(255,255,255,0.15);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--ame-tr);
}
.ame-sidebar__close:hover { background: rgba(255,255,255,0.25); transform: rotate(90deg); }

.ame-sidebar__content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}
.ame-sidebar__intro {
    font-size: 14px;
    color: var(--ame-txl);
    margin: 0 0 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--ame-lav);
}

.ame-sidebar__list { display: flex; flex-direction: column; gap: 12px; }

.ame-sidebar__item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    background: var(--ame-lav);
    border-radius: 12px;
    cursor: pointer;
    transition: all var(--ame-tr);
    border: 2px solid transparent;
}
.ame-sidebar__item:hover {
    border-color: var(--ame-pur);
    transform: translateX(-4px);
    box-shadow: 4px 4px 16px rgba(90, 67, 148, 0.15);
}

.ame-sidebar__item-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--ame-purd), var(--ame-pur));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 20px;
    flex-shrink: 0;
    background-size: cover;
    background-position: center;
}

.ame-sidebar__item-info { flex: 1; min-width: 0; }
.ame-sidebar__item-title {
    margin: 0 0 4px;
    font-size: 14px;
    font-weight: 700;
    color: var(--ame-purd);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ame-sidebar__item-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: var(--ame-txl);
}
.ame-sidebar__item-meta i { margin-right: 4px; }
.ame-sidebar__item-price {
    background: var(--ame-gold);
    color: #fff;
    padding: 2px 8px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 11px;
}

.ame-sidebar__item-arrow {
    color: var(--ame-pur);
    font-size: 14px;
    opacity: 0.5;
    transition: all var(--ame-tr);
}
.ame-sidebar__item:hover .ame-sidebar__item-arrow {
    opacity: 1;
    transform: translateX(4px);
}

.ame-sidebar__footer {
    padding: 16px 24px;
    background: var(--ame-lav);
    font-size: 12px;
    color: var(--ame-txl);
    text-align: center;
    flex-shrink: 0;
}
.ame-sidebar__footer i { color: var(--ame-purd); margin-right: 6px; }

.ame-sidebar__overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(2px);
}
.ame-sidebar__overlay--visible { opacity: 1; visibility: visible; }

/* Highlight de tarjeta de experiencia */
.ame-exp-card--highlight {
    animation: ameHighlight 0.6s ease;
    box-shadow: 0 0 0 4px var(--ame-pur), var(--ame-shl) !important;
}
@keyframes ameHighlight {
    0%, 100% { box-shadow: 0 0 0 4px var(--ame-pur), var(--ame-shl); }
    50% { box-shadow: 0 0 0 8px rgba(128, 88, 160, 0.3), var(--ame-shl); }
}

/* Shake del input */
.ame-input--shake {
    animation: ameShake 0.6s ease;
    border-color: var(--ame-pur) !important;
}
@keyframes ameShake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-8px); }
    40%, 80% { transform: translateX(8px); }
}

/* ════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════ */
@media (max-width: 768px) {
    .ame-card { padding: 32px 24px; }
    .ame-input-group { flex-direction: column; }
    .ame-experiences-grid { grid-template-columns: 1fr; }
    .ame-header-bar { flex-direction: column; align-items: flex-start; }
    .ame-confirm-actions { flex-direction: column; align-items: center; }
    .ame-btn { width: 100%; max-width: 300px; }
    .ame-slot-row { grid-template-columns: 1fr 1fr; gap: 8px; padding: 12px; }
    .ame-slot-time { grid-column: 1; }
    .ame-slot-avail { grid-column: 2; text-align: right; }
    .ame-qty { grid-column: 1; }
    .ame-slot-reserve { grid-column: 2; justify-content: center; }
    .ame-slot-row--booked { grid-template-columns: 1fr auto; }

    .ame-sidebar-toggle { padding: 12px 10px; font-size: 10px; }
    .ame-sidebar-toggle i { font-size: 18px; }
    .ame-sidebar { width: 320px; }
}

@media (max-width: 480px) {
    .ame-booking-wrap { padding: 20px 12px; }
    .ame-days-grid { grid-template-columns: 1fr; }
    .ame-ticket-popup { left: 12px; right: 12px; bottom: 12px; width: auto; }

    .ame-sidebar-toggle__label { display: none; }
    .ame-sidebar-toggle { padding: 14px 10px; }
    .ame-sidebar { width: 100%; max-width: 100vw; }
}
