/* Audioguida: mismos tokens que la web (marfil, café, oro champán, rojo de marca; Cinzel, Cormorant, Nunito Sans). */
.bocca-ag {
	--ag-paper: #FFFDF8;
	--ag-rule: #E2D4BD;
	--ag-cream-deep: #E9DCC5;
	--ag-espresso: #2A1C15;
	--ag-coffee: #4A3428;
	--ag-muted: #6D5B4E;
	--ag-gold: #A88A52;
	--ag-gold-soft: #D8C49B;
	--ag-brand: #8A1819;
	--ag-brand-deep: #6A1112;
	--ag-ease-out: cubic-bezier(0.23, 1, 0.32, 1);
	position: fixed;
	right: 24px;
	bottom: 24px;
	z-index: 90; /* por debajo del menú móvil de la cabecera y de su velo oscuro (Xpro: 999 y 99) */
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 10px;
	font-family: "Nunito Sans", sans-serif;
	color: var(--ag-espresso);
	pointer-events: none;
}
.bocca-ag > * { pointer-events: auto; }
.bocca-ag, .bocca-ag *, .bocca-ag *::before, .bocca-ag *::after { box-sizing: border-box; }
.bocca-ag button { font: inherit; margin: 0; min-height: 0; text-transform: none; letter-spacing: normal; box-shadow: none; cursor: pointer; }
.bocca-ag button:focus-visible, .bocca-ag input:focus-visible { outline: 2px solid var(--ag-brand); outline-offset: 2px; }
.bocca-ag__icon { display: block; flex: none; }

/* Acceso: cápsula como los botones de la web */
.bocca-ag .bocca-ag__toggle {
	display: inline-flex;
	align-items: center;
	gap: 9px;
	height: 44px;
	padding: 0 18px 0 15px;
	border: 1px solid var(--ag-gold-soft);
	border-radius: 999px;
	background: var(--ag-paper);
	color: var(--ag-espresso);
	font-size: 12px;
	font-weight: 700;
	line-height: 1;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	box-shadow: 0 6px 20px rgba(42, 28, 21, 0.12);
	transition: border-color 0.2s ease, background-color 0.2s ease, opacity 0.2s var(--ag-ease-out), transform 0.2s var(--ag-ease-out);
}
.bocca-ag .bocca-ag__toggle .bocca-ag__icon { color: var(--ag-gold); }
.bocca-ag .bocca-ag__toggle:hover, .bocca-ag .bocca-ag__toggle:focus { background: var(--ag-paper); color: var(--ag-espresso); }
@media (hover: hover) and (pointer: fine) {
	.bocca-ag .bocca-ag__toggle:hover { border-color: var(--ag-gold); }
}
.bocca-ag .bocca-ag__toggle[aria-expanded="true"] { border-color: var(--ag-gold); }

/* Indicador «sonando» */
.bocca-ag__eq { display: none; align-items: flex-end; gap: 2px; height: 12px; }
.bocca-ag__eq i { width: 2px; height: 12px; background: var(--ag-brand); border-radius: 1px; transform-origin: bottom; animation: bocca-ag-eq 0.9s ease-in-out infinite alternate; }
.bocca-ag__eq i:nth-child(2) { animation-delay: -0.3s; }
.bocca-ag__eq i:nth-child(3) { animation-delay: -0.6s; }
@keyframes bocca-ag-eq { from { transform: scaleY(0.3); } to { transform: scaleY(1); } }
.bocca-ag.is-playing .bocca-ag__eq { display: inline-flex; }

/* Fuera de vista mientras se escribe en un formulario o sobre el pie (si no está sonando) */
.bocca-ag.is-tucked:not(.is-open):not(.is-playing) .bocca-ag__toggle { opacity: 0; transform: translateY(8px); pointer-events: none; }

/* Panel */
.bocca-ag__panel {
	width: 300px;
	max-width: calc(100vw - 32px);
	padding: 18px 18px 16px;
	border: 1px solid var(--ag-rule);
	border-radius: 4px;
	background: var(--ag-paper);
	box-shadow: 0 14px 40px rgba(42, 28, 21, 0.16);
	transform-origin: bottom right;
	opacity: 0;
	transform: translateY(8px) scale(0.97);
	visibility: hidden;
	transition: opacity 0.2s var(--ag-ease-out), transform 0.2s var(--ag-ease-out), visibility 0s linear 0.2s;
}
.bocca-ag.is-open .bocca-ag__panel { opacity: 1; transform: none; visibility: visible; transition-delay: 0s; }

.bocca-ag__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.bocca-ag__head p { margin: 0; }
.bocca-ag__title { font-family: "Cinzel", serif; font-size: 14px; font-weight: 500; line-height: 1.3; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ag-espresso); }
.bocca-ag__guide { font-family: "Cormorant Garamond", serif; font-size: 19px; font-style: italic; line-height: 1.25; color: var(--ag-coffee); }
.bocca-ag .bocca-ag__close { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; margin: -6px -6px 0 0; border: 0; border-radius: 999px; background: transparent; color: var(--ag-muted); transition: color 0.2s ease, background-color 0.2s ease; }
.bocca-ag .bocca-ag__close:hover, .bocca-ag .bocca-ag__close:focus { background: transparent; color: var(--ag-espresso); }

/* Idiomas: mismas fichas que los formatos de producto */
.bocca-ag__langs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.bocca-ag .bocca-ag__lang { min-width: 44px; padding: 8px 10px; border: 1px solid var(--ag-cream-deep); border-radius: 4px; background: var(--ag-paper); color: var(--ag-espresso); font-size: 12.5px; font-weight: 700; line-height: 1.2; letter-spacing: 0.12em; transition: border-color 0.2s ease, box-shadow 0.2s ease; }
.bocca-ag .bocca-ag__lang:hover, .bocca-ag .bocca-ag__lang:focus { background: var(--ag-paper); color: var(--ag-espresso); }
@media (hover: hover) and (pointer: fine) {
	.bocca-ag .bocca-ag__lang:hover { border-color: var(--ag-gold-soft); }
}
.bocca-ag .bocca-ag__lang[aria-pressed="true"] { border-color: var(--ag-gold); box-shadow: inset 0 0 0 1px var(--ag-gold); }

/* Reproductor */
.bocca-ag__player { display: flex; align-items: center; gap: 12px; }
.bocca-ag .bocca-ag__play { display: grid; place-items: center; flex: none; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 999px; background: var(--ag-brand); color: #fff; transition: background-color 0.2s ease, transform 0.12s var(--ag-ease-out); }
.bocca-ag .bocca-ag__play:hover, .bocca-ag .bocca-ag__play:focus { background: var(--ag-brand); color: #fff; }
@media (hover: hover) and (pointer: fine) {
	.bocca-ag .bocca-ag__play:hover { background: var(--ag-brand-deep); }
}
.bocca-ag .bocca-ag__play:active { transform: scale(0.96); }
.bocca-ag__play .bocca-ag__icon--pause, .bocca-ag.is-playing .bocca-ag__play .bocca-ag__icon--play { display: none; }
.bocca-ag.is-playing .bocca-ag__play .bocca-ag__icon--pause { display: block; }
.bocca-ag.is-loading .bocca-ag__play { opacity: 0.75; }
.bocca-ag__track { flex: 1; min-width: 0; }
.bocca-ag__time { display: block; margin-top: 2px; font-size: 12px; line-height: 1.3; color: var(--ag-muted); font-variant-numeric: tabular-nums; }

.bocca-ag__vol { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--ag-rule); }
.bocca-ag .bocca-ag__mute { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 999px; background: transparent; color: var(--ag-coffee); }
.bocca-ag .bocca-ag__mute:hover, .bocca-ag .bocca-ag__mute:focus { background: transparent; color: var(--ag-espresso); }
.bocca-ag__mute .bocca-ag__icon--muted, .bocca-ag.is-muted .bocca-ag__mute .bocca-ag__icon--volume { display: none; }
.bocca-ag.is-muted .bocca-ag__mute .bocca-ag__icon--muted { display: block; }

/* Barras de posición y volumen */
.bocca-ag input[type="range"] { -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 20px; margin: 0; padding: 0; border: 0; background: transparent; cursor: pointer; }
.bocca-ag input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 3px; background: linear-gradient(var(--ag-brand), var(--ag-brand)) 0 / var(--ag-fill, 0%) 100% no-repeat, var(--ag-cream-deep); }
.bocca-ag input[type="range"]::-moz-range-track { height: 3px; border-radius: 3px; background: var(--ag-cream-deep); }
.bocca-ag input[type="range"]::-moz-range-progress { height: 3px; border-radius: 3px; background: var(--ag-brand); }
.bocca-ag input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; margin-top: -4.5px; border: 0; border-radius: 50%; background: var(--ag-brand); }
.bocca-ag input[type="range"]::-moz-range-thumb { width: 12px; height: 12px; border: 0; border-radius: 50%; background: var(--ag-brand); }

/* Móvil: solo el icono en el acceso, el panel a lo ancho */
@media (max-width: 767px) {
	.bocca-ag { right: 16px; bottom: 16px; }
	.bocca-ag .bocca-ag__toggle { width: 44px; padding: 0; justify-content: center; gap: 0; }
	.bocca-ag__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
	.bocca-ag.is-playing .bocca-ag__toggle .bocca-ag__icon { display: none; }
	.bocca-ag__panel { width: calc(100vw - 32px); }
}

@media (prefers-reduced-motion: reduce) {
	.bocca-ag__panel, .bocca-ag.is-open .bocca-ag__panel { transform: none; }
	.bocca-ag.is-tucked:not(.is-open):not(.is-playing) .bocca-ag__toggle { transform: none; }
	.bocca-ag__eq i { animation: none; transform: scaleY(0.7); }
}
@media print { .bocca-ag { display: none; } }
