/* TurismoPista Ticketera - Frontend
   Estilos autocontenidos y neutrales para integrarse con el tema sin romperlo. */

.tp-eventos-grid,
.tp-purchase,
.tp-checkout,
.tp-ticket-view,
.tp-scanner {
	--tp-brand: #e2001a;
	--tp-brand-2: #111111;
	--tp-radius: 14px;
	--tp-border: #e6e6e9;
	box-sizing: border-box;
}

.tp-eventos-grid *,
.tp-purchase *,
.tp-checkout *,
.tp-scanner * {
	box-sizing: border-box;
}

/* ---------- Botones ---------- */
.tp-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 11px 18px;
	border-radius: 999px;
	border: 1px solid var(--tp-border);
	background: #fff;
	color: #222;
	font-weight: 700;
	font-size: 15px;
	line-height: 1;
	text-decoration: none;
	cursor: pointer;
	transition: transform .05s ease, box-shadow .15s ease, background .15s ease;
}
.tp-btn:hover { box-shadow: 0 4px 14px rgba(0,0,0,.1); }
.tp-btn:active { transform: translateY(1px); }
.tp-btn--primary { background: var(--tp-brand); border-color: var(--tp-brand); color: #fff; }
.tp-btn--primary:hover { filter: brightness(.95); color:#fff; }
.tp-btn--block { display: flex; width: 100%; }
.tp-btn--lg { padding: 15px 20px; font-size: 17px; }
.tp-btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- Volver al listado ---------- */
.tp-back { margin: 0 0 18px; }
.tp-back__link {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-weight: 700;
	font-size: 14px;
	text-decoration: none;
	color: var(--tp-brand, #e2001a);
	padding: 8px 14px;
	border: 1px solid var(--tp-border, #e6e6e9);
	border-radius: 999px;
	background: #fff;
	transition: background .15s ease, box-shadow .15s ease;
}
.tp-back__link:hover { box-shadow: 0 4px 14px rgba(0,0,0,.08); background: #fafafa; }
.tp-back__arrow { font-size: 16px; line-height: 1; }

/* ---------- Grid de eventos ---------- */
.tp-eventos-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 22px;
	margin: 20px 0;
}
.tp-event-card {
	background: #fff;
	border: 1px solid var(--tp-border);
	border-radius: var(--tp-radius);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	box-shadow: 0 2px 10px rgba(0,0,0,.05);
}
.tp-event-card__media {
	position: relative;
	display: block;
	aspect-ratio: 16/9;
	background: #1a1a1a;
	overflow: hidden;
}
.tp-event-card__media img { width: 100%; height: 100%; object-fit: cover; }
.tp-event-card__ph { display:flex; align-items:center; justify-content:center; height:100%; font-size:48px; }
.tp-event-card__badge {
	position: absolute;
	top: 10px; left: 10px;
	background: rgba(0,0,0,.7);
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .5px;
	padding: 5px 10px;
	border-radius: 999px;
}
.tp-badge--agotado { background: #b00020; }
.tp-badge--finalizado { background: #555; }
.tp-badge--activo { background: #1a8f3c; }
.tp-event-card__body { padding: 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.tp-event-card__date { font-size: 12px; color: var(--tp-brand); font-weight: 700; text-transform: uppercase; }
.tp-event-card__title { margin: 0; font-size: 18px; line-height: 1.25; }
.tp-event-card__title a { color: var(--tp-brand-2); text-decoration: none; }
.tp-event-card__place { font-size: 13px; color: #666; }
.tp-event-card .tp-btn { margin-top: auto; }
.tp-event-card.is-sold .tp-btn { background:#eee; color:#999; border-color:#eee; pointer-events:none; }

/* ---------- Caja de compra en el evento ---------- */
.tp-purchase {
	margin: 30px 0;
	padding: 22px;
	border: 1px solid var(--tp-border);
	border-radius: var(--tp-radius);
	background: #fff;
}
.tp-purchase__meta { display:flex; flex-wrap:wrap; gap:14px; color:#555; font-size:14px; margin-bottom:14px; }
.tp-purchase__title { margin: 0 0 16px; font-size: 20px; }

.tp-types { display: flex; flex-direction: column; gap: 12px; }
.tp-type {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
	padding: 14px 16px;
	border: 1px solid var(--tp-border);
	border-radius: 12px;
}
.tp-type.is-out { opacity: .55; }
.tp-type__name { font-weight: 700; font-size: 16px; }
.tp-type__desc { font-size: 13px; color: #666; margin-top: 2px; }
.tp-type__price { font-weight: 800; color: var(--tp-brand); margin-top: 4px; font-size: 16px; }
.tp-type__until { font-size: 12px; color: #999; margin-top: 2px; }
.tp-type__out { font-weight: 700; color: #b00020; }

.tp-type__qty { display: flex; align-items: center; gap: 8px; flex: none; }
.tp-step {
	width: 38px; height: 38px;
	border-radius: 10px;
	border: 1px solid var(--tp-border);
	background: #f7f7f8;
	font-size: 20px; font-weight: 700;
	cursor: pointer;
	line-height: 1;
}
.tp-type__qty input {
	width: 54px; height: 38px;
	text-align: center;
	border: 1px solid var(--tp-border);
	border-radius: 10px;
	font-size: 16px;
	-moz-appearance: textfield;
}
.tp-type__qty input::-webkit-outer-spin-button,
.tp-type__qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.tp-select-footer {
	margin-top: 18px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	flex-wrap: wrap;
}
.tp-select-total { font-size: 16px; }
.tp-select-total strong { font-size: 20px; color: var(--tp-brand-2); }

/* ---------- Checkout ---------- */
.tp-checkout { margin: 24px 0; }
.tp-checkout__grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 26px; align-items: start; }
.tp-checkout__form, .tp-checkout__summary {
	background: #fff;
	border: 1px solid var(--tp-border);
	border-radius: var(--tp-radius);
	padding: 22px;
}
.tp-checkout__form h3, .tp-checkout__summary h3 { margin: 0 0 6px; }
.tp-hint { color:#666; font-size:14px; margin: 0 0 16px; }
.tp-field { display: block; margin-bottom: 14px; }
.tp-field > span { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color:#333; }
.tp-field input {
	width: 100%;
	padding: 12px 14px;
	border: 1px solid var(--tp-border);
	border-radius: 10px;
	font-size: 16px;
}
.tp-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tp-interes { border: 1px solid var(--tp-border); border-radius: 10px; padding: 12px 14px; margin: 6px 0 18px; }
.tp-interes legend { font-size: 13px; font-weight: 600; padding: 0 6px; }
.tp-interes__opts { display: flex; flex-wrap: wrap; gap: 14px; }
.tp-check { display: inline-flex; align-items: center; gap: 7px; font-size: 15px; }
.tp-secure { font-size: 12px; color: #888; text-align: center; margin: 10px 0 0; }

.tp-summary__event { font-weight: 700; margin-bottom: 10px; }
.tp-summary__items { list-style: none; margin: 0 0 14px; padding: 0; }
.tp-summary__items li { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px dashed var(--tp-border); font-size: 14px; }
.tp-promo { display: flex; gap: 8px; margin: 10px 0 4px; }
.tp-promo input { flex: 1; padding: 10px 12px; border: 1px solid var(--tp-border); border-radius: 10px; }
.tp-promo__msg { font-size: 13px; min-height: 18px; }
.tp-promo__msg.is-ok { color: #1a8f3c; }
.tp-promo__msg.is-err { color: #b00020; }
.tp-summary__totals { margin-top: 12px; border-top: 2px solid var(--tp-border); padding-top: 12px; }
.tp-summary__row { display: flex; justify-content: space-between; padding: 4px 0; }
.tp-summary__row--total { font-size: 19px; font-weight: 800; color: var(--tp-brand-2); }
.tp-summary__row--disc { color: #1a8f3c; }

/* ---------- Resultado ---------- */
.tp-result { text-align: center; max-width: 620px; margin: 30px auto; }
.tp-result__icon { width: 78px; height: 78px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 42px; color: #fff; margin-bottom: 10px; }
.tp-result__icon--ok { background: #1a8f3c; }
.tp-result__icon--pending { background: #e0a400; }
.tp-result__icon--fail { background: #b00020; }
.tp-result__tickets { margin: 24px 0; display: flex; flex-direction: column; gap: 20px; }

/* ---------- Avisos ---------- */
.tp-notice { padding: 14px 16px; border-radius: 10px; background: #f3f4f6; color: #333; }
.tp-notice--warn { background: #fdecec; color: #922; }
.tp-notice ul { margin: 0; padding-left: 18px; }
.tp-empty { color:#777; }

/* ---------- Scanner ---------- */
.tp-scanner { max-width: 480px; margin: 20px auto; }
.tp-scanner__bar { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.tp-scanner__bar select { padding: 8px; border-radius: 8px; border: 1px solid var(--tp-border); }
.tp-scan-check { font-size: 14px; }
.tp-scanner__reader { border-radius: 12px; overflow: hidden; background: #000; min-height: 60px; }
.tp-scanner__controls { display: flex; gap: 10px; margin: 14px 0; }
.tp-scanner__manual { display: flex; gap: 8px; margin-bottom: 14px; }
.tp-scanner__manual input { flex: 1; padding: 10px 12px; border: 1px solid var(--tp-border); border-radius: 10px; }
.tp-scan-res { padding: 20px; border-radius: 12px; text-align: center; color: #fff; }
.tp-scan-res.is-ok { background: #1a8f3c; }
.tp-scan-res.is-warn { background: #e0a400; }
.tp-scan-res.is-err { background: #b00020; }
.tp-scan-res__msg { font-size: 22px; font-weight: 800; }
.tp-scan-res__detail { margin-top: 10px; font-size: 15px; opacity: .95; }
.tp-scanner-login { text-align: center; padding: 30px; }

/* ---------- Responsive ---------- */
@media (max-width: 782px) {
	.tp-checkout__grid { grid-template-columns: 1fr; }
	.tp-field-row { grid-template-columns: 1fr; }
	.tp-select-footer { flex-direction: column; align-items: stretch; }
	.tp-select-footer .tp-btn { width: 100%; }
}
