/* Copistería - Impresión de PDF
   Estilo alineado con "Favoritos Carousel": blanco/negro/gris, esquinas suaves,
   títulos en negrita. Interfaz compacta, sin espacios vacíos. */

.copist {
	--copist-fg: #111111;          /* texto principal */
	--copist-btn-bg: #000000;      /* botón negro */
	--copist-btn-bg-hover: #2a2a2a;
	--copist-btn-fg: #ffffff;
	--copist-bg: #ffffff;
	--copist-surface: #f2f2f2;      /* gris tarjeta */
	--copist-tint: #e6e6e6;         /* gris estado activo */
	--copist-border: #d8d8d8;
	--copist-muted: #6b6b6b;
	--copist-danger: #c0392b;
	--copist-radius: 4px;

	max-width: 520px;
	margin: 0 auto;
	/* Separación de los bordes de la pantalla (sobre todo en móvil) */
	padding: 0 12px;
	color: var(--copist-fg);
	font-family: inherit;
	line-height: 1.2;
	box-sizing: border-box;
}

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

/* Reset defensivo: muchos temas añaden márgenes grandes a label/p/span/headings
   dentro de formularios, lo que provoca huecos vacíos. Los neutralizamos. */
.copist label,
.copist span,
.copist p,
.copist h2,
.copist h3,
.copist ul,
.copist li,
.copist input {
	margin: 0 !important;
	float: none !important;
}

.copist .copist__field,
.copist .copist__seg,
.copist .copist__label,
.copist .copist__segments {
	margin: 0 !important;
	min-height: 0 !important;
	line-height: 1.2 !important;
}

/* Botón desplegable */
.copist__toggle {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	padding: 10px 14px;
	border: 1px solid var(--copist-border);
	border-radius: var(--copist-radius);
	background: var(--copist-surface);
	color: var(--copist-fg);
	font-family: inherit;
	font-size: 0.95rem;
	font-weight: 800;
	letter-spacing: -0.01em;
	cursor: pointer;
	transition: border-color .2s, background .2s;
}

.copist__toggle:hover {
	border-color: var(--copist-fg);
	background: var(--copist-tint);
}

.copist__toggle-icon {
	display: inline-flex;
	color: var(--copist-fg);
	line-height: 0;
	flex-shrink: 0;
}

.copist__toggle-text {
	flex: 1 1 auto;
	text-align: left;
}

.copist__toggle-chevron {
	display: inline-flex;
	color: var(--copist-muted);
	line-height: 0;
	flex-shrink: 0;
	transition: transform .25s ease;
}

.copist.is-open .copist__toggle-chevron {
	transform: rotate(180deg);
}

/* Cuerpo desplegable con animación */
.copist__body {
	margin-top: 6px;
	animation: copist-slide .25s ease;
}

.copist__body[hidden] {
	display: none;
}

@keyframes copist-slide {
	from { opacity: 0; transform: translateY(-6px); }
	to { opacity: 1; transform: translateY(0); }
}

/* Una sola columna compacta: sin huecos vacíos */
.copist__grid {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.copist__panel {
	background: var(--copist-bg);
	border: 1px solid var(--copist-border);
	border-radius: var(--copist-radius);
	padding: 10px;
}

.copist__title {
	margin: 0 0 1px;
	font-size: 1rem;
	font-weight: 800;
	letter-spacing: -0.01em;
}

.copist__subtitle {
	margin: 0 0 8px;
	color: var(--copist-muted);
	font-size: 0.76rem;
}

/* Zona de subida (compacta y horizontal) */
.copist__drop {
	display: flex;
	flex-direction: row;
	align-items: center;
	gap: 8px;
	text-align: left;
	padding: 8px 10px;
	border: 1.5px dashed var(--copist-border);
	border-radius: var(--copist-radius);
	background: var(--copist-surface);
	cursor: pointer;
	transition: border-color .2s, background .2s;
}

.copist__drop:hover,
.copist__drop.is-drag {
	border-color: var(--copist-fg);
	background: var(--copist-tint);
}

.copist__drop.is-hidden {
	display: none;
}

.copist__input {
	display: none;
}

.copist__drop-icon {
	color: var(--copist-fg);
	line-height: 0;
	flex-shrink: 0;
}

.copist__drop-icon svg {
	width: 22px;
	height: 22px;
}

.copist__drop-text {
	font-size: 0.82rem;
	color: var(--copist-fg);
	line-height: 1.2;
}

.copist__drop-hint {
	display: block;
	font-size: 0.7rem;
	color: var(--copist-muted);
}

/* Archivo seleccionado */
.copist__file {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 6px 8px;
	margin-top: 6px;
	border: 1px solid var(--copist-border);
	border-radius: var(--copist-radius);
	background: var(--copist-surface);
}

.copist__file-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	border-radius: var(--copist-radius);
	background: var(--copist-btn-bg);
	color: var(--copist-btn-fg);
	font-size: 0.58rem;
	font-weight: 700;
	letter-spacing: .5px;
	flex-shrink: 0;
}

.copist__file-meta {
	display: flex;
	flex-direction: column;
	min-width: 0;
	flex: 1;
}

.copist__file-name {
	font-weight: 600;
	font-size: 0.85rem;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.copist__file-pages {
	font-size: 0.75rem;
	color: var(--copist-muted);
}

.copist__file-remove {
	border: none;
	background: transparent;
	color: var(--copist-muted);
	font-size: 1.25rem;
	line-height: 1;
	cursor: pointer;
	padding: 0 4px;
	border-radius: var(--copist-radius);
}

.copist__file-remove:hover {
	background: #f3e0dd;
	color: var(--copist-danger);
}

/* Error */
.copist__error {
	margin-top: 6px;
	padding: 6px 8px;
	border-radius: var(--copist-radius);
	background: #f7e4e1;
	color: var(--copist-danger);
	font-size: 0.8rem;
}

/* Opciones */
.copist__options {
	margin-top: 8px;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.copist__field {
	display: flex;
	flex-direction: column;
	gap: 3px;
}

.copist__label {
	font-size: 0.66rem;
	font-weight: 700;
	color: var(--copist-muted);
	text-transform: uppercase;
	letter-spacing: .5px;
}

.copist__segments {
	display: flex;
	gap: 5px;
	flex-wrap: wrap;
}

.copist__seg {
	position: relative;
	flex: 1 1 auto;
	min-width: 80px;
}

.copist__seg input {
	position: absolute;
	opacity: 0;
	inset: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	cursor: pointer;
}

.copist__seg span {
	display: block;
	text-align: center;
	padding: 6px 8px;
	border: 1px solid var(--copist-border);
	border-radius: var(--copist-radius);
	background: var(--copist-bg);
	font-size: 0.8rem;
	font-weight: 500;
	transition: all .15s;
}

/* Estado activo: negro sobre gris, como los favoritos */
.copist__seg input:checked + span,
.copist__seg.is-selected span {
	border-color: var(--copist-fg);
	background: var(--copist-tint);
	color: var(--copist-fg);
	font-weight: 700;
	box-shadow: inset 0 0 0 1px var(--copist-fg);
}

.copist__seg input:focus-visible + span {
	outline: 2px solid #0071e3;
	outline-offset: 2px;
}

/* Stepper */
.copist__stepper {
	display: inline-flex;
	align-items: center;
	border: 1px solid var(--copist-border);
	border-radius: var(--copist-radius);
	overflow: hidden;
	width: fit-content;
}

.copist__step {
	width: 30px;
	height: 30px;
	border: none;
	background: var(--copist-surface);
	font-size: 1.05rem;
	cursor: pointer;
	color: var(--copist-fg);
}

.copist__step:hover {
	background: var(--copist-tint);
}

.copist__copias {
	width: 44px;
	height: 30px;
	text-align: center;
	border: none;
	border-left: 1px solid var(--copist-border);
	border-right: 1px solid var(--copist-border);
	font-size: 0.9rem;
	font-weight: 600;
	-moz-appearance: textfield;
}

.copist__copias::-webkit-outer-spin-button,
.copist__copias::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

/* Resumen (compacto, misma columna) */
.copist__summary {
	background: var(--copist-surface);
	border: 1px solid var(--copist-border);
	border-radius: var(--copist-radius);
	padding: 10px;
	display: flex;
	flex-direction: column;
}

.copist__summary-title {
	margin: 0 0 6px;
	font-size: 0.95rem;
	font-weight: 800;
	letter-spacing: -0.01em;
}

.copist__summary-list {
	list-style: none;
	margin: 0 0 6px;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 3px;
}

.copist__summary-list li {
	display: flex;
	justify-content: space-between;
	gap: 10px;
	font-size: 0.78rem;
	color: var(--copist-muted);
}

.copist__summary-list li span:last-child {
	color: var(--copist-fg);
	font-weight: 600;
	text-align: right;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.copist__total {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding-top: 6px;
	border-top: 1px solid var(--copist-border);
	font-size: 1rem;
	font-weight: 800;
}

.copist__add {
	width: 100%;
	margin-top: 8px;
	padding: 12px;
	border: none;
	border-radius: var(--copist-radius);
	background: var(--copist-btn-bg);
	color: var(--copist-btn-fg);
	font-size: 0.95rem;
	font-weight: 700;
	cursor: pointer;
	transition: background .15s;
}

.copist__add:hover:not(:disabled) {
	background: var(--copist-btn-bg-hover);
}

.copist__add:disabled {
	opacity: .5;
	cursor: not-allowed;
}

.copist__note {
	margin: 6px 0 0;
	font-size: 0.66rem;
	color: var(--copist-muted);
	text-align: center;
	line-height: 1.25;
}

/* Miniatura en el carrito */
.copist-thumb {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	border-radius: var(--copist-radius);
	background: #000000;
	color: #fff;
	font-size: 0.6rem;
	font-weight: 700;
}

/* ==========================================================================
   Barra flotante persistente (visible en toda la web con artículos)
   ========================================================================== */
.copist-bar {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 99999;
	font-family: inherit;
	transform: translateY(110%);
	transition: transform .35s cubic-bezier(.2, .8, .25, 1);
	pointer-events: none;
}

.copist-bar.is-visible {
	transform: translateY(0);
	pointer-events: auto;
}

.copist-bar__inner {
	max-width: 720px;
	margin: 0 auto 10px;
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 10px;
	background: #ffffff;
	border: 1px solid #d8d8d8;
	border-radius: 8px;
	box-shadow: 0 6px 24px rgba(17, 17, 17, .18);
}

.copist-bar__left {
	display: flex;
	align-items: center;
	gap: 8px;
	flex: 1 1 auto;
	min-width: 0;
}

.copist-bar__check {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	background: #000000;
	color: #fff;
	flex-shrink: 0;
	transition: background .25s ease;
}

/* Estado "añadido": el icono y el mensaje se vuelven verdes */
.copist-bar.is-added .copist-bar__check {
	background: #1a7f37;
}

.copist-bar.is-added .copist-bar__msg {
	color: #1a7f37;
}

.copist-bar__check svg {
	width: 16px;
	height: 16px;
	stroke-dasharray: 24;
	stroke-dashoffset: 0;
}

.copist-bar.is-pop .copist-bar__check {
	animation: copist-pop .4s ease;
}

.copist-bar.is-pop .copist-bar__check svg {
	animation: copist-draw .45s .1s ease forwards;
}

.copist-bar__msg {
	font-size: 0.85rem;
	font-weight: 600;
	color: #111111;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.copist-bar__center {
	display: flex;
	flex-direction: column;
	align-items: center;
	line-height: 1.1;
	flex-shrink: 0;
	padding: 0 4px;
}

.copist-bar__total-label {
	font-size: 0.62rem;
	text-transform: uppercase;
	letter-spacing: .5px;
	color: #6b6b6b;
}

.copist-bar__total {
	font-size: 1rem;
	font-weight: 800;
	color: #111111;
}

.copist-bar__total .woocommerce-Price-amount {
	color: inherit;
}

.copist-bar__btn {
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 9px 16px;
	border-radius: 4px;
	background: #000000;
	color: #fff !important;
	font-size: 0.85rem;
	font-weight: 700;
	text-decoration: none;
	transition: background .15s;
	white-space: nowrap;
}

.copist-bar__btn:hover {
	background: #2a2a2a;
	color: #fff !important;
}

@keyframes copist-pop {
	0% { transform: scale(0); }
	60% { transform: scale(1.2); }
	100% { transform: scale(1); }
}

@keyframes copist-draw {
	from { stroke-dashoffset: 24; }
	to { stroke-dashoffset: 0; }
}

@media (max-width: 520px) {
	.copist-bar__inner {
		gap: 8px;
		padding: 7px 8px;
		/* Separa la ventana emergente de los bordes del móvil */
		margin: 0 12px 12px;
	}
	.copist-bar__msg {
		font-size: 0.75rem;
	}
	.copist-bar__btn {
		padding: 8px 12px;
		font-size: 0.78rem;
	}
}
