/**
 * Phone Field - Professional Compact Design
 * Diseño profesional basado en referencia de UI moderna
 * 
 * @package    MyCar_Phone_Field
 * @version    1.0.0.1
 * @since      1.0.0.1
 */

/* ========================================
   CONTENEDOR PRINCIPAL
   ======================================== */
.mycar-phone-wrapper {
	display: flex;
	flex-direction: column;
	gap: 8px;
	width: 100%;
	max-width: 100%;
	margin: 8px 0;
}

/* ========================================
   BUSCADOR DE PAÍS
   ======================================== */
.mycar-phone-search-wrapper {
	width: 100%;
}

.mycar-phone-search-input {
	width: 100%;
	padding: 8px 12px;
	font-size: 13px;
	border: 1px solid #ccc;
	border-radius: 4px;
	height: 36px;
	box-sizing: border-box;
	color: #333;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.mycar-phone-search-input:focus {
	outline: none;
	border-color: #0073aa;
	box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.08);
}

.mycar-phone-search-input::placeholder {
	color: #999;
	font-size: 13px;
}

/* Contenedor de inputs (select + número) */
.mycar-phone-inputs-row {
	display: inline-flex;
	gap: 8px;
	width: 100%;
	align-items: flex-start;
	flex-wrap: wrap;
}

/* ========================================
   SELECT DE PAÍS
   ======================================== */
.mycar-phone-select-wrapper {
	position: relative;
	flex-shrink: 0;
	min-width: 200px;
}

.mycar-phone-country-select {
	appearance: none;
	-webkit-appearance: none;
	-moz-appearance: none;
	background: white;
	border: 1px solid #ccc;
	border-radius: 4px;
	padding: 8px 24px 8px 8px;
	font-size: 13px;
	font-weight: 500;
	color: #333;
	cursor: pointer;
	min-width: 60px;
	height: 36px;
	background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
	background-repeat: no-repeat;
	background-position: right 4px center;
	background-size: 16px;
	padding-right: 24px;
	line-height: 1.4;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.mycar-phone-country-select:hover {
	border-color: #0073aa;
	box-shadow: 0 1px 3px rgba(0, 115, 170, 0.1);
}

.mycar-phone-country-select:focus {
	outline: none;
	border-color: #0073aa;
	box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.08);
}

.mycar-phone-country-select:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

/* ========================================
   INPUT DEL NÚMERO
   ======================================== */
.mycar-phone-number-input {
	flex: 1;
	min-width: 180px;
	padding: 8px 12px;
	font-size: 13px;
	border: 1px solid #ccc;
	border-radius: 4px;
	height: 36px;
	box-sizing: border-box;
	color: #333;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
	font-family: inherit;
}

.mycar-phone-number-input::placeholder {
	color: #999;
	font-size: 13px;
}

.mycar-phone-number-input:hover {
	border-color: #0073aa;
	box-shadow: 0 1px 3px rgba(0, 115, 170, 0.1);
}

.mycar-phone-number-input:focus {
	outline: none;
	border-color: #0073aa;
	box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.08);
}

.mycar-phone-number-input:disabled {
	opacity: 0.6;
	cursor: not-allowed;
	background-color: #f5f5f5;
}

/* Remover spinners en inputs numéricos */
.mycar-phone-number-input::-webkit-outer-spin-button,
.mycar-phone-number-input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.mycar-phone-number-input[type=number] {
	-moz-appearance: textfield;
}

/* ========================================
   CAMPO OCULTO
   ======================================== */
.mycar-phone-hidden {
	display: none;
}

/* ========================================
   VISUALIZACIÓN EN ADMIN
   ======================================== */
.mycar-phone-admin {
	display: inline-block;
	padding: 6px 10px;
	background: #f0f0f0;
	border-radius: 3px;
	font-family: 'Courier New', monospace;
	font-size: 12px;
	color: #333;
	border-left: 3px solid #0073aa;
}

.mycar-phone-admin code {
	background: none;
	padding: 0;
	color: inherit;
	font-size: inherit;
}

/* ========================================
   ESTADOS DE ERROR
   ======================================== */
.mycar-phone-country-select.error {
	border-color: #dc3545;
	box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.08);
}

.mycar-phone-number-input.error {
	border-color: #dc3545;
	box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.08);
}

/* ========================================
   RESPONSIVE - TABLET
   ======================================== */
@media (max-width: 768px) {
	.mycar-phone-wrapper {
		gap: 6px;
		margin: 6px 0;
	}

	.mycar-phone-country-select {
		min-width: 50px;
		padding: 6px 20px 6px 6px;
		font-size: 12px;
		height: 34px;
	}

	.mycar-phone-number-input {
		min-width: 150px;
		padding: 6px 10px;
		font-size: 12px;
		height: 34px;
	}
}

/* ========================================
   RESPONSIVE - MÓVIL
   ======================================== */
@media (max-width: 480px) {
	.mycar-phone-wrapper {
		flex-direction: column;
		gap: 6px;
	}

	.mycar-phone-country-select {
		width: 100%;
		min-width: 100%;
	}

	.mycar-phone-number-input {
		width: 100%;
		min-width: 100%;
		font-size: 16px; /* Prevenir zoom automático en iOS */
	}
}

/* ========================================
   DARK MODE SUPPORT
   ======================================== */
@media (prefers-color-scheme: dark) {
	.mycar-phone-country-select {
		background-color: #2a2a2a;
		color: #e0e0e0;
		border-color: #444;
		background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e0e0e0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
	}

	.mycar-phone-country-select:hover {
		border-color: #0073aa;
		box-shadow: 0 1px 3px rgba(0, 115, 170, 0.2);
	}

	.mycar-phone-country-select:focus {
		border-color: #0073aa;
		box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.15);
	}

	.mycar-phone-number-input {
		background-color: #2a2a2a;
		color: #e0e0e0;
		border-color: #444;
	}

	.mycar-phone-number-input::placeholder {
		color: #666;
	}

	.mycar-phone-number-input:hover {
		border-color: #0073aa;
		box-shadow: 0 1px 3px rgba(0, 115, 170, 0.2);
	}

	.mycar-phone-number-input:focus {
		border-color: #0073aa;
		box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.15);
	}

	.mycar-phone-number-input:disabled {
		background-color: #333;
	}

	.mycar-phone-admin {
		background: #333;
		color: #e0e0e0;
		border-left-color: #0073aa;
	}
}

/* ========================================
   ACCESIBILIDAD
   ======================================== */
@media (prefers-reduced-motion: reduce) {
	.mycar-phone-country-select,
	.mycar-phone-number-input {
		transition: none;
	}
}

.mycar-phone-country-select:focus-visible,
.mycar-phone-number-input:focus-visible {
	outline: 2px solid #0073aa;
	outline-offset: 0px;
}

/* ========================================
   HIGH CONTRAST MODE
   ======================================== */
@media (prefers-contrast: more) {
	.mycar-phone-country-select,
	.mycar-phone-number-input {
		border-width: 2px;
	}

	.mycar-phone-admin {
		border-left-width: 4px;
	}
}
