/* HD Packs — selector.
 *
 * Deliberadamente sin colores propios: hereda tipografía, color de texto y
 * fondo del tema. Los bordes y los tintes se derivan de currentColor, así que
 * el módulo se ve como el resto de la página tanto en claro como en oscuro.
 *
 * Para forzar un color concreto, redefine estas variables desde el CSS
 * adicional de Kadence:
 *
 *   .hdp { --hdp-line: #444; --hdp-accent: #b5ff3a; }
 */

.hdp {
	--hdp-line: color-mix(in srgb, currentColor 28%, transparent);
	--hdp-line-strong: color-mix(in srgb, currentColor 65%, transparent);
	--hdp-accent: currentColor;
	--hdp-tint: color-mix(in srgb, currentColor 8%, transparent);
	--hdp-mute: color-mix(in srgb, currentColor 65%, transparent);

	margin: 0 0 2rem;
	container-type: inline-size;
	color: inherit;
	font: inherit;
}

.hdp *, .hdp *::before, .hdp *::after { box-sizing: border-box; }

.hdp-testmode {
	border: 1px dashed var(--hdp-line-strong);
	border-radius: 6px;
	padding: .6rem .8rem;
	font-size: .85rem;
	margin: 0 0 1rem;
	opacity: .8;
}

.hdp-soon {
	padding: 1.2rem;
	border: 1px dashed var(--hdp-line);
	border-radius: 8px;
	text-align: center;
}

/* Elección de pack (solo en el modo de tres) */
.hdp-choices { display: grid; grid-template-columns: 1fr; gap: .75rem; }
@container (min-width: 700px) { .hdp-choices { grid-template-columns: repeat(3, 1fr); } }

.hdp-choice {
	display: flex; flex-direction: column; gap: .25rem;
	text-align: left; padding: 1rem; width: 100%;
	border: 1px solid var(--hdp-line); border-radius: 10px;
	background: transparent; color: inherit; font: inherit;
	cursor: pointer; transition: border-color .15s;
}
.hdp-choice:hover { border-color: var(--hdp-line-strong); }
.hdp-choice.is-active { border-color: var(--hdp-accent); background: var(--hdp-tint); }
.hdp-choice.is-blocked { opacity: .55; }
.hdp-choice-name { font-weight: 700; }
.hdp-choice-price { font-size: 1.5rem; font-weight: 700; line-height: 1.1; }
.hdp-choice-claim { font-size: .875rem; opacity: .75; }
.hdp-choice-saving { font-size: .8rem; font-weight: 700; }
.hdp-choice-state { font-size: .78rem; opacity: .7; font-style: italic; }
.hdp-choice-state:empty { display: none; }

/* Panel */
.hdp-panel { margin-top: 1.25rem; }
.hdp:not(.hdp-single) .hdp-panel { padding-top: 1.25rem; border-top: 1px solid var(--hdp-line); }
.hdp-single .hdp-panel { margin-top: 0; }

.hdp-anon, .hdp-packstate {
	font-size: .875rem;
	border-left: 2px solid var(--hdp-line-strong);
	padding: .5rem .75rem;
	margin: 0 0 1rem;
}
.hdp-packstate { font-weight: 600; }
.hdp-help { font-weight: 600; margin: 0 0 1rem; }

/* Desplegables (style="slots") */
.hdp-slot { margin-bottom: .7rem; }
.hdp-slot label {
	display: block; font-size: .75rem; text-transform: uppercase;
	letter-spacing: .05em; opacity: .65; margin-bottom: .25rem;
}
.hdp-select {
	width: 100%; padding: .55rem .6rem;
	border: 1px solid var(--hdp-line-strong); border-radius: 6px;
	background-color: transparent; color: inherit; font: inherit;
}
.hdp-select:focus { outline: 2px solid var(--hdp-accent); outline-offset: 1px; }

/* Rejilla de tarjetas (style por defecto) */
.hdp-tier { margin-bottom: 1.5rem; }
.hdp-tier h4 {
	margin: 0 0 .6rem; font-size: .8rem; letter-spacing: .06em;
	text-transform: uppercase; opacity: .65;
}

.hdp-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: .6rem; }
@container (min-width: 520px) { .hdp-cards { grid-template-columns: repeat(3, 1fr); } }
@container (min-width: 860px) { .hdp-cards { grid-template-columns: repeat(5, 1fr); } }
@supports not (container-type: inline-size) {
	@media (min-width: 560px) { .hdp-cards { grid-template-columns: repeat(3, 1fr); } }
	@media (min-width: 900px) { .hdp-cards { grid-template-columns: repeat(5, 1fr); } }
}

.hdp-card {
	position: relative; display: flex; flex-direction: column;
	gap: .35rem; padding: .5rem; text-align: left;
	border: 1px solid var(--hdp-line); border-radius: 8px;
	background: transparent; color: inherit; font: inherit;
	cursor: pointer; transition: border-color .15s;
}
.hdp-card:hover:not(:disabled) { border-color: var(--hdp-line-strong); }
.hdp-card.is-selected { border-color: var(--hdp-accent); background: var(--hdp-tint); }
.hdp-card:disabled, .hdp-card.is-disabled { opacity: .35; cursor: not-allowed; }
.hdp-card.is-owned { opacity: .45; }
.hdp-card img { width: 100%; aspect-ratio: 1/1; object-fit: cover; border-radius: 4px; display: block; }
.hdp-card-noimg { width: 100%; aspect-ratio: 1/1; border-radius: 4px; background: var(--hdp-tint); display: block; }
.hdp-card-name { font-size: .8rem; line-height: 1.25; font-weight: 600; }

/* Estilo compacto */
.hdp-compact .hdp-cards { grid-template-columns: 1fr !important; gap: .3rem; }
.hdp-compact .hdp-tier { margin-bottom: 1rem; }
.hdp-card-row { flex-direction: row !important; align-items: center; gap: .5rem !important; padding: .5rem .6rem !important; }
.hdp-card-row .hdp-card-name { flex: 1 1 auto; font-size: .85rem; }
.hdp-row-box {
	flex: 0 0 auto; width: 1.1rem; height: 1.1rem;
	border: 1px solid var(--hdp-line-strong); border-radius: 4px;
	display: grid; place-items: center;
}
.hdp-card-row.is-selected .hdp-row-box::after { content: "✓"; font-size: .75rem; line-height: 1; }

.hdp-tag {
	display: inline-block; font-size: .68rem; text-transform: uppercase;
	letter-spacing: .04em; border: 1px solid var(--hdp-line-strong);
	border-radius: 3px; padding: .05rem .3rem; opacity: .8;
}

/* Lista del Pack Escuela, plegable */
.hdp-details { border: 1px solid var(--hdp-line); border-radius: 8px; margin: 0 0 1rem; }
.hdp-details > summary {
	cursor: pointer; padding: .7rem .9rem; font-weight: 600; list-style: none;
	display: flex; align-items: center; justify-content: space-between; gap: .5rem;
}
.hdp-details > summary::-webkit-details-marker { display: none; }
.hdp-details > summary::after { content: "▾"; transition: transform .15s; }
.hdp-details[open] > summary::after { transform: rotate(180deg); }
.hdp-details > div { padding: 0 .9rem .9rem; }

.hdp-list {
	list-style: none; padding: 0; margin: 0;
	display: grid; grid-template-columns: 1fr; gap: .2rem;
}
@container (min-width: 480px) { .hdp-list { grid-template-columns: repeat(2, 1fr); } }
@container (min-width: 800px) { .hdp-list { grid-template-columns: repeat(3, 1fr); } }
.hdp-list li { font-size: .875rem; padding: .25rem .5rem; border-left: 2px solid var(--hdp-line); }
.hdp-list li.is-owned { opacity: .55; }

.hdp-note { font-size: .875rem; font-weight: 600; margin: .8rem 0 0; }
.hdp-excludes { font-size: .8rem; opacity: .7; margin: .8rem 0 0; }
.hdp-error { font-size: .875rem; font-weight: 600; }

/* Avisos de un «añadir al carrito» rechazado. Se pintan con el marcado del
   módulo, no con las plantillas de WooCommerce, para que hereden el diseño de
   la página y no queden fuera de sitio. */
.hdp-notices { margin: 0 0 1rem; display: grid; gap: .5rem; }
.hdp-notices:focus { outline: none; }
.hdp-notice {
	margin: 0;
	padding: .7rem .9rem;
	border: 1px solid var(--hdp-line-strong);
	border-left-width: 4px;
	border-radius: 6px;
	background: var(--hdp-tint);
	font-size: .875rem;
	font-weight: 600;
}

/* Barra de compra */
.hdp-bar {
	display: flex; flex-wrap: wrap; gap: .75rem;
	align-items: center; justify-content: space-between;
	padding-top: .9rem; margin-top: 1rem;
	border-top: 1px solid var(--hdp-line);
}
.hdp-bar-info { display: flex; flex-direction: column; }
.hdp-count { font-weight: 700; font-size: .9rem; }
.hdp-saving { font-size: .875rem; font-weight: 600; }
.hdp-saving:empty { display: none; }

/* El botón lo estiliza el tema; aquí solo el estado deshabilitado. */
.hdp-buy[disabled] { opacity: .45; cursor: not-allowed; }
