/*
 * Woo Plus — Frontend Checkout
 * Estilos para tarjetas de envío y mensajes de alerta.
 * Mobile-first, completamente responsivo.
 */

/* ── VARIABLES ── */

:root {
	--woo-plus-checkout-accent: #6366f1;
	--woo-plus-checkout-bg: var(--woo-plus-white, #ffffff);
	--woo-plus-checkout-border: var(--woo-plus-slate-200, #e2e8f0);
	--woo-plus-checkout-text: var(--woo-plus-slate-800, #1e293b);
	--woo-plus-checkout-text-muted: var(--woo-plus-slate-500, #64748b);
	--woo-plus-checkout-radius: 12px;
	--woo-plus-checkout-radius-lg: 16px;
	--woo-plus-checkout-shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.04);
	--woo-plus-checkout-shadow-md: 0 8px 20px rgba(0, 0, 0, 0.06);
	--woo-plus-checkout-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* PHP inline override usa esta clase como scope */
.wp-enhanced-shipping {
	--woo-plus-checkout-accent-internal: var(--woo-plus-checkout-accent);
}


/* ══════════════════════════════════════════════════════════════════════
   1. TARJETAS DE ENVÍO
   ═══════════════════════════════════════════════════════════════════ */

/* Grid de métodos — 1 columna mobile, auto-fit >=768px */
.wp-enhanced-shipping .woocommerce-shipping-methods {
	display: grid;
	grid-template-columns: 1fr;
	gap: 10px;
	padding: 0 !important;
	margin: 14px 0 !important;
	list-style: none !important;
	width: 100% !important;
	max-width: 100% !important;
}

@media (min-width: 768px) {
	.wp-enhanced-shipping .woocommerce-shipping-methods {
		grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	}
}

.wp-enhanced-shipping .woocommerce-shipping-methods li {
	margin: 0 !important;
	padding: 0 !important;
}

.wp-enhanced-shipping .wp-shipping-th-title {
	font-size: 16px;
	font-weight: 600;
	line-height: 1.1;
	color: var(--woo-plus-checkout-text);
	text-align: left !important;
	vertical-align: top;
	padding-top: 8px !important;
}

.wp-enhanced-shipping .woocommerce-shipping-methods li,
.wp-enhanced-shipping .wp-shipping-card {
	width: 100%;
	min-width: 0;
	max-width: none !important;
}

/* Ocultar input nativo */
.wp-hidden-input {
	display: none !important;
}

/* ── Tarjeta ── */

.wp-shipping-card {
	position: relative;
	display: flex;
	flex-direction: column;
	padding: 14px 16px;
	background: transparent;
	border: 1.5px solid var(--woo-plus-checkout-border);
	border-radius: var(--woo-plus-checkout-radius-lg);
	box-shadow: var(--woo-plus-checkout-shadow-sm);
	overflow: hidden;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
	transition: var(--woo-plus-checkout-transition);
}

.wp-single-shipping-method .wp-shipping-card {
	cursor: default;
}

@media (min-width: 480px) {
	.wp-shipping-card {
		padding: 18px;
	}
}

.wp-shipping-card:hover {
	border-color: var(--woo-plus-checkout-accent);
	box-shadow: var(--woo-plus-checkout-shadow-md);
	transform: translateY(-2px);
}

.wp-shipping-card.is-selected {
	border-color: var(--woo-plus-checkout-accent);
	background: transparent;
	box-shadow: 0 10px 25px rgba(99, 102, 241, 0.12);
}

/* Fila principal de la tarjeta */
.wp-shipping-card-main {
	display: flex;
	align-items: center;
	gap: 12px;
	width: 100%;
	min-width: 0;
}

/* ── Círculo de radio ── */

.wp-shipping-card-radio {
	position: relative;
	width: 20px;
	height: 20px;
	background: var(--woo-plus-checkout-bg);
	border: 2px solid var(--woo-plus-slate-300, #cbd5e1);
	border-radius: 50%;
	flex-shrink: 0;
	transition: var(--woo-plus-checkout-transition);
}

.is-selected .wp-shipping-card-radio {
	border-color: var(--woo-plus-checkout-accent);
	background: var(--woo-plus-checkout-accent);
}

.is-selected .wp-shipping-card-radio::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 8px;
	height: 8px;
	background: var(--woo-plus-checkout-bg);
	border-radius: 50%;
	transform: translate(-50%, -50%) scale(1);
	animation: woo-plus-radio-pop 0.25s ease-out;
}

@keyframes woo-plus-radio-pop {
	from { transform: translate(-50%, -50%) scale(0); }
	to   { transform: translate(-50%, -50%) scale(1); }
}

/* ── Ícono en cuadro redondeado ── */

.wp-shipping-card-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	background: var(--woo-plus-checkout-bg);
	border-radius: 10px;
	color: var(--woo-plus-checkout-text-muted);
	flex-shrink: 0;
	transition: var(--woo-plus-checkout-transition);
}

@media (min-width: 480px) {
	.wp-shipping-card-icon {
		width: 44px;
		height: 44px;
		border-radius: 12px;
	}
}

.is-selected .wp-shipping-card-icon {
	background: var(--woo-plus-checkout-accent);
	color: var(--woo-plus-checkout-bg);
	box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.wp-shipping-card-icon .dashicons {
	width: 20px;
	height: 20px;
	font-size: 20px;
}

@media (min-width: 480px) {
	.wp-shipping-card-icon .dashicons {
		width: 22px;
		height: 22px;
		font-size: 22px;
	}
}

/* ── Info: título + precio ── */

.wp-shipping-card-info {
	display: flex;
	flex-direction: column;
	flex: 1;
	min-width: 0;
}

.wp-shipping-card-title {
	font-size: 14px;
	font-weight: 700;
	color: var(--woo-plus-checkout-text);
	white-space: normal;
	overflow: hidden;
	text-overflow: clip;
	word-break: break-word;
}

@media (min-width: 480px) {
	.wp-shipping-card-title {
		font-size: 15px;
	}
}

.wp-shipping-card-price {
	margin-top: 2px;
	font-size: 13px;
	font-weight: 600;
	color: var(--woo-plus-checkout-accent);
}

@media (max-width: 767px) {
	.wp-enhanced-shipping .woocommerce-shipping-methods {
		gap: 8px;
		margin: 10px 0 !important;
	}

	.wp-enhanced-shipping .wp-shipping-th-title {
		font-size: 15px;
		line-height: 1.25;
		padding-top: 4px !important;
	}

	.wp-shipping-card {
		padding: 12px 12px;
		border-radius: 14px;
	}

	.wp-shipping-card-main {
		gap: 10px;
		align-items: center;
	}

	.wp-shipping-card-icon {
		width: 38px;
		height: 38px;
	}

	.wp-shipping-card-title {
		font-size: 13px;
		line-height: 1.25;
	}

	.wp-shipping-card-price {
		margin-top: 4px;
		font-size: 12px;
		line-height: 1.2;
	}
}


/* ══════════════════════════════════════════════════════════════════════
   2. MENSAJES / ALERTAS DE REGLAS DE ENVÍO
   ═══════════════════════════════════════════════════════════════════ */

.wp-shipping-messages-main-container {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin: 12px 0;
}

.woo-plus-checkout-notice {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	padding: 14px 16px;
	background: var(--woo-plus-slate-50, #f8fafc);
	border: 1px solid var(--woo-plus-checkout-border);
	border-radius: var(--woo-plus-checkout-radius);
	box-shadow: var(--woo-plus-checkout-shadow-sm);
	font-size: 13px;
	line-height: 1.6;
	color: var(--woo-plus-checkout-text);
	word-break: break-word;
	transition: var(--woo-plus-checkout-transition);
}

.woo-plus-checkout-notice-content {
	display: block;
	width: 100%;
	text-align: left !important;
}

.woo-plus-checkout-notice-content,
.woo-plus-checkout-notice-content * {
	text-align: left !important;
}

@media (min-width: 480px) {
	.woo-plus-checkout-notice {
		align-items: center;
		gap: 15px;
		padding: 16px 20px;
		font-size: 14px;
	}
}

/* Ícono circular */
.woo-plus-checkout-notice-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	background: rgba(99, 102, 241, 0.1);
	border-radius: 50%;
	color: var(--woo-plus-checkout-accent);
	flex-shrink: 0;
}

@media (min-width: 480px) {
	.woo-plus-checkout-notice-icon {
		width: 32px;
		height: 32px;
	}
}

.woo-plus-checkout-notice-icon .dashicons {
	width: 16px;
	height: 16px;
	font-size: 16px;
}

@media (min-width: 480px) {
	.woo-plus-checkout-notice-icon .dashicons {
		width: 18px;
		height: 18px;
		font-size: 18px;
	}
}

/* ── Estilos de color por tipo ── */

.woo-plus-checkout-notice.is-style-azul {
	border-left: 4px solid var(--woo-plus-accent-blue, #3b82f6);
}

.woo-plus-checkout-notice.is-style-azul .woo-plus-checkout-notice-icon {
	color: var(--woo-plus-accent-blue, #3b82f6);
	background: rgba(59, 130, 246, 0.1);
}

.woo-plus-checkout-notice.is-style-default {
	border-left: 4px solid var(--wc-primary, var(--wp--preset--color--primary, var(--wp-checkout-accent)));
}

.woo-plus-checkout-notice.is-style-default .woo-plus-checkout-notice-icon {
	color: var(--wc-primary, var(--wp--preset--color--primary, var(--wp-checkout-accent)));
	background: rgba(59, 130, 246, 0.1);
}

.woo-plus-checkout-notice.is-style-amarillo {
	border-left: 4px solid var(--woo-plus-accent-warning, #f59e0b);
	background: #fffbeb;
}

.woo-plus-checkout-notice.is-style-amarillo .woo-plus-checkout-notice-icon {
	color: var(--woo-plus-accent-warning, #f59e0b);
	background: rgba(245, 158, 11, 0.1);
}

.woo-plus-checkout-notice.is-style-verde {
	border-left: 4px solid var(--woo-plus-accent-success, #10b981);
	background: #ecfdf5;
}

.woo-plus-checkout-notice.is-style-verde .woo-plus-checkout-notice-icon {
	color: var(--woo-plus-accent-success, #10b981);
	background: rgba(16, 185, 129, 0.1);
}

.woo-plus-checkout-notice.is-style-rojo {
	border-left: 4px solid var(--woo-plus-accent-danger, #ef4444);
	background: #fef2f2;
}

.woo-plus-checkout-notice.is-style-rojo .woo-plus-checkout-notice-icon {
	color: var(--woo-plus-accent-danger, #ef4444);
	background: rgba(239, 68, 68, 0.1);
}

.woo-plus-checkout-notice.is-style-morado {
	border-left: 4px solid var(--woo-plus-accent-purple, #8b5cf6);
}

.woo-plus-checkout-notice.is-style-morado .woo-plus-checkout-notice-icon {
	color: var(--woo-plus-accent-purple, #8b5cf6);
	background: rgba(139, 92, 246, 0.1);
}

.woo-plus-checkout-notice.is-style-celeste {
	border-left: 4px solid var(--woo-plus-accent-sky, #0ea5e9);
}

.woo-plus-checkout-notice.is-style-celeste .woo-plus-checkout-notice-icon {
	color: var(--woo-plus-accent-sky, #0ea5e9);
	background: rgba(14, 165, 233, 0.1);
}
