/* ==========================================================================
   Malcop Importer — Estilos frontend (FASE 6)
   ========================================================================== */

/* --------------------------------------------------------------------------
   Productos relacionados propios (columna V)
   -------------------------------------------------------------------------- */

.malcop-relacionados {
	margin: 2em 0;
}

.malcop-relacionados-titulo {
	font-size: 1.2rem;
	font-weight: 600;
	margin-bottom: 1em;
	color: #333;
}

/* El grid de la tarjetas lo gestiona WooCommerce / Elementor.
   Solo añadimos el wrapper para permitir override. */
.malcop-relacionados-loop ul.products {
	margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   Opciones obligatorias (columna W)
   -------------------------------------------------------------------------- */

.malcop-opciones-obligatorias {
	margin: 1.5em 0;
	padding: 1em 1.25em;
	border: 2px solid #e67e22;
	border-radius: 4px;
	background: #fff9f5;
}

.malcop-opciones-titulo {
	margin: 0 0 0.5em;
	font-size: 1rem;
	font-weight: 600;
	color: #333;
}

.malcop-requerido {
	color: #e74c3c;
	font-weight: bold;
	margin-left: 2px;
}

.malcop-opciones-desc {
	margin: 0 0 0.75em;
	font-size: 0.9rem;
	color: #666;
}

/* Lista de tarjetas de opción */
.malcop-opciones-lista {
	list-style: none;
	margin: 0;
	padding: 0;
}

.malcop-opcion-item {
	display: flex;
	align-items: center;
	gap: 0.75em;
	padding: 0.5em 0;
	border-bottom: 1px solid #eee;
}

.malcop-opcion-item:last-child {
	border-bottom: none;
}

.malcop-opcion-img-wrap {
	flex-shrink: 0;
}

.malcop-opcion-img-wrap img,
.malcop-opcion-img {
	width: 48px;
	height: 48px;
	object-fit: cover;
	border-radius: 3px;
	display: block;
}

.malcop-opcion-info {
	display: flex;
	flex-direction: column;
	gap: 0.15em;
	flex: 1;
	min-width: 0;
}

.malcop-opcion-nombre {
	font-size: 0.9rem;
	color: #333;
	text-decoration: none;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.malcop-opcion-nombre:hover {
	text-decoration: underline;
}

.malcop-opcion-precio {
	color: #777;
	font-size: 0.82rem;
	white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Stepper de cantidad (compartido por opciones y obligatorios)
   -------------------------------------------------------------------------- */

.malcop-qty-stepper {
	display: flex;
	align-items: center;
	gap: 4px;
	flex-shrink: 0;
}

.malcop-qty-minus,
.malcop-qty-plus {
	width: 28px;
	height: 28px;
	border: 1px solid #ccc;
	background: #f5f5f5;
	cursor: pointer;
	border-radius: 3px;
	font-size: 1rem;
	line-height: 1;
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.15s, border-color 0.15s;
}

.malcop-qty-minus:hover,
.malcop-qty-plus:hover {
	background: #e67e22;
	border-color: #e67e22;
	color: #fff;
}

.malcop-qty-input {
	width: 48px;
	text-align: center;
	border: 1px solid #ccc;
	border-radius: 3px;
	padding: 4px;
	font-size: 0.9rem;
	-moz-appearance: textfield;
}

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

.malcop-error-msg {
	color: #e74c3c;
	font-size: 0.875rem;
	margin-top: 0.5em;
}

/* --------------------------------------------------------------------------
   Productos obligatorios (columna X)
   -------------------------------------------------------------------------- */

.malcop-obligatorios {
	margin: 1.25em 0 0;
	padding: 0.875em 1.25em;
	border: 1px solid #ddd;
	border-radius: 4px;
	background: #f9f9f9;
}

.malcop-obligatorios-titulo {
	margin: 0 0 0.35em;
	font-size: 0.9rem;
	font-weight: 600;
	color: #555;
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

.malcop-obligatorios-msg {
	margin: 0 0 0.75em;
	font-size: 0.875rem;
	color: #666;
	line-height: 1.5;
}

.malcop-obligatorios-lista {
	list-style: none;
	margin: 0;
	padding: 0;
}

/* Eliminado: `.malcop-obligatorios-lista li {}` — ahora lo gestiona .malcop-obligatorio-item */


/* Icono bloqueado en el carrito para ítems hijos obligatorios */
.malcop-no-remove {
	color: #bbb;
	cursor: not-allowed;
	font-size: 1rem;
}

/* Cantidad no editable para ítems hijos obligatorios en el carrito */
.malcop-qty-locked {
	display: inline-block;
	min-width: 2em;
	padding: 0.25em 0.5em;
	text-align: center;
	font-weight: 600;
	color: #555;
	background: #f5f5f5;
	border: 1px solid #ddd;
	border-radius: 3px;
	cursor: not-allowed;
	user-select: none;
}

/* --------------------------------------------------------------------------
   Cart Block (WooCommerce Blocks): protección de ítems hijos obligatorios.
   La clase .malcop-child-row la añade malcop-cart.js vía MutationObserver.
   -------------------------------------------------------------------------- */

/* Ocultar el botón de eliminar en filas hijas (Cart Block) */
.malcop-child-row .wc-block-cart-item__remove-link {
	display: none !important;
}

/* Bloquear el selector de cantidad en filas hijas (Cart Block) */
.malcop-child-row .wc-block-components-quantity-selector {
	pointer-events: none !important;
	opacity: 0.55 !important;
	cursor: not-allowed;
}

.malcop-child-row .wc-block-components-quantity-selector__button,
.malcop-child-row .wc-block-components-quantity-selector__input {
	cursor: not-allowed !important;
}

/* --------------------------------------------------------------------------
   Productos obligatorios — con imagen (FASE 7)
   -------------------------------------------------------------------------- */

.malcop-obligatorio-item {
	display: flex !important;
	align-items: center;
	gap: 0.75em;
	padding: 0.5em 0 !important;
	border-bottom: 1px solid #eee;
}

.malcop-obligatorio-item:last-child {
	border-bottom: none;
}

.malcop-obligatorio-img-wrap {
	flex-shrink: 0;
}

.malcop-obligatorio-img-wrap img,
.malcop-obligatorio-img {
	width: 48px;
	height: 48px;
	object-fit: cover;
	border-radius: 3px;
	display: block;
}

.malcop-obligatorio-info {
	display: flex;
	flex-direction: column;
	gap: 0.15em;
	flex: 1;
	min-width: 0;
}

.malcop-obligatorio-nombre {
	font-size: 0.9rem;
	color: #333;
	text-decoration: none;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.malcop-obligatorio-nombre:hover {
	text-decoration: underline;
}

.malcop-obligatorio-precio {
	color: #777;
	font-size: 0.82rem;
	white-space: nowrap;
}

.malcop-precio-consumible {
	color: #c0392b;
	font-weight: 600;
}

.malcop-precio-incluido {
	color: #27ae60;
	font-style: italic;
}

/* --------------------------------------------------------------------------
   Tabla de tarifas de alquiler (FASE 7)
   -------------------------------------------------------------------------- */

.malcop-tarifas-wrap {
	margin: 0.5em 0 1em;
}

/* Aviso informativo */
.malcop-tarifas-aviso {
	display: flex;
	align-items: flex-start;
	gap: 0.5em;
	padding: 0.75em 1em;
	border-left: 4px solid #2196f3;
	background: #e8f4fd;
	border-radius: 0 4px 4px 0;
	font-size: 0.88rem;
	color: #1565c0;
	margin-bottom: 1.25em;
	line-height: 1.4;
}

.malcop-tarifas-aviso-ico {
	font-size: 1.1rem;
	line-height: 1;
	flex-shrink: 0;
	margin-top: 1px;
}

/* Scroll horizontal en móvil */
.malcop-tarifas-scroll {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

/* Tabla */
.malcop-tarifas-tabla {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.9rem;
}

.malcop-tarifas-tabla thead th {
	background: #f5f5f5;
	padding: 0.6em 1em;
	text-align: left;
	font-weight: 600;
	border-bottom: 2px solid #ddd;
	white-space: nowrap;
}

.malcop-tarifas-tabla tbody th,
.malcop-tarifas-tabla tbody td {
	padding: 0.55em 1em;
	border-bottom: 1px solid #eee;
	vertical-align: middle;
}

.malcop-tarifas-tabla tbody tr:last-child th,
.malcop-tarifas-tabla tbody tr:last-child td {
	border-bottom: none;
}

.malcop-tarifas-tabla tbody th {
	font-weight: normal;
	color: #444;
	text-align: left;
}

.malcop-tarifas-tabla tbody tr:hover {
	background: #fafafa;
}

/* Columnas numéricas */
.malcop-tarifas-tabla .malcop-col-num {
	text-align: right;
	white-space: nowrap;
}

/* Columna con IVA destacada */
.malcop-tarifas-tabla .malcop-col-con-iva {
	font-weight: 600;
	color: #333;
}

/* Filas del tfoot (fianza / valor reposición) */
.malcop-tarifas-tabla tfoot th,
.malcop-tarifas-tabla tfoot td {
	padding: 0.6em 1em;
	font-size: 0.85rem;
	color: #666;
	border-top: 2px solid #eee;
}

.malcop-fila-fianza th,
.malcop-fila-fianza td {
	color: #e67e22;
	font-weight: 600;
}

/* Fila destacada al seleccionar número de días (FASE 7 JS) */
.malcop-tarifas-tabla tbody tr.malcop-fila-activa {
	background: #fff3e0;
	font-weight: 600;
}
.malcop-tarifas-tabla tbody tr.malcop-fila-activa:hover {
	background: #ffe0b2;
}

/* Responsive: ocultar columna sin IVA en pantallas muy pequeñas */
@media ( max-width: 480px ) {
	.malcop-tarifas-tabla thead th:nth-child(2),
	.malcop-tarifas-tabla tbody td:nth-child(2),
	.malcop-tarifas-tabla tfoot td:first-of-type {
		display: none;
	}
}

/* --------------------------------------------------------------------------
   Panel de alquiler: selector de días + coste estimado (FASE 8)
   -------------------------------------------------------------------------- */

.malcop-alquiler-panel {
	margin: 0 0 1.5em;
	padding: 1em 1.25em;
	border: 1px solid #c8e0f4;
	border-radius: 6px;
	background: #f0f7ff;
}

.malcop-alquiler-panel-row {
	display: flex;
	align-items: center;
	gap: 0.75em;
	flex-wrap: wrap;
}

.malcop-alquiler-panel-row + .malcop-alquiler-panel-row {
	margin-top: 0.75em;
}

.malcop-alquiler-label {
	font-size: 0.875rem;
	font-weight: 600;
	color: #333;
	min-width: 10em;
	flex-shrink: 0;
}

.malcop-dias-hint {
	font-size: 0.8rem;
	color: #e67e22;
	font-style: italic;
}

.malcop-fianza-precio {
	font-size: 1rem;
	color: #1a6fa8;
}

/* Bloque coste estimado */
.malcop-coste-estimado {
	margin-top: 0.875em;
	padding: 0.875em 1em;
	background: #fff;
	border: 1px solid #c8e0f4;
	border-radius: 4px;
}

.malcop-coste-encabezado {
	display: flex;
	align-items: baseline;
	gap: 0.5em;
	flex-wrap: wrap;
	margin-bottom: 0.35em;
}

.malcop-coste-tarifa-desc {
	font-size: 0.82rem;
	color: #666;
}

.malcop-coste-tarifa-desc:not(:empty)::before { content: '('; }
.malcop-coste-tarifa-desc:not(:empty)::after  { content: ')'; }

.malcop-coste-total {
	display: block;
	font-size: 1.4rem;
	color: #1a6fa8;
	font-weight: 700;
	margin-bottom: 0.25em;
}

.malcop-coste-nota {
	font-size: 0.78rem;
	color: #999;
	margin: 0;
	font-style: italic;
}

/* --------------------------------------------------------------------------
   Resumen del pedido (FASE 8)
   -------------------------------------------------------------------------- */

.malcop-resumen-lote {
	margin: 0.875em 0;
	padding: 0.875em 1em;
	background: #fff;
	border: 1px solid #c8e0f4;
	border-radius: 4px;
}

.malcop-resumen-titulo {
	margin: 0 0 0.6em;
	font-size: 0.78rem;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: #888;
	font-weight: 600;
}

.malcop-resumen-row {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 0.5em;
	padding: 0.25em 0;
	font-size: 0.875rem;
}

.malcop-resumen-label {
	color: #555;
	flex: 1;
}

.malcop-resumen-sub {
	color: #27ae60;
	font-size: 0.78rem;
	margin-left: 0.25em;
}

.malcop-resumen-val {
	color: #333;
	white-space: nowrap;
}

.malcop-resumen-total-row {
	margin-top: 0.4em;
	padding-top: 0.5em;
	border-top: 1px solid #dde8f5;
}

.malcop-resumen-total-label {
	font-weight: 700;
	color: #333;
}

.malcop-resumen-total-val {
	font-size: 1.25rem;
	color: #1a6fa8;
	font-weight: 700;
}

@media ( max-width: 480px ) {
	.malcop-alquiler-panel-row {
		flex-direction: column;
		align-items: flex-start;
	}
	.malcop-alquiler-label {
		min-width: auto;
	}
}

/* --------------------------------------------------------------------------
   Pestaña de documentación PDF
   -------------------------------------------------------------------------- */

.malcop-docs-wrap {
	padding: 0.5em 0;
}

.malcop-docs-lista {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0.5em;
}

.malcop-docs-item {
	margin: 0;
}

.malcop-docs-link {
	display: inline-flex;
	align-items: center;
	gap: 0.5em;
	padding: 0.6em 0.9em;
	border: 1px solid #d0dce8;
	border-radius: 4px;
	background: #f7fafc;
	color: #1a6fa8;
	text-decoration: none;
	font-size: 0.92rem;
	transition: background 0.15s, border-color 0.15s;
	max-width: 100%;
}

.malcop-docs-link:hover {
	background: #e8f1f8;
	border-color: #1a6fa8;
	text-decoration: none;
	color: #1a6fa8;
}

.malcop-docs-icon {
	font-size: 1.15em;
	flex-shrink: 0;
}

.malcop-docs-nombre {
	flex: 1;
	min-width: 0;
	word-break: break-word;
}

.malcop-docs-size {
	flex-shrink: 0;
	font-size: 0.82em;
	color: #888;
	white-space: nowrap;
}

/* ==========================================================================
   Carrito — WooCommerce Blocks
   ========================================================================== */

/* Mostrar descripción completa del meta del producto en el carrito (WC Blocks
   trunca con -webkit-line-clamp por defecto aplicado al <p> hijo). */
.wc-block-components-product-metadata__description,
.wc-block-components-product-metadata__description p {
	display: block !important;
	-webkit-line-clamp: unset !important;
	-webkit-box-orient: unset !important;
	overflow: visible !important;
	max-height: none !important;
}

