/* ==========================================================================
   Inkawoo License Server — Mi cuenta > Licencias
   Complementa las clases nativas de WooCommerce (.woocommerce-orders-table).
   ========================================================================== */

/* Número de pedido: texto plano, sin estilo de botón */
.woocommerce-account .inkawoo-order-link {
	display: inline;
	padding: 0;
	margin: 0;
	border: 0;
	background: none;
	box-shadow: none;
	font-weight: 700;
	color: black;
	text-decoration: none;
	border-radius: 0;
}

.woocommerce-account .inkawoo-order-link:hover,
.woocommerce-account .inkawoo-order-link:focus {
	background: none;
	box-shadow: none;
	text-decoration: underline;
	color: inherit;
}

/* Clave de licencia + botón copiar */
.inkawoo-lic-key-cell {
	width: 1%;
	white-space: nowrap;
}

.inkawoo-lic-key-wrap {
	display: inline-flex;
	align-items: center;
	gap: .35rem;
	flex-wrap: nowrap;
	max-width: 100%;
}

.inkawoo-lic-key-scroll {
	flex: 0 1 auto;
	min-width: 0;
}

.inkawoo-lic-key {
	display: inline;
	font-family: inherit;
	font-size: inherit;
	font-weight: inherit;
	line-height: inherit;
	word-break: break-all;
	user-select: all;
	background: none;
	padding: 0;
	vertical-align: middle;
}

/* Botón copiar: cuadrado con bordes ligeramente redondeados */
.woocommerce-account .inkawoo-copy-btn.button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2rem;
	min-height: 2rem;
	padding: .35rem;
	line-height: 1;
	border-radius: 6px;
	background: #fff;
	border: 1px solid #d1d5db;
	box-shadow: none;
	vertical-align: middle;
}

.woocommerce-account .inkawoo-copy-btn.button:hover,
.woocommerce-account .inkawoo-copy-btn.button:focus {
	background: #f9fafb;
	border-color: #9ca3af;
	color: inherit;
}

.inkawoo-copy-btn svg {
	display: block;
}

/* Estado: badge redondo, fondo pastel y texto del color del estado */
.inkawoo-status-badge {
	display: inline-block;
	padding: .2em .75em;
	border-radius: 999px;
	font-size: inherit;
	font-weight: 600;
	line-height: 1.5;
	white-space: nowrap;
	background: #f3f4f6;
	color: #6b7280;
}

.inkawoo-status-badge.inkawoo-badge--success {
	background: #dcfce7;
	color: #15803d;
}

.inkawoo-status-badge.inkawoo-badge--danger {
	background: #fee2e2;
	color: #b91c1c;
}

.inkawoo-status-badge.inkawoo-badge--warning {
	background: #fef3c7;
	color: #b45309;
}

.inkawoo-status-badge.inkawoo-badge--pending {
	background: #f3f4f6;
	color: #6b7280;
}

.inkawoo-expired {
	color: #b91c1c;
	font-weight: 600;
}

/* Botón Renovar: hereda el estilo redondo/negro del tema (woocommerce-button) */
.woocommerce-account .woocommerce-orders-table .inkawoo-renew-btn.button {
	white-space: nowrap;
}

/* Licencia sin vencimiento: acción no aplicable, desactivada con opacidad */
.woocommerce-account .woocommerce-orders-table .inkawoo-renew-btn--disabled.button {
    text-transform: capitalize;
    border-radius: 50px;
	opacity: 0.5;
	pointer-events: none;
	cursor: not-allowed;
	box-shadow: none;
}

/* Licencia vencida: botón rojo redondo */
.woocommerce-account .inkawoo-renew-btn--expired.button {
	background-color: #b91c1c !important;
	border-color: #991b1b !important;
	color: #fff !important;
}

.woocommerce-account .inkawoo-renew-btn--expired.button:hover,
.woocommerce-account .inkawoo-renew-btn--expired.button:focus {
	background-color: #991b1b !important;
	border-color: #7f1d1d !important;
	color: #fff !important;
}

/* Móvil: tarjetas por licencia */
@media (max-width: 768px) {
	.woocommerce-account table.inkawoo-licenses-table {
		border: 0;
		margin-bottom: 0;
	}

	.woocommerce-account table.inkawoo-licenses-table thead {
		display: none;
	}

	.woocommerce-account table.inkawoo-licenses-table tbody {
		display: block;
	}

	.woocommerce-account table.inkawoo-licenses-table tbody tr.inkawoo-license-row {
		display: grid;
		grid-template-columns: 1fr auto;
		grid-template-areas:
			"product status"
			"license license"
			"sites sites"
			"expires expires"
			"order order"
			"actions actions";
		gap: 0;
		margin: 0 0 1rem;
		padding: 1rem;
		border: 1px solid #e5e7eb;
		border-radius: 10px;
		background: #fff;
		box-shadow: 0 1px 3px rgba(15, 23, 42, .06);
	}

	.woocommerce-account table.inkawoo-licenses-table tbody tr.inkawoo-license-row:last-child {
		margin-bottom: 0;
	}

	.woocommerce-account table.inkawoo-licenses-table tbody td {
		display: block;
		width: auto;
		padding: 0;
		border: 0;
		text-align: left;
	}

	.woocommerce-account table.inkawoo-licenses-table tbody td::before {
		display: none;
	}

	.woocommerce-account table.inkawoo-licenses-table .inkawoo-license-product {
		grid-area: product;
		font-size: 1.05em;
		font-weight: 700;
		line-height: 1.35;
		padding-right: .5rem;
		align-self: center;
	}

	.woocommerce-account table.inkawoo-licenses-table .inkawoo-license-status {
		grid-area: status;
		justify-self: end;
		align-self: center;
	}

	.woocommerce-account table.inkawoo-licenses-table .inkawoo-lic-key-cell {
		grid-area: license;
		margin-top: .85rem;
		padding-top: .85rem;
		border-top: 1px solid #f1f5f9;
		white-space: normal;
	}

	.woocommerce-account table.inkawoo-licenses-table .inkawoo-lic-key-cell::before {
		display: block;
		content: attr(data-title);
		font-size: .78em;
		font-weight: 600;
		letter-spacing: .02em;
		text-transform: uppercase;
		color: #64748b;
		margin-bottom: .4rem;
	}

	.woocommerce-account table.inkawoo-licenses-table .inkawoo-lic-key-wrap {
		display: flex;
		align-items: center;
		width: 100%;
		max-width: 100%;
	}

	.woocommerce-account table.inkawoo-licenses-table .inkawoo-lic-key-scroll {
		flex: 1 1 auto;
		min-width: 0;
		max-height: 4.5em;
		overflow-y: auto;
		overflow-x: hidden;
		-webkit-overflow-scrolling: touch;
		padding: .15rem 0;
	}

	.woocommerce-account table.inkawoo-licenses-table .inkawoo-lic-key {
		word-break: break-all;
		line-height: 1.4;
	}

	.woocommerce-account .inkawoo-copy-btn.button {
		flex-shrink: 0;
	}

	.woocommerce-account table.inkawoo-licenses-table .inkawoo-license-meta {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: .75rem;
		margin-top: .65rem;
		font-size: .95em;
	}

	.woocommerce-account table.inkawoo-licenses-table .inkawoo-license-sites {
		grid-area: sites;
	}

	.woocommerce-account table.inkawoo-licenses-table .inkawoo-license-expires {
		grid-area: expires;
	}

	.woocommerce-account table.inkawoo-licenses-table .inkawoo-license-order {
		grid-area: order;
	}

	.woocommerce-account table.inkawoo-licenses-table .inkawoo-license-meta::before {
		display: block;
		content: attr(data-title);
		flex: 0 0 auto;
		font-weight: 600;
		color: #64748b;
	}

	.woocommerce-account table.inkawoo-licenses-table .inkawoo-license-meta > span,
	.woocommerce-account table.inkawoo-licenses-table .inkawoo-license-meta > a {
		text-align: right;
	}

	.woocommerce-account table.inkawoo-licenses-table .inkawoo-license-actions {
		grid-area: actions;
		margin-top: 1rem;
		padding-top: .85rem;
		border-top: 1px solid #f1f5f9;
	}

	.woocommerce-account table.inkawoo-licenses-table .inkawoo-license-actions--empty {
		display: none;
	}

	.woocommerce-account table.inkawoo-licenses-table .inkawoo-license-no-action {
		display: none;
	}

	.woocommerce-account table.inkawoo-licenses-table .inkawoo-renew-btn.button {
		display: block;
		width: 100%;
		text-align: center;
		padding: .7rem 1rem;
	}
}

/* Pantallas muy estrechas */
@media (max-width: 380px) {
	.woocommerce-account table.inkawoo-licenses-table tbody tr.inkawoo-license-row {
		grid-template-columns: 1fr;
		grid-template-areas:
			"product"
			"status"
			"license"
			"sites"
			"expires"
			"order"
			"actions";
		padding: .85rem;
	}

	.woocommerce-account table.inkawoo-licenses-table .inkawoo-license-status {
		justify-self: start;
		margin-bottom: .15rem;
	}
}
