/* ============================================================
   Chirino Sorteos — Frontend Styles
   ============================================================ */

/* ====================================================
   CARRUSEL FULLWIDTH
   ==================================================== */
.sorteo-carousel-section {
  background: #000;
  position: relative;
  overflow: hidden;
}

.csrt-carousel {
  position: relative;
  width: 100%;
  outline: none;
}

/* Track */
.csrt-track {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: #0a0a0a;
}
@media (max-width: 640px) {
  .csrt-track { aspect-ratio: 4/3; }
}

/* Slides */
.csrt-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity .42s ease;
  pointer-events: none;
  z-index: 0;
}
.csrt-slide.csrt-active {
  opacity: 1;
  pointer-events: auto;
  z-index: 2;
}

/* Animaciones de entrada/salida */
.csrt-slide.csrt-slide-in-right  { animation: csrt-in-right  .42s ease forwards; z-index: 3; }
.csrt-slide.csrt-slide-in-left   { animation: csrt-in-left   .42s ease forwards; z-index: 3; }
.csrt-slide.csrt-slide-out-left  { animation: csrt-out-left  .42s ease forwards; z-index: 1; }
.csrt-slide.csrt-slide-out-right { animation: csrt-out-right .42s ease forwards; z-index: 1; }

@keyframes csrt-in-right  { from { transform: translateX(6%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes csrt-in-left   { from { transform: translateX(-6%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes csrt-out-left  { from { transform: translateX(0); opacity: 1; } to { transform: translateX(-4%); opacity: 0; } }
@keyframes csrt-out-right { from { transform: translateX(0); opacity: 1; } to { transform: translateX(4%); opacity: 0; } }

.csrt-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}

/* Flechas */
.csrt-prev,
.csrt-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 52px;
  height: 52px;
  background: rgba(10,10,10,.65);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s, transform .2s, opacity .2s;
  opacity: 0;
  backdrop-filter: blur(6px);
}
.csrt-prev { left: 20px; }
.csrt-next { right: 20px; }
.csrt-prev svg,
.csrt-next svg { width: 22px; height: 22px; }
.csrt-carousel:hover .csrt-prev,
.csrt-carousel:hover .csrt-next { opacity: 1; }
.csrt-prev:hover { background: var(--color-primary, #2a8a8a); transform: translateY(-50%) scale(1.08); }
.csrt-next:hover { background: var(--color-primary, #2a8a8a); transform: translateY(-50%) scale(1.08); }

/* Contador */
.csrt-counter {
  position: absolute;
  top: 18px;
  right: 20px;
  z-index: 10;
  background: rgba(10,10,10,.6);
  color: rgba(255,255,255,.85);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .06em;
  padding: .3rem .8rem;
  border-radius: 20px;
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,.1);
}

/* Thumbnails strip */
.csrt-thumbs-strip {
  display: flex;
  gap: 6px;
  padding: 10px 14px;
  background: #0a0a0a;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: #333 #0a0a0a;
}
.csrt-thumbs-strip::-webkit-scrollbar { height: 4px; }
.csrt-thumbs-strip::-webkit-scrollbar-track { background: #0a0a0a; }
.csrt-thumbs-strip::-webkit-scrollbar-thumb { background: #333; border-radius: 2px; }

.csrt-thumb {
  flex-shrink: 0;
  width: 90px;
  height: 60px;
  border-radius: 5px;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  background: #1a1a1a;
  padding: 0;
  transition: border-color .2s, transform .2s, opacity .2s;
  opacity: .55;
}
.csrt-thumb:hover { opacity: .85; transform: scale(1.04); }
.csrt-thumb.csrt-thumb-active { border-color: var(--color-primary, #2a8a8a); opacity: 1; }
.csrt-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }

/* Mobile: flechas siempre visibles y más pequeñas */
@media (max-width: 640px) {
  .csrt-prev, .csrt-next { width: 40px; height: 40px; opacity: 1; }
  .csrt-prev { left: 10px; }
  .csrt-next { right: 10px; }
  .csrt-prev svg, .csrt-next svg { width: 18px; height: 18px; }
  .csrt-thumb { width: 70px; height: 48px; }
}

/* ---- Badge de estado ---- */
.sorteo-badge {
	display: inline-block;
	padding: .25rem .75rem;
	border-radius: 20px;
	font-size: .72rem;
	font-weight: 700;
	letter-spacing: .05em;
	text-transform: uppercase;
}
.badge-active    { background: rgba(34,197,94,.15);  color: #22c55e; border: 1px solid rgba(34,197,94,.3);  }
.badge-upcoming  { background: rgba(245,158,11,.15); color: #f59e0b; border: 1px solid rgba(245,158,11,.3); }
.badge-done      { background: rgba(107,114,128,.15);color: #9ca3af; border: 1px solid rgba(107,114,128,.3);}

/* ---- Countdown ---- */
.csrt-countdown {
	display: inline-flex;
	align-items: center;
	gap: 8px;
}
.csrt-cd-unit { text-align: center; min-width: 3rem; }
.csrt-cd-num {
	display: block;
	font-family: var(--font-heading, 'Bebas Neue', sans-serif);
	font-size: clamp(2.4rem, 5vw, 3.5rem);
	font-weight: 800;
	color: var(--color-primary, #2a8a8a);
	line-height: 1;
	background: var(--color-surface, #111);
	border: 1px solid var(--color-border, #222);
	border-radius: 8px;
	padding: .4rem .6rem;
	min-width: 3rem;
}
.csrt-cd-label {
	display: block;
	font-size: .65rem;
	color: var(--color-muted, #888);
	text-transform: uppercase;
	letter-spacing: .06em;
	margin-top: .4rem;
}
.csrt-cd-sep {
	color: var(--color-primary, #2a8a8a);
	font-size: 2.5rem;
	font-weight: 800;
	margin-bottom: 1.2rem;
	line-height: 1;
}
.csrt-expired {
	color: var(--color-muted, #6b7280);
	font-size: .9rem;
}

/* Wrapper con título */
.csrt-countdown-wrap {
	text-align: center;
	padding: 2.5rem 0;
}
.csrt-countdown-wrap .csrt-countdown-label {
	font-size: .75rem;
	text-transform: uppercase;
	letter-spacing: .1em;
	color: var(--color-muted, #888);
	margin-bottom: 1rem;
}

/* ---- Galería ---- */
.csrt-gallery {
	display: grid;
	gap: .75rem;
}
.csrt-gallery-main {
	position: relative;
	aspect-ratio: 16/9;
	border-radius: var(--radius-lg, 12px);
	overflow: hidden;
	background: var(--color-surface, #111);
}
.csrt-gallery-main img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform .6s ease;
}
.csrt-gallery-main:hover img { transform: scale(1.03); }
.csrt-gallery-thumbs {
	display: flex;
	gap: .5rem;
	flex-wrap: wrap;
}
.csrt-gallery-thumb {
	width: 72px;
	height: 72px;
	border-radius: 6px;
	overflow: hidden;
	border: 2px solid transparent;
	cursor: pointer;
	transition: border-color .2s;
	flex-shrink: 0;
}
.csrt-gallery-thumb.active,
.csrt-gallery-thumb:hover { border-color: var(--color-primary, #2a8a8a); }
.csrt-gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* ---- Paquetes de chances ---- */
.csrt-paquetes {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 1rem;
}
.csrt-pkg-card {
	background: var(--color-surface, #111);
	border: 1px solid var(--color-border, #222);
	border-radius: var(--radius-lg, 12px);
	padding: 1.75rem 1.25rem;
	text-align: center;
	transition: all .25s;
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: .5rem;
}
.csrt-pkg-card:hover {
	border-color: var(--color-primary, #2a8a8a);
	transform: translateY(-4px);
	box-shadow: 0 16px 40px rgba(0,0,0,.4);
}
.csrt-pkg-card.destacado {
	border-color: var(--color-primary, #2a8a8a);
	background: rgba(42,138,138,.06);
}
.csrt-pkg-destacado-badge {
	position: absolute;
	top: -10px;
	left: 50%;
	transform: translateX(-50%);
	background: var(--color-primary, #2a8a8a);
	color: #fff;
	font-size: .65rem;
	font-weight: 700;
	letter-spacing: .06em;
	text-transform: uppercase;
	padding: .2rem .7rem;
	border-radius: 20px;
	white-space: nowrap;
}
.csrt-pkg-nombre {
	font-size: .8rem;
	text-transform: uppercase;
	letter-spacing: .06em;
	color: var(--color-muted, #888);
}
.csrt-pkg-cantidad {
	font-family: var(--font-heading, 'Bebas Neue', sans-serif);
	font-size: 3rem;
	color: var(--color-heading, #e8d9b0);
	line-height: 1;
}
.csrt-pkg-cantidad span {
	font-size: 1rem;
	font-family: var(--font-body, 'Inter', sans-serif);
	color: var(--color-muted, #888);
	font-weight: 500;
}
.csrt-pkg-precio {
	font-size: 1.5rem;
	font-weight: 800;
	color: var(--color-primary, #2a8a8a);
}
.csrt-pkg-form {
	width: 100%;
	margin-top: .5rem;
}
.csrt-pkg-cta {
	margin-top: 0;
	width: 100%;
}

/* ---- Selector de cantidad dentro del pack ---- */
.csrt-qty-wrap {
	width: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: .35rem;
	margin: .5rem 0 .25rem;
}
.csrt-qty-label {
	font-size: .65rem;
	text-transform: uppercase;
	letter-spacing: .08em;
	color: var(--color-muted, #888);
}
.csrt-qty-control {
	display: inline-flex;
	align-items: stretch;
	border: 1px solid var(--color-border, #222);
	border-radius: 8px;
	overflow: hidden;
	background: var(--color-bg, #0a0a0a);
}
.csrt-qty-btn {
	width: 34px;
	background: transparent;
	border: 0;
	color: var(--color-primary, #2a8a8a);
	font-size: 1.25rem;
	font-weight: 700;
	cursor: pointer;
	transition: background .15s;
	line-height: 1;
}
.csrt-qty-btn:hover { background: rgba(42,138,138,.12); }
.csrt-qty-btn:active { transform: scale(.95); }
.csrt-qty-input {
	width: 48px;
	background: transparent;
	border: 0;
	color: var(--color-heading, #e8d9b0);
	text-align: center;
	font-size: 1rem;
	font-weight: 700;
	font-family: var(--font-heading, 'Bebas Neue', sans-serif);
	-moz-appearance: textfield;
	appearance: textfield;
	padding: .4rem 0;
}
.csrt-qty-input::-webkit-outer-spin-button,
.csrt-qty-input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}
.csrt-qty-input:focus { outline: none; }
.csrt-qty-hint {
	font-size: .72rem;
	color: var(--color-muted, #888);
	margin: 0;
}
.csrt-qty-hint .csrt-qty-total {
	color: var(--color-primary, #2a8a8a);
	font-weight: 700;
	font-family: var(--font-heading, 'Bebas Neue', sans-serif);
	font-size: .95rem;
}

/* ---- Ganador section ---- */
.csrt-ganador {
	background: linear-gradient(135deg, rgba(42,138,138,.1), rgba(232,217,176,.05));
	border: 1px solid var(--color-primary, #2a8a8a);
	border-radius: var(--radius-lg, 12px);
	padding: 2rem;
	text-align: center;
}
.csrt-ganador-icon { font-size: 3rem; margin-bottom: .75rem; }
.csrt-ganador-label {
	font-size: .75rem;
	text-transform: uppercase;
	letter-spacing: .1em;
	color: var(--color-muted, #888);
	margin-bottom: .5rem;
}
.csrt-ganador-nombre {
	font-family: var(--font-heading, 'Bebas Neue', sans-serif);
	font-size: 2.5rem;
	color: var(--color-heading, #e8d9b0);
	line-height: 1;
}
.csrt-ganador-numero {
	font-size: 1.1rem;
	color: var(--color-primary, #2a8a8a);
	font-weight: 700;
	margin-top: .5rem;
}

.csrt-ganador-entry { margin-top: .75rem; }
.csrt-ganador-entry:first-of-type { margin-top: .5rem; }

.csrt-ganador-premio {
	font-size: .72rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .06em;
	color: var(--color-primary, #2a8a8a);
	margin-bottom: .2rem;
}

/* ---- Archive grid ---- */
.csrt-archive-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
	gap: 1.5rem;
}
.csrt-sorteo-card {
	background: var(--color-surface, #111);
	border: 1px solid var(--color-border, #222);
	border-radius: var(--radius-lg, 12px);
	overflow: hidden;
	transition: all .25s;
	display: flex;
	flex-direction: column;
}
.csrt-sorteo-card:hover {
	border-color: var(--color-primary, #2a8a8a);
	transform: translateY(-4px);
	box-shadow: 0 16px 40px rgba(0,0,0,.4);
}
.csrt-card-img {
	aspect-ratio: 16/9;
	overflow: hidden;
	position: relative;
	background: var(--color-bg, #0a0a0a);
}
.csrt-card-img img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform .5s ease;
}
.csrt-sorteo-card:hover .csrt-card-img img { transform: scale(1.06); }
.csrt-card-body { padding: 1.5rem; flex: 1; display: flex; flex-direction: column; gap: .75rem; }
.csrt-card-meta { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.csrt-card-title {
	font-family: var(--font-heading, 'Bebas Neue', sans-serif);
	font-size: 1.6rem;
	color: var(--color-heading, #e8d9b0);
	line-height: 1.1;
}
.csrt-card-desde {
	font-size: .8rem;
	color: var(--color-muted, #888);
	margin-top: auto;
}
.csrt-card-desde strong { color: var(--color-primary, #2a8a8a); font-size: .95rem; }
.csrt-card-footer { padding: 0 1.5rem 1.5rem; }

/* ---- Premios section ---- */
.csrt-premios-section { display: flex; flex-direction: column; gap: 1rem; }

.csrt-premios-list { display: flex; flex-direction: column; gap: .75rem; }

.csrt-premio-item {
  display: flex;
  gap: 1rem;
  align-items: center;
  background: var(--color-surface, #111);
  border: 1px solid var(--color-border, #222);
  border-radius: var(--radius-lg, 12px);
  padding: 1rem 1.25rem;
  transition: border-color .2s;
}
.csrt-premio-item:hover { border-color: var(--color-primary, #2a8a8a); }

.csrt-premio-principal {
  border-color: var(--color-primary, #2a8a8a);
  background: rgba(42,138,138,.06);
}

.csrt-premio-img {
  flex-shrink: 0;
  width: 90px;
  height: 70px;
  border-radius: 8px;
  overflow: hidden;
}
.csrt-premio-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.csrt-premio-info { flex: 1; min-width: 0; }

.csrt-premio-posicion {
  display: inline-block;
  font-size: .68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--color-primary, #2a8a8a);
  margin-bottom: .3rem;
}
.csrt-premio-principal .csrt-premio-posicion { color: var(--color-heading, #e8d9b0); }

.csrt-premio-nombre {
  font-family: var(--font-heading, 'Bebas Neue', sans-serif);
  font-size: 1.35rem;
  color: var(--color-heading, #e8d9b0);
  line-height: 1.1;
  margin: 0 0 .25rem;
}
.csrt-premio-desc {
  font-size: .8rem;
  color: var(--color-muted, #888);
  margin: 0;
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Responsive */
@media (max-width: 640px) {
	.csrt-paquetes     { grid-template-columns: 1fr; gap: .5rem; }
	.csrt-archive-grid { grid-template-columns: 1fr; }
	.csrt-cd-num       { font-size: 2rem; min-width: 2.5rem; padding: .3rem .4rem; }

	/* Pack card en mobile — layout HORIZONTAL compacto: el número grande
	   de chances queda a la izquierda como protagonista visual, el resto
	   (nombre, precio, selector, botón) se distribuye a la derecha. */
	.csrt-pkg-card {
		padding: .7rem .85rem;
		display: grid;
		grid-template-columns: auto 1fr auto;
		grid-template-areas:
			"qty  name   price"
			"qty  form   form";
		text-align: left;
		align-items: center;
		column-gap: .8rem;
		row-gap: .35rem;
		border-radius: 12px;
	}

	.csrt-pkg-destacado-badge {
		font-size: .55rem;
		padding: .12rem .5rem;
		top: -7px;
		letter-spacing: .04em;
	}

	/* Cantidad: protagonista a la izquierda, ocupa las 2 filas */
	.csrt-pkg-cantidad {
		grid-area: qty;
		grid-row: 1 / 3;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		font-size: 1.85rem;
		line-height: .95;
		min-width: 52px;
		padding: 0 .25rem;
		border-right: 1px solid var(--color-border, #222);
		gap: 0;
		text-align: center;
	}
	.csrt-pkg-cantidad span {
		font-size: .58rem;
		margin: 2px 0 0;
		letter-spacing: .04em;
	}

	/* Pack destacado: borde lateral teal en lugar del divisor gris */
	.csrt-pkg-card.destacado .csrt-pkg-cantidad {
		border-right-color: var(--color-primary, #2a8a8a);
	}

	/* Nombre — fila 1, columna middle, alineado al final */
	.csrt-pkg-nombre {
		grid-area: name;
		font-size: .62rem;
		letter-spacing: .07em;
		align-self: end;
		margin: 0;
	}

	/* Precio — fila 1, columna derecha */
	.csrt-pkg-precio {
		grid-area: price;
		font-size: 1rem;
		font-weight: 800;
		align-self: end;
		margin: 0;
		white-space: nowrap;
	}

	/* Form — fila 2 completa (derecha), selector + botón en una línea */
	.csrt-pkg-form {
		grid-area: form;
		margin: 0;
		display: flex;
		flex-direction: row;
		align-items: center;
		gap: .45rem;
	}

	.csrt-qty-wrap {
		flex-direction: row;
		align-items: center;
		gap: .3rem;
		margin: 0;
		width: auto;
		flex-shrink: 0;
	}
	.csrt-qty-label { display: none; }
	.csrt-qty-control { flex-shrink: 0; }
	.csrt-qty-btn   { width: 24px; font-size: .9rem; }
	.csrt-qty-input { width: 28px; font-size: .78rem; padding: .18rem 0; }
	.csrt-qty-hint  {
		font-size: .55rem;
		margin: 0;
		white-space: nowrap;
	}

	.csrt-pkg-cta {
		padding: .42rem .55rem;
		font-size: .72rem;
		line-height: 1.15;
		margin: 0;
		flex: 1;
		min-width: 0;
		white-space: nowrap;
		text-overflow: ellipsis;
		overflow: hidden;
	}
}

@media (max-width: 400px) {
	.csrt-paquetes { gap: .4rem; }
	.csrt-pkg-card {
		padding: .6rem .65rem;
		column-gap: .6rem;
	}
	.csrt-pkg-cantidad {
		font-size: 1.65rem;
		min-width: 46px;
	}
	.csrt-pkg-precio { font-size: .92rem; }

	/* En pantallas muy chicas, si no entra todo en una fila, apilar form */
	.csrt-pkg-form { flex-wrap: wrap; }
	.csrt-pkg-cta { flex-basis: 100%; }
}
