/* ── XT Address Manager ──────────────────────── */

/* Sub-items del menú "Mi cuenta" (mismo patrón que xt-payment-manager) */
/* Ocultar "Editar dirección" del menú */
li:has(> a[href*="edit-my-address"]) {
	display: none !important;
}
/* Indentar "Agregar dirección" como sub-item de Mis Direcciones */
li:has(> a.urcma-add-address),
li:has(> a[href*="add-address"]) {
	padding-left: 20px !important;
	font-size: 0.9em !important;
}

.xtam-optional {
	color: #888;
	font-weight: normal;
	font-size: 0.85em;
	margin-left: 4px;
}


.xtam-addresses,
.xtam-add-address,
.xtam-edit-address {
	font-family: 'Nunito', sans-serif;
}

/* ── Header ──────────────────────────────────── */

.xtam-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 20px;
	flex-wrap: wrap;
	gap: 10px;
}

.xtam-header h3 {
	margin: 0;
	font-size: 20px;
	color: #333;
}

.xtam-btn-add {
	background-color: #2d6b4f !important;
	color: #fff !important;
	border: none !important;
	padding: 8px 20px !important;
	border-radius: 4px !important;
	font-size: 13px !important;
	text-decoration: none !important;
	transition: background-color 0.2s;
}

.xtam-btn-add:hover {
	background-color: #245a42 !important;
	color: #fff !important;
}

/* ── Empty state ─────────────────────────────── */

.xtam-empty {
	text-align: center;
	padding: 40px 20px;
	background: #f9f9f9;
	border-radius: 8px;
	border: 1px dashed #ddd;
}

.xtam-empty p {
	color: #888;
	margin-bottom: 16px;
}

/* ── Address card ────────────────────────────── */

.xtam-address {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 16px 20px;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	background: #fff;
	margin-bottom: 12px;
	transition: border-color 0.2s, box-shadow 0.2s;
}

.xtam-address:hover {
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.xtam-address--default {
	border-color: #2d6b4f;
	border-width: 2px;
}

.xtam-address__main {
	flex: 1;
	min-width: 0;
}

.xtam-address__info {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.xtam-address__label {
	font-size: 11px;
	color: #2d6b4f;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.xtam-address__name {
	font-size: 15px;
	font-weight: 600;
	color: #333;
}

.xtam-address__details {
	font-size: 13px;
	color: #777;
	display: flex;
	flex-direction: column;
	gap: 1px;
	margin-top: 2px;
}

.xtam-address__phone {
	font-size: 13px;
	color: #555;
	margin-top: 2px;
}

.xtam-address__maps a {
	font-size: 12px;
	color: #2d6b4f;
	text-decoration: none;
}

.xtam-address__maps a:hover {
	text-decoration: underline;
}

.xtam-badge-default {
	display: inline-block;
	background: #2d6b4f;
	color: #fff;
	font-size: 10px;
	padding: 2px 8px;
	border-radius: 10px;
	font-weight: 600;
	text-transform: uppercase;
	margin-top: 4px;
	width: fit-content;
}

/* ── Actions ─────────────────────────────────── */

.xtam-address__actions {
	display: flex;
	gap: 8px;
	flex-shrink: 0;
	margin-left: 16px;
}

.xtam-btn {
	border: 1px solid #ddd;
	background: #fff;
	padding: 6px 14px;
	border-radius: 4px;
	font-size: 12px;
	cursor: pointer;
	color: #555;
	text-decoration: none;
	transition: all 0.15s;
	white-space: nowrap;
}

.xtam-btn:hover {
	background: #f5f5f5;
}

.xtam-btn--default {
	border-color: #2d6b4f;
	color: #2d6b4f;
}

.xtam-btn--default:hover {
	background: #2d6b4f;
	color: #fff;
}

.xtam-btn--edit {
	border-color: #1976d2;
	color: #1976d2;
}

.xtam-btn--edit:hover {
	background: #1976d2;
	color: #fff;
}

.xtam-btn--delete {
	border-color: #d32f2f;
	color: #d32f2f;
}

.xtam-btn--delete:hover {
	background: #d32f2f;
	color: #fff;
}

/* ── Form ────────────────────────────────────── */

.xtam-form {
	max-width: 640px;
}

.xtam-section {
	margin-bottom: 24px;
}

.xtam-section h4 {
	margin: 0 0 12px;
	padding-bottom: 8px;
	border-bottom: 1px solid #eee;
	font-size: 15px;
	color: #333;
}

.xtam-form-row {
	margin-bottom: 14px;
}

.xtam-form-row label {
	display: block;
	font-size: 13px;
	font-weight: 600;
	margin-bottom: 4px;
	color: #444;
}

.xtam-form-row label .required {
	color: #d32f2f;
	text-decoration: none;
	border: none;
}

.xtam-form-row input[type="text"],
.xtam-form-row input[type="tel"],
.xtam-form-row input[type="url"],
.xtam-form-row select {
	width: 100%;
	padding: 9px 12px;
	border: 1px solid #ddd;
	border-radius: 4px;
	font-size: 14px;
	box-sizing: border-box;
	font-family: inherit;
	transition: border-color 0.2s;
}

.xtam-field-readonly {
	background: #f5f5f5 !important;
	color: #888 !important;
	cursor: not-allowed;
}

.xtam-form-row input:focus,
.xtam-form-row select:focus {
	border-color: #2d6b4f;
	outline: none;
	box-shadow: 0 0 0 2px rgba(45, 107, 79, 0.1);
}

.xtam-form-row--half {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
}

.xtam-form-row--checkbox {
	margin: 20px 0;
}

.xtam-form-row--checkbox label {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-weight: 400;
	cursor: pointer;
}

.xtam-form-actions {
	display: flex;
	gap: 10px;
	margin-top: 20px;
}

.xtam-btn-save {
	background-color: #2d6b4f !important;
	color: #fff !important;
	border: none !important;
	padding: 10px 28px !important;
	border-radius: 4px !important;
	font-size: 14px !important;
	cursor: pointer;
	transition: background-color 0.2s;
}

.xtam-btn-save:hover {
	background-color: #245a42 !important;
}

.xtam-btn-save:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.xtam-btn-cancel {
	background: #f5f5f5 !important;
	color: #555 !important;
	border: 1px solid #ddd !important;
	padding: 10px 28px !important;
	border-radius: 4px !important;
	font-size: 14px !important;
	text-decoration: none !important;
}

.xtam-btn-cart {
	background: #fff !important;
	color: #2d6b4f !important;
	border: 1px solid #2d6b4f !important;
	padding: 10px 28px !important;
	border-radius: 4px !important;
	font-size: 14px !important;
	text-decoration: none !important;
	transition: background-color 0.2s, color 0.2s;
}

.xtam-btn-cart:hover {
	background: #2d6b4f !important;
	color: #fff !important;
}

/* ── Utilities ───────────────────────────────── */

.xtam-hidden {
	display: none !important;
}

.xtam-loading {
	pointer-events: none;
	opacity: 0.6;
}

/* ── Modal ───────────────────────────────────── */

.xtam-modal {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 999999;
	align-items: center;
	justify-content: center;
}

.xtam-modal--open {
	display: flex;
}

.xtam-modal__overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.45);
}

.xtam-modal__box {
	position: relative;
	background: #fff;
	border-radius: 12px;
	padding: 32px;
	max-width: 420px;
	width: 90%;
	text-align: center;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.xtam-modal__box--success {
	border-top: 4px solid #2d6b4f;
}

.xtam-modal__box--error {
	border-top: 4px solid #d32f2f;
}

.xtam-modal__box--confirm {
	border-top: 4px solid #f59e0b;
}

.xtam-modal__text {
	font-size: 15px;
	color: #333;
	margin-bottom: 20px;
	line-height: 1.5;
}

.xtam-modal__actions {
	display: flex;
	justify-content: center;
	gap: 10px;
}

.xtam-modal__btn {
	padding: 8px 20px;
	border: none;
	border-radius: 4px;
	font-size: 13px;
	cursor: pointer;
	font-family: inherit;
	transition: background-color 0.2s;
}

.xtam-modal__btn--primary {
	background: #2d6b4f;
	color: #fff;
}

.xtam-modal__btn--primary:hover {
	background: #245a42;
}

.xtam-modal__btn--secondary {
	background: #e5e5e5;
	color: #555;
}

.xtam-modal__btn--secondary:hover {
	background: #d5d5d5;
}

.xtam-modal__btn--danger {
	background: #d32f2f;
	color: #fff;
}

.xtam-modal__btn--danger:hover {
	background: #b71c1c;
}

/* ── Toast ───────────────────────────────────── */

.xtam-toast {
	position: fixed;
	bottom: 30px;
	right: 30px;
	padding: 14px 24px;
	border-radius: 8px;
	color: #fff;
	font-size: 14px;
	z-index: 1000000;
	transform: translateY(20px);
	opacity: 0;
	transition: all 0.3s ease;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.xtam-toast--visible {
	transform: translateY(0);
	opacity: 1;
}

.xtam-toast--success {
	background: #2d6b4f;
}

.xtam-toast--error {
	background: #d32f2f;
}

/* ── Mobile ──────────────────────────────────── */

@media (max-width: 600px) {
	.xtam-header {
		flex-direction: column;
		align-items: flex-start;
	}

	.xtam-address {
		flex-direction: column;
		align-items: flex-start;
		gap: 12px;
	}

	.xtam-address__actions {
		width: 100%;
		margin-left: 0;
		flex-wrap: wrap;
	}

	.xtam-btn {
		flex: 1;
		text-align: center;
		min-width: 80px;
	}

	.xtam-form-row--half {
		grid-template-columns: 1fr;
	}

	.xtam-form-actions {
		flex-direction: column;
	}

	.xtam-toast {
		left: 15px;
		right: 15px;
		bottom: 15px;
	}
}
