/**
 * Layout ficha de tour: galería + reserva + descripción.
 *
 * Recomendado: un solo shortcode [tb_tour_product] (ver class-tour-product-page.php).
 *
 * Layout manual Elementor (legacy) — clases CSS en Avanzado → Clases CSS:
 *   tb-tour-hero-row    → contenedor padre (galería + reserva + detalles)
 *   tb-tour-gallery-col → galería [custom_product_gallery_grid]
 *   tb-tour-booking-col → columna derecha con [tb_booking_sidebar]
 *   tb-tour-details     → pestañas / descripción (debajo de la galería); el sticky del formulario para aquí.
 *
 * Desktop: sticky del formulario vía plugin (no uses Motion Effects → Sticky en Elementor).
 */

.custom-gallery-wrapper {
	width: 100%;
	min-width: 0;
}

.custom-gallery-wrapper .custom-gallery-grid {
	min-width: 0;
}

@media (min-width: 769px) {
	.e-con.tb-tour-hero-row,
	.tb-tour-hero-row,
	.tb-tour-product .tb-tour-hero-row {
		flex-wrap: wrap !important;
		align-items: flex-start !important;
		width: 100% !important;
		display: grid !important;
		grid-template-columns: minmax(0, 65%) minmax(280px, 32%);
		grid-template-rows: auto auto;
		column-gap: 3%;
		row-gap: 28px;
		align-items: start;
		overflow: visible !important;
	}

	.e-con.tb-tour-hero-row > .e-con.tb-tour-gallery-col,
	.e-con.tb-tour-hero-row > .e-con-child.tb-tour-gallery-col,
	.tb-tour-hero-row > .tb-tour-gallery-col,
	.tb-tour-product .tb-tour-hero-row > .tb-tour-gallery-col {
		flex: unset !important;
		grid-column: 1;
		grid-row: 1;
		width: 100% !important;
		max-width: 100% !important;
		min-width: 0 !important;
	}

	.e-con.tb-tour-hero-row > .e-con.tb-tour-booking-col,
	.e-con.tb-tour-hero-row > .e-con-child.tb-tour-booking-col,
	.tb-tour-hero-row > .tb-tour-booking-col,
	.tb-tour-product .tb-tour-hero-row > .tb-tour-booking-col {
		flex: unset !important;
		grid-column: 2;
		grid-row: 1 / -1;
		width: 100% !important;
		max-width: 100% !important;
		min-width: 280px !important;
		align-self: start;
		height: max-content;
		max-height: none;
		overflow: visible !important;
		/* Evita que el alto del formulario define la fila 1 (galería) y empuje los detalles. */
		min-height: 0;
	}

	.e-con.tb-tour-hero-row > .e-con.tb-tour-details,
	.e-con.tb-tour-hero-row > .e-con-child.tb-tour-details,
	.tb-tour-hero-row > .tb-tour-details,
	.tb-tour-product .tb-tour-hero-row > .tb-tour-details {
		flex: unset !important;
		grid-column: 1;
		grid-row: 2;
		width: 100% !important;
		max-width: 100% !important;
		order: unset !important;
	}

	.e-con.tb-tour-booking-col,
	.tb-tour-booking-col,
	.tb-booking-sticky-col {
		position: relative;
		overflow: visible !important;
	}

	.tb-tour-booking-col .tb-booking-wrap,
	.tb-tour-booking-col .tb-booking-sidebar {
		margin-left: auto;
		margin-right: 0;
	}
}

@media (max-width: 768px) {
	.e-con.tb-tour-hero-row > .e-con.tb-tour-gallery-col,
	.e-con.tb-tour-hero-row > .e-con.tb-tour-booking-col,
	.e-con.tb-tour-hero-row > .e-con.tb-tour-details,
	.tb-tour-hero-row > .tb-tour-gallery-col,
	.tb-tour-hero-row > .tb-tour-booking-col,
	.tb-tour-hero-row > .tb-tour-details,
	.tb-tour-product .tb-tour-hero-row > .tb-tour-gallery-col,
	.tb-tour-product .tb-tour-hero-row > .tb-tour-booking-col,
	.tb-tour-product .tb-tour-hero-row > .tb-tour-details {
		flex: 0 0 100% !important;
		width: 100% !important;
		max-width: 100% !important;
		min-width: 0 !important;
	}

	.tb-tour-booking-col .tb-booking-wrap,
	.tb-tour-booking-col .tb-booking-sidebar {
		margin-left: 0;
		margin-right: 0;
		max-width: 100%;
	}
}
