/*/* Livedev Matriz de Precios - Estilos Frontend */

.livedev-matriz-container {
	max-width: 80%;
	margin: 30px auto 100px auto;
	padding: 20px;
	border: 1px solid #ddd;
	border-radius: 4px;
	background-color: #fafafa;
	box-sizing: border-box;
}

/* Información de precios */
.livedev-matriz-info {
	background: #f0f8ff;
	border-left: 4px solid #aa0000;
	padding: 12px;
	margin-bottom: 15px;
	border-radius: 3px;
	font-size: 13px;
	color: #333;
}

.livedev-matriz-info p {
	margin: 0;
}

/* Selectores de Color y Grosor */
.livedev-matriz-selectors {
	display: flex;
	gap: 20px;
	margin-bottom: 20px;
	flex-wrap: wrap;
}

.livedev-selector {
	flex: 1;
	min-width: 250px;
}

.livedev-selector label {
	display: block;
	font-weight: 600;
	margin-bottom: 8px;
	color: #333;
}

.livedev-selector select {
	width: 100%;
	padding: 10px;
	border: 1px solid #ccc;
	border-radius: 4px;
	font-size: 14px;
	background-color: #fff;
	cursor: pointer;
	transition: border-color 0.3s;
}

.livedev-selector select:hover,
.livedev-selector select:focus {
	border-color: #999;
	outline: none;
	box-shadow: 0 0 4px rgba(0, 0, 0, 0.1);
}

.livedev-selector select:disabled {
	background-color: #f5f5f5;
	color: #999;
	cursor: not-allowed;
}

/* Tabla de Matriz */
.livedev-matriz-table-wrapper {
	overflow-x: auto;
	margin: 20px 0;
	border: 1px solid #ddd;
	border-radius: 4px;
	background-color: #fff;
}

.livedev-matriz-table {
	width: 100%;
	border-collapse: collapse;
	background-color: #fff;
	max-width: 100%;
}

.livedev-matriz-table thead {
	background-color: #f8f8f8;
	border-bottom: 2px solid #ddd;
}

.livedev-matriz-table th {
	padding: 12px;
	text-align: center;
	font-weight: 600;
	color: #333;
	border: 1px solid #ddd;
	word-wrap: break-word;
	min-width: 80px;
}

.livedev-matriz-table th.livedev-matriz-corner {
	text-align: left;
	background-color: #f0f0f0;
	padding-left: 20px;
}

.livedev-matriz-table tbody td {
	padding: 0;
	border: 1px solid #ddd;
	min-width: 80px;
}

.livedev-matriz-label {
	padding-left: 10px !important;
	font-weight: 600;
	color: #333;
	background-color: #f8f8f8;
	text-align: left;
	word-break: break-word;
}

/* Celdas de la matriz */
.livedev-matriz-cell {
	padding: 0;
	text-align: center;
}

.livedev-matriz-cell-btn {
	width: 100%;
	height: 100%;
	padding: 2px;
	border: none;
	background-color: #fff;
	color: #333;
	cursor: pointer;
	font-size: 13px;
	font-weight: 500;
	transition: all 0.3s;
	border-left: 1px solid #ddd;
	border-right: 1px solid #ddd;
}

.livedev-matriz-cell-btn:hover {
	background-color: #f0f0f0;
	color: #000;
}

.livedev-matriz-cell-btn.selected {
	background-color: #ba0000;
	color: #fff;
	font-weight: 600;
}

.livedev-precio-container {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
}

.livedev-matriz-cell-btn .precio-unitario {
	flex: 1;
	width: 100%;
	padding: 12px 8px;
	background-color: #ffffff;
	font-weight: 600;
	font-size: 16px;
	color: #333;
	display: flex;
	align-items: center;
	justify-content: center;
	border-bottom: 1px solid #e0e0e0;
	line-height: 1.2;
}

.livedev-matriz-cell-btn .precio-total {
	flex: 1;
	width: 100%;
	padding: 8px;
	background-color: #f5f5f5;
	font-size: 11px;
	color: #666;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: normal;
	line-height: 1.2;
}

.livedev-matriz-cell-btn .precio {
	display: block;
	font-size: 13px;
	line-height: 1.4;
}

/* Resumen de selección */
.livedev-matriz-resumen {
	margin-top: 20px;
	padding: 15px;
	background-color: #fff;
	border: 1px solid #ddd;
	border-radius: 4px;
	min-height: 40px;
}

.livedev-matriz-seleccion {
	padding: 10px;
}

.livedev-matriz-seleccion p {
	margin: 0;
	font-size: 14px;
	line-height: 1.6;
}

.livedev-label {
	display: inline-block;
	margin-right: 15px;
	margin-bottom: 5px;
}

.livedev-label::before {
	content: '✓ ';
	color: #28a745;
	font-weight: bold;
	margin-right: 5px;
}

.livedev-label strong {
	color: #333;
	font-weight: 600;
}

.livedev-total {
	display: block;
	margin-top: 10px;
	padding-top: 10px;
	border-top: 1px solid #ddd;
	font-size: 16px;
	font-weight: 700;
	color: #28a745;
}

/* Inputs ocultos */
input[name="livedev_matriz_medida_idx"],
input[name="livedev_matriz_cantidad_idx"],
input[name="livedev_matriz_color_idx"],
input[name="livedev_matriz_grosor_idx"] {
	display: none;
}

/* Botón "Añadir al carrito" */
.livedev-add-to-cart {
	display: block !important;
	width: 100% !important;
	margin-top: 20px !important;
	margin-bottom: 20px !important;
	padding: 12px 24px !important;
	background-color: #ba0000 !important;
	color: #fff !important;
	border: none !important;
	border-radius: 4px !important;
	font-size: 16px !important;
	font-weight: 600 !important;
	cursor: pointer !important;
	transition: background-color 0.3s !important;
	text-transform: uppercase !important;
	letter-spacing: 0.5px !important;
}

.livedev-add-to-cart:hover:not(:disabled) {
	background-color: #b30000 !important;
}

.livedev-add-to-cart:disabled {
	opacity: 0.5 !important;
	cursor: not-allowed !important;
}

/* Botón "Añadir al carrito" - después del resumen */
.livedev-matriz-resumen + button,
.livedev-matriz-resumen ~ button[name="add-to-cart"],
.livedev-matriz-resumen ~ .single_add_to_cart_button {
	display: block !important;
	width: 100% !important;
	margin-top: 20px !important;
	margin-bottom: 20px !important;
	padding: 12px 24px !important;
}

/* Asegurar que el botón dentro del contenedor también se vea */
.livedev-matriz-container button[name="add-to-cart"],
.livedev-matriz-container .single_add_to_cart_button {
	display: block !important;
	visibility: visible !important;
}

/* Responsivo */
@media (max-width: 768px) {
	.livedev-matriz-selectors {
		flex-direction: column;
	}

	.livedev-selector {
		min-width: 100%;
	}

	.livedev-matriz-table th,
	.livedev-matriz-table td {
		padding: 8px;
		font-size: 12px;
	}

	.livedev-matriz-cell-btn {
		padding: 8px 4px;
		font-size: 11px;
	}

	.livedev-label {
		display: block;
		margin-bottom: 8px;
	}

	.livedev-total {
		font-size: 14px;
	}
}

@media (max-width: 480px) {
	.livedev-matriz-container {
		padding: 10px;
	}

	.livedev-matriz-table th,
	.livedev-matriz-table td {
		padding: 6px 4px;
		min-width: 60px;
		font-size: 10px;
	}

	.livedev-matriz-cell-btn {
		padding: 6px 2px;
		font-size: 10px;
	}

	.livedev-label {
		font-size: 12px;
	}
}

/* Precio en listado */
.livedev-matriz-price-label {
	display: inline-block;
	font-size: 14px;
	font-weight: 500;
	color: #333;
}

.livedev-matriz-price-label .woocommerce-Price-amount {
	font-size: 14px;
}

/* Estilos para opciones deshabilitadas en selectores */
.livedev-selector select option:disabled,
.livedev-selector select .disabled-option {
	color: #ccc;
	background-color: #f5f5f5;
	text-decoration: line-through;
}

.livedev-selector select:disabled,
.livedev-selector select option:disabled {
	cursor: not-allowed;
}
