/*
 * Simulador de viagem da homepage (PT + EN).
 * Carregado por simulador-home.php apenas nas páginas com o shortcode.
 *
 * Secções:
 *   1. Componente novo (.ml-sim) - escopado, não afeta o resto do site.
 *   2. Select2 / datepicker - regras GLOBAIS, mantidas como no original.
 *   3. Legado - classes herdadas do CSS antigo, mantidas por precaução
 *      (não sabemos se são usadas noutros sítios).
 */

/* ==========================================================================
   1. Componente
   ========================================================================== */

.ml-sim {
	background-color: #202979;
}

.ml-sim .hiddenvisually,
.hiddenvisually {
	position: absolute;
	left: -10000px;
	top: auto;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* Linhas de origem / destino / hora+data.
   Larguras e margem com seletores por ID e !important: no original estavam em style=""
   inline (que vence qualquer regra do tema/Divi para estes IDs). Sem isto, no mobile
   o #divPtoPartida ficava com 100% e saía do contentor. */
.ml-sim .ml-sim__linha,
.ml-sim #divPtoPartida,
.ml-sim #divPtoChegada,
.ml-sim #divHoraData {
	box-sizing: border-box;
	margin-left: 4% !important;
	margin-right: 0 !important;
	width: 92% !important;
	max-width: 92% !important;
}
.ml-sim__linha--origem  { padding-top: 15px; }
.ml-sim__linha--destino { margin-top: 7px; }

.ml-sim select {
	width: 100%;
	height: 37px;
}

/* Linha hora + data (flutuantes, com clearfix) */
.ml-sim__hora-data {
	margin-top: 7px;
}
.ml-sim__hora-data::after {
	content: "";
	display: table;
	clear: both;
}
.ml-sim__hora {
	float: left;
	width: 40%;
}
.ml-sim__data {
	float: left;
	display: flex;          /* ícone + input + seta na mesma linha, sem depender de espaços no HTML */
	align-items: center;
	width: 58%;
	padding-top: 10px;
	margin-left: 7px;
}
.ml-sim__icone-data {
	color: #c4d5f3;
	vertical-align: middle;
	margin-left: 5px;
	font-size: 1.4285714285714286rem;
}
.ml-sim__seta-data {
	color: #3382d9;
	vertical-align: middle;
	font-size: 1.3333333333333333rem;
}
.ml-sim #data_viagem {
	flex: 1 1 auto;
	min-width: 0;
	width: auto;
	box-sizing: border-box;
	font-family: 'Ubuntu', sans-serif;
	font-size: 1rem;
	font-weight: 500;
	color: #fff;
	background-color: #202979;
	border: 1px solid #202979;
}

/* Select da hora: fundo azul e texto branco */
.ml-sim #horaDiv > span > span.selection > span {
	background-color: #202979;
	color: #fff;
	border: 1px solid #202979;
}
#select2-hora_viagem-container {
	color: #fff;
}

/* Ícones dentro dos selects (origem/destino/hora) */
.ml-sim__icone {
	vertical-align: middle;
	font-size: 1.3333333333333333rem;
	margin-right: 0.25em;
}
.ml-sim__icone--local { color: #3e8ede; }
.ml-sim__icone--hora  { color: #c4d5f3; }

/* Botões (Viajar / Próximos Comboios) */
.ml-sim__acoes::after {
	content: "";
	display: table;
	clear: both;
}
.ml-sim .ml-sim__btn {
	display: flex;
	align-items: center;
	justify-content: center;
	float: left;
	clear: both;
	box-sizing: border-box;
	width: 92%;
	height: 40px;
	margin: 7px 0 0 4%;
	padding: 7px;
	border: 0;
	border-radius: 0;
	font-family: inherit;
	font-size: 1.3em;
	line-height: normal;
	text-align: center;
	text-decoration: none !important;
	color: #fff;
	cursor: pointer;
}
.ml-sim .ml-sim__btn:last-child {
	margin-bottom: 15px;
}
.ml-sim .ml-sim__btn--viajar   { background-color: #00a09c; }
.ml-sim .ml-sim__btn--proximos { background-color: #3382d9; }

.ml-sim .ml-sim__btn:hover {
	background-color: #fff !important;
	color: #202979 !important;
}
.ml-sim .ml-sim__btn:focus-visible {
	outline: 3px solid #fff;
	outline-offset: 2px;
}

/* Dropdown de estações (renderizado no <body> pelo Select2) */
.ml-sim-estado {
	display: inline-block;
	width: 25px;
	height: 25px;
	margin-left: 10px;
	border-radius: 50%;
}

/* Módulo Divi que contém o shortcode (precisa do CSS ID "simulador_hp") */
#simulador_hp .et_pb_text_inner {
	background-color: #202979;
	width: 85%;
	padding: 0;
}
#simulador_hp {
	margin-right: 0;
}

/* ==========================================================================
   2. Select2 / datepicker (globais, como no original)
   ========================================================================== */

/* Só nos campos (dentro de div). NÃO aplicar ao invólucro do dropdown, que o Select2
   cria diretamente no <body> com largura em px: forçá-lo a 100% fazia o dropdown
   ficar com a largura da página a partir do campo e gerava scroll horizontal. */
div .select2-container {
	width: 100% !important;
}

.select2-container--default .select2-selection--single {
	text-align: left;
	color: #3e8ede;
	border: 1px solid #fff;
	padding: 6px;
	height: 37px;
	font-size: 1.2em;
	position: relative;
	border-radius: 0;
}
.select2-container--default .select2-selection--single .select2-selection__placeholder {
	color: #3e8ede;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
	color: #fff;
	font-size: 1.3em;
	padding: 4px 12px;
	height: 27px;
	position: absolute;
	top: 0;
	right: 0;
	width: 20px;
}
.select2-container--default .select2-selection--single .select2-selection__arrow b {
	display: none;
}

/* Dropdown do Select2 (vive no <body>): nunca maior que o ecrã, sem scroll horizontal */
.select2-container--open .select2-dropdown {
	max-width: calc(100vw - 16px);
	box-sizing: border-box;
}
.select2-container--open .select2-results__options {
	overflow-x: hidden;
}
.select2-container--open .select2-results__option {
	overflow-wrap: anywhere;
}

#ui-datepicker-div {
	display: none;
}

/* Setas desenhadas com a fonte de ícones do tema (ETmodules) */
.arrow_carrot-down:after,
.arrow_carrot-down1:after {
	font-family: "ETmodules";
	content: "\33" !important;
}

/* ==========================================================================
   3. Legado (mantido por precaução; ver README)
   ========================================================================== */

.linkbranco a { color: #fff !important; }
.linkbranco a:hover { color: #0f6dbf !important; }

.sim-topo {
	position: absolute;
	top: 1rem;
	left: 3.6875rem;
	width: 273px;
	z-index: 999;
	height: 200px;
}
.tab_viagem1 {
	background-color: #eee;
	border: 1px solid #ccc;
	padding-left: 10px;
	padding-right: 10px;
	width: 250px;
	margin-top: 14px;
}
.spc_tds_viagem1 { padding-bottom: 15px; }
.btn_link {
	background-color: #eee;
	border: 1px solid #ccc;
	padding-left: 2px;
	padding-right: 2px;
	height: 40px;
	text-align: center;
}
.elimina_estilo,
.btn_link a {
	text-decoration: none !important;
	color: #5f5f5f;
}
.btn_link a:hover { text-decoration: none !important; }
#content .entry a,
#content .entry a:hover { text-decoration: none !important; }

/* Checkbox personalizado */
.contentor {
	display: block;
	position: relative;
	padding-left: 35px;
	margin-bottom: 12px;
	cursor: pointer;
	font-size: 1.2222222222222223rem;
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	user-select: none;
}
.contentor input { position: absolute; opacity: 0; }
.checkmark {
	position: absolute;
	top: 0;
	left: 0;
	height: 25px;
	width: 25px;
	background-color: #eee;
}
.contentor:hover input ~ .checkmark { background-color: #ccc; }
.contentor input:checked ~ .checkmark { background-color: #2196f3; }
.checkmark:after { content: ""; position: absolute; display: none; }
.contentor input:checked ~ .checkmark:after { display: block; }
.contentor .checkmark:after {
	left: 9px;
	top: 5px;
	width: 5px;
	height: 10px;
	border: solid #fff;
	border-width: 0 3px 3px 0;
	-webkit-transform: rotate(45deg);
	-ms-transform: rotate(45deg);
	transform: rotate(45deg);
}