/**
 * PSB-PORTAL-SHELL-COLUMNAS-001 — shell 3 columnas: nav izquierda | centro | operativa derecha.
 */

body.psb-pres-portal-shell .psb-pres-panel__grid--shell3 {
	display: grid;
	grid-template-columns: minmax(200px, 236px) minmax(0, 1fr) minmax(248px, 300px);
	gap: 0;
	column-gap: 0;
	row-gap: 0;
	align-items: start;
}

body.psb-pres-portal-shell .psb-pres-panel__grid--shell3.psb-pres-panel__grid--no-aside,
body.psb-pres-portal-shell .psb-pres-panel__grid--shell3.psb-pres-panel__grid--visual-inner {
	grid-template-columns: minmax(200px, 236px) minmax(0, 1fr);
}

body.psb-pres-portal-shell .psb-pres-panel__grid--shell3 > .psb-pres-panel__nav,
body.psb-pres-portal-shell .psb-pres-panel__grid--shell3 > .psb-pres-rail-d1d {
	grid-column: 1;
	align-self: start;
	position: sticky;
	top: 20px;
	border-left: 0;
	border-right: 1px solid #e7e5e4;
	padding-left: 0;
	padding-right: 0;
	margin-top: 0;
	padding-top: 0;
}

body.psb-pres-portal-shell .psb-pres-panel__grid--shell3 > .psb-pres-panel__main {
	grid-column: 2;
	min-width: 0;
}

body.psb-pres-portal-shell .psb-pres-panel__grid--shell3 > .psb-pres-panel__aside {
	grid-column: 3;
	align-self: start;
	position: sticky;
	top: 20px;
	min-width: 0;
}

body.psb-pres-portal-shell .psb-pres-panel__grid--shell3 .psb-pres-cfg-mother__workrow,
body.psb-pres-portal-shell .psb-pres-panel__grid--shell3 .psb-pres-cfg-2026__workrow,
body.psb-pres-portal-shell .psb-pres-panel__grid--shell3 .psb-pres-config-workrow {
	display: block;
	grid-template-columns: 1fr;
}

body.psb-pres-portal-shell .psb-pres-panel__grid--shell3 .psb-pres-panel__aside .psb-pres-col-operativa {
	width: 100%;
}

/* Móvil: formulario → precio/acciones → navegación */
@media (max-width: 767px) {
	body.psb-pres-portal-shell .psb-pres-panel__grid--shell3 {
		display: flex;
		flex-direction: column;
		gap: 20px;
		width: 100%;
		max-width: 100%;
	}

	body.psb-pres-portal-shell .psb-pres-panel__grid--shell3 > .psb-pres-panel__main {
		order: 1;
		width: 100%;
		max-width: 100%;
	}

	body.psb-pres-portal-shell .psb-pres-panel__grid--shell3 > .psb-pres-panel__aside {
		order: 2;
		position: static;
		top: auto;
		width: 100%;
		max-width: 100%;
	}

	body.psb-pres-portal-shell .psb-pres-panel__grid--shell3 > .psb-pres-panel__nav,
	body.psb-pres-portal-shell .psb-pres-panel__grid--shell3 > .psb-pres-rail-d1d {
		order: 3;
		position: static;
		top: auto;
		width: 100%;
		max-width: 100%;
		border-right: 0;
		padding-right: 0;
		border-top: 1px solid #e7e5e4;
		padding-top: 0;
	}

	body.psb-pres-portal-shell .psb-pres-panel__grid--shell3.psb-pres-panel__grid--visual-inner .psb-config-visual-shell__layout {
		display: flex;
		flex-direction: column;
		gap: 1rem;
	}

	body.psb-pres-portal-shell .psb-pres-panel__grid--shell3.psb-pres-panel__grid--visual-inner .psb-config-visual-shell__config-zone {
		order: 1;
	}

	body.psb-pres-portal-shell .psb-pres-panel__grid--shell3.psb-pres-panel__grid--visual-inner .psb-config-visual-shell__price-zone {
		order: 2;
	}
}

/* Tablet: 3 columnas si cabe; si no, apilar operativa debajo del centro */
@media (min-width: 768px) and (max-width: 1023px) {
	body.psb-pres-portal-shell .psb-pres-panel__grid--shell3:not(.psb-pres-panel__grid--no-aside):not(.psb-pres-panel__grid--visual-inner) {
		grid-template-columns: minmax(168px, 200px) minmax(0, 1fr);
	}

	body.psb-pres-portal-shell .psb-pres-panel__grid--shell3:not(.psb-pres-panel__grid--no-aside):not(.psb-pres-panel__grid--visual-inner) > .psb-pres-panel__aside {
		grid-column: 1 / -1;
		position: static;
		top: auto;
		max-width: min(420px, 100%);
	}

	body.psb-pres-portal-shell .psb-pres-panel__grid--shell3.psb-pres-panel__grid--no-aside,
	body.psb-pres-portal-shell .psb-pres-panel__grid--shell3.psb-pres-panel__grid--visual-inner {
		grid-template-columns: minmax(168px, 200px) minmax(0, 1fr);
		gap: 0;
		column-gap: 0;
	}
}

@media (min-width: 1024px) {
	body.psb-pres-portal-shell .psb-pres-panel__grid--shell3:not(.psb-pres-panel__grid--no-aside):not(.psb-pres-panel__grid--visual-inner) {
		grid-template-columns: minmax(200px, 236px) minmax(0, 1fr) minmax(248px, 300px);
	}
}
