.phk-event-gallery {
	margin-top: 24px;
}
.phk-gallery-count {
	font-weight: 600;
	margin-bottom: 12px;
}
.phk-gallery-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
	gap: 16px;
}
.phk-gallery-item {
	text-align: center;
}
.phk-gallery-item img {
	width: 100%;
	height: auto;
	border-radius: 6px;
	display: block;
	margin-bottom: 8px;
}
.phk-btn,
.phk-buy-btn {
	display: inline-block;
	padding: 8px 16px;
	background: #2271b1;
	color: #fff;
	text-decoration: none;
	border-radius: 4px;
	border: none;
	cursor: pointer;
	font-size: 14px;
}
.phk-btn:hover,
.phk-buy-btn:hover {
	background: #135e96;
	color: #fff;
}
.phk-password-gate {
	max-width: 360px;
	margin: 40px auto;
	text-align: center;
}
.phk-password-gate input[type="password"] {
	display: block;
	width: 100%;
	margin-bottom: 12px;
	padding: 8px;
}
.phk-events-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 24px;
}
.phk-events-empty {
	grid-column: 1 / -1;
	opacity: 0.7;
}
.phk-event-card {
	display: block;
	text-decoration: none;
	color: inherit;
}
.phk-event-card-image {
	aspect-ratio: 4 / 5;
	overflow: hidden;
	border-radius: 4px;
	background: #1a1a1a;
}
.phk-event-card-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.35s ease;
}
.phk-event-card:hover .phk-event-card-image img {
	transform: scale(1.04);
}
.phk-event-card-placeholder {
	width: 100%;
	height: 100%;
}
.phk-event-card-body {
	padding-top: 12px;
}
.phk-event-card-title {
	margin: 0 0 4px;
	font-size: 1.05em;
}
.phk-event-card-meta {
	margin: 0;
	font-size: 0.85em;
	opacity: 0.7;
}
.phk-newsletter-optin {
	margin: 18px 0 8px;
}
.phk-newsletter-optin label {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	font-size: 0.92em;
	line-height: 1.45;
	cursor: pointer;
}
.phk-newsletter-optin input[type="checkbox"] {
	margin: 3px 0 0;
	flex: 0 0 auto;
}

/* ── Galería: miniaturas clicables ─────────────────────────────── */
.phk-gallery-hint {
	display: block;
	font-weight: 400;
	font-size: 0.85em;
	opacity: 0.65;
	margin-top: 4px;
}
.phk-gallery-open {
	display: block;
	width: 100%;
	padding: 0;
	border: 0;
	background: none;
	cursor: zoom-in;
	line-height: 0;
	border-radius: 8px;
	overflow: hidden;
}
.phk-gallery-open img {
	transition: transform 0.35s ease, opacity 0.2s ease;
}
.phk-gallery-open:hover img {
	transform: scale(1.03);
	opacity: 0.92;
}
.phk-gallery-open:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 3px;
}

/* ── Visor ampliado ────────────────────────────────────────────── */
body.phk-lb-locked {
	overflow: hidden;
}
.phk-lightbox {
	position: fixed;
	inset: 0;
	/* Por encima de la barra de administración de WordPress (99999), que si
	   no le recorta el borde superior a la foto cuando mirás logueado. */
	z-index: 2147483000;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 24px;
	background: rgba(10, 10, 10, 0.94);
	backdrop-filter: blur(4px);
}
.phk-lightbox.is-open {
	display: flex;
}
.phk-lb-figure {
	margin: 0;
	max-width: 100%;
	max-height: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 16px;
}
.phk-lb-image {
	max-width: 100%;
	max-height: calc(100vh - 150px);
	width: auto;
	height: auto;
	object-fit: contain;
	border-radius: 6px;
	display: block;
	/* Disuade el arrastrar-y-soltar; la marca de agua es la defensa real. */
	-webkit-user-drag: none;
	user-select: none;
	pointer-events: none;
}
.phk-lb-bar {
	display: flex;
	align-items: center;
	gap: 20px;
	flex-wrap: wrap;
	justify-content: center;
}
.phk-lb-counter {
	font-size: 0.85em;
	letter-spacing: 0.08em;
	opacity: 0.7;
	color: #f5f3ee;
}
.phk-lightbox button {
	background: rgba(255, 255, 255, 0.08);
	border: 1px solid rgba(255, 255, 255, 0.18);
	color: #f5f3ee;
	cursor: pointer;
	border-radius: 999px;
	transition: background 0.2s ease;
}
.phk-lightbox button:hover {
	background: rgba(255, 255, 255, 0.16);
}
.phk-lb-close {
	position: absolute;
	top: 18px;
	right: 18px;
	width: 44px;
	height: 44px;
	font-size: 26px;
	line-height: 1;
}
.phk-lb-prev,
.phk-lb-next {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 48px;
	height: 48px;
	font-size: 30px;
	line-height: 1;
}
.phk-lb-prev { left: 18px; }
.phk-lb-next { right: 18px; }
.phk-lb-buy { pointer-events: auto; }

@media (max-width: 640px) {
	.phk-lightbox { padding: 12px; }
	.phk-lb-image { max-height: calc(100vh - 190px); }
	.phk-lb-prev, .phk-lb-next { width: 40px; height: 40px; font-size: 24px; }
	.phk-lb-prev { left: 8px; }
	.phk-lb-next { right: 8px; }
}

/* ------------------------------------------------------------------
 * Añadir varias fotos sin salir de la galería.
 * ------------------------------------------------------------------ */

/* WooCommerce agrega su propio enlace "Ver carrito" después del botón.
   La barra inferior ya cumple esa función, y dos llamadas a la acción
   pegadas compiten entre sí. */
.phk-gallery-item a.added_to_cart {
	display: none !important;
}

/* Estado "agregando" que pinta WooCommerce mientras viaja el AJAX. */
.phk-buy-btn.loading {
	opacity: 0.6;
	pointer-events: none;
}

.phk-buy-btn.phk-added {
	background: transparent;
	border: 1px solid currentColor;
}

.phk-gallery-item.is-in-cart .phk-gallery-open img {
	outline: 2px solid #c8a96a;
	outline-offset: -2px;
}

.phk-cart-bar {
	position: sticky;
	bottom: 16px;
	z-index: 20;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	flex-wrap: wrap;
	margin: 28px auto 0;
	max-width: 520px;
	padding: 12px 16px;
	border-radius: 999px;
	background: rgba(18, 18, 18, 0.94);
	border: 1px solid rgba(200, 169, 106, 0.45);
	box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
	color: #f5f3ee;
	backdrop-filter: blur(6px);
}
.phk-cart-bar[hidden] {
	display: none;
}
.phk-cart-bar-text {
	font-size: 0.95em;
	letter-spacing: 0.02em;
	padding-left: 8px;
}

/* El botón del lightbox es un <button>, así que hereda los estilos
   neutros de .phk-lightbox button; le devolvemos el aspecto de compra. */
.phk-lightbox button.phk-lb-buy {
	background: #c8a96a;
	border: 1px solid #c8a96a;
	color: #111;
	font-weight: 600;
	padding: 10px 22px;
}
.phk-lightbox button.phk-lb-buy:hover {
	background: #d8bc82;
	border-color: #d8bc82;
}
.phk-lightbox button.phk-lb-buy.phk-added {
	background: transparent;
	color: #f5f3ee;
	border-color: rgba(245, 243, 238, 0.5);
}

/* ------------------------------------------------------------------
 * Selección múltiple.
 * ------------------------------------------------------------------ */

.phk-gallery-item {
	position: relative;
}

.phk-select {
	position: absolute;
	top: 8px;
	right: 8px;
	z-index: 3;
	display: block;
	width: 34px;
	height: 34px;
	cursor: pointer;
	margin: 0;
}
.phk-select input {
	position: absolute;
	opacity: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	cursor: pointer;
}
.phk-select-mark {
	display: block;
	width: 100%;
	height: 100%;
	border-radius: 50%;
	background: rgba(10, 10, 10, 0.45);
	border: 2px solid rgba(255, 255, 255, 0.85);
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
	transition: background 0.15s ease, border-color 0.15s ease;
}
.phk-select-mark::after {
	content: "";
	position: absolute;
	top: 9px;
	left: 11px;
	width: 8px;
	height: 14px;
	border: solid #111;
	border-width: 0 3px 3px 0;
	transform: rotate(45deg);
	opacity: 0;
	transition: opacity 0.15s ease;
}
.phk-select input:checked + .phk-select-mark {
	background: #c8a96a;
	border-color: #c8a96a;
}
.phk-select input:checked + .phk-select-mark::after {
	opacity: 1;
}
.phk-select input:focus-visible + .phk-select-mark {
	outline: 2px solid #fff;
	outline-offset: 2px;
}
.phk-select input:disabled + .phk-select-mark {
	background: #c8a96a;
	border-color: #c8a96a;
	opacity: 0.55;
	cursor: default;
}
.phk-select input:disabled + .phk-select-mark::after {
	opacity: 1;
}

.phk-gallery-item.is-selected .phk-gallery-open img {
	outline: 3px solid #c8a96a;
	outline-offset: -3px;
}

.phk-select-all {
	background: none;
	border: 1px solid currentColor;
	border-radius: 999px;
	padding: 4px 14px;
	margin-left: 12px;
	font-size: 0.85em;
	cursor: pointer;
	color: inherit;
	opacity: 0.85;
}
.phk-select-all:hover {
	opacity: 1;
}

.phk-cart-bar-actions {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
}
.phk-cart-bar-actions [hidden] {
	display: none;
}
.phk-add-selected {
	background: #c8a96a;
	color: #111;
	border: 1px solid #c8a96a;
	font-weight: 600;
	border-radius: 999px;
	padding: 9px 18px;
	cursor: pointer;
}
.phk-add-selected:hover {
	background: #d8bc82;
}
.phk-add-selected:disabled {
	opacity: 0.6;
	cursor: default;
}
.phk-cart-bar-link {
	border-radius: 999px;
	padding: 9px 18px;
	background: transparent;
	border: 1px solid rgba(245, 243, 238, 0.5);
	color: #f5f3ee;
	text-decoration: none;
}

.phk-lightbox button.phk-lb-select {
	padding: 9px 18px;
}
.phk-lightbox button.phk-lb-select.is-on {
	background: #c8a96a;
	border-color: #c8a96a;
	color: #111;
	font-weight: 600;
}

@media (max-width: 640px) {
	.phk-cart-bar {
		flex-direction: column;
		gap: 10px;
		border-radius: 18px;
		max-width: none;
	}
	.phk-cart-bar-actions {
		width: 100%;
		justify-content: center;
	}
}
