/*
 * Estilos de la ficha de producto (oxea-storefront). Definimos el layout de
 * dos columnas nosotros mismos (.oxea-product-columns) en vez de depender
 * del grid del tema -- ver SingleProductTemplate::open_columns()/
 * close_columns(): la galería y el `.summary.entry-summary` de WooCommerce
 * quedan anidados adentro de estas columnas, así que el CSS del tema que
 * apuntaba a esos elementos como hijos directos del contenedor del producto
 * ya no aplica igual (de ahí el ancho de galería forzado más abajo).
 * Los colores salen de las custom properties que ya define el tema vía
 * Customizer; si no están seteadas, caen a los valores de respaldo.
 */

.oxea-product-columns {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	gap: 3em;
}

.oxea-product-col-left {
	flex: 1 1 58%;
	min-width: 280px;
}

.oxea-product-col-right {
	flex: 1 1 32%;
	min-width: 280px;
}

/* Blocksy trae su propio `.woocommerce-product-gallery { width: 50% }` /
 * `.summary.entry-summary { width: 50% }`, pensado para cuando esos dos eran
 * hermanos directos del contenedor del producto (un layout de 2 columnas al
 * 50% armado por el propio tema). Como ahora quedaron anidados un nivel más
 * adentro de nuestras columnas, esa regla se les sigue aplicando igual mismo
 * sobre el ancho de su nuevo padre -- terminan ocupando la mitad de la mitad.
 * `!important` acá es intencional: es la forma más simple de ganarle a esa
 * regla del tema sin tener que igualar/adivinar su especificidad exacta. */
.oxea-product-col-left .woocommerce-product-gallery,
.oxea-product-col-left .woocommerce-product-gallery__wrapper {
	width: 100% !important;
}

.oxea-product-col-right .summary.entry-summary {
	width: 100% !important;
	max-width: 100% !important;
}

.oxea-product-col-left .woocommerce-product-gallery img {
	width: 100%;
	max-width: 100%;
	height: auto;
}

/* Corrección (2026-08-05): el borde va SOLO alrededor de la imagen
 * seleccionada (`.flexy-view`, el slide "boxed" de Blocksy) -- la primera
 * versión lo había puesto en `.woocommerce-product-gallery`, envolviendo
 * de más también a las miniaturas, y el ejemplo de referencia no las incluye
 * dentro de esa caja. Las miniaturas quedan sueltas al costado, sin card
 * propia. */
.oxea-product-col-left .flexy-view {
	border: 1px solid #e4e4e4;
	border-radius: 10px;
	overflow: hidden;
	background: #fff;
}

.oxea-product-col-left .woocommerce-product-gallery__image,
.oxea-product-col-left .woocommerce-product-gallery__image img {
	border-radius: 6px;
	overflow: hidden;
}

/* Refinamiento de miniaturas (2026-08-05): el tema (Blocksy) reemplaza el
 * contenido de `.woocommerce-product-gallery` por su propio slider
 * `.ct-product-gallery-container` / `.flexy-*` -- no son clases de
 * WooCommerce, confirmadas pegando el HTML real renderizado. `.flexy-pills`
 * son las miniaturas (siempre <li> cuadrados, `data-type="thumbs"`).
 * Scoped a `.oxea-product-col-left` para no afectar otros usos de `.flexy-*`
 * que Blocksy pueda tener en otras partes del sitio (ej. carruseles de
 * categoría). */
.oxea-product-col-left .onsale {
	border-radius: 999px;
	padding: 0.35em 0.9em;
	font-size: 0.8em;
	font-weight: 600;
	letter-spacing: 0.02em;
}

.oxea-product-col-left .flexy-item .ct-media-container {
	border-radius: 6px;
	overflow: hidden;
}

.oxea-product-col-left .flexy-arrow-prev,
.oxea-product-col-left .flexy-arrow-next {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 2.25em;
	height: 2.25em;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 2px 8px rgba( 0, 0, 0, 0.15 );
}

.oxea-product-col-left .flexy-pills[data-type='thumbs'] ol {
	display: flex;
	flex-direction: column;
	gap: 0.6em;
	padding: 0;
	margin: 0;
	list-style: none;
}

.oxea-product-col-left .flexy-pills[data-type='thumbs'] li {
	width: 64px;
	height: 64px;
	border-radius: 6px;
	overflow: hidden;
	border: 2px solid transparent;
	cursor: pointer;
}

.oxea-product-col-left .flexy-pills[data-type='thumbs'] li.active {
	border-color: var( --oxea-color-primary, #2e7d32 );
}

.oxea-product-col-left .flexy-pills[data-type='thumbs'] .ct-media-container,
.oxea-product-col-left .flexy-pills[data-type='thumbs'] img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.oxea-eyebrow {
	color: #767676;
	font-size: 0.9em;
	margin-bottom: 0.35em;
}

.oxea-eyebrow__sep {
	color: #c7c7c7;
}

.oxea-eyebrow__condition {
	font-weight: 500;
	font-size: 14px;
	line-height: 24px;
}

/* Título nativo de WooCommerce (`woocommerce_template_single_title()`,
 * prioridad 5) -- no lo tocamos vía hook, solo CSS. Queda anidado dentro de
 * `.summary.entry-summary`, adentro de `.oxea-product-col-right`. */
.oxea-product-col-right .product_title {
	font-weight: 500;
	font-size: 24px;
	line-height: 30px;
}

.oxea-price-box {
	padding-bottom: 1.25em;
	margin-bottom: 1.25em;
	border-bottom: 1px solid #ececec;
}

.oxea-price-old {
	display: block;
	font-size: 16px;
	line-height: 20px;
	color: #999;
	text-decoration: line-through;
	margin-bottom: 2px;
}

.oxea-price {
	font-weight: 400;
	font-size: 34px;
	line-height: 38px;
}

.oxea-financing-box {
	margin-top: 1em;
	font-size: 0.95em;
}

.oxea-financing-box strong {
	display: flex;
	align-items: center;
	gap: 0.5em;
	margin-bottom: 0.5em;
}

.oxea-financing-box strong svg {
	flex: 0 0 auto;
	width: 1.1em;
	height: 1.1em;
	fill: currentColor;
}

.oxea-financing-box ul {
	list-style: none;
	margin: 0;
	padding: 0;
	color: var( --oxea-color-success, #1e7e34 );
}

.oxea-financing-box li {
	padding: 0.15em 0;
}

.oxea-cta-buttons {
	display: flex;
	gap: 0.75em;
	padding-bottom: 1.25em;
	margin-bottom: 1.25em;
	border-bottom: 1px solid #ececec;
}

.oxea-btn {
	display: inline-block;
	padding: 0.85em 1.75em;
	border-radius: 4px;
	text-decoration: none;
	font-weight: 600;
	text-align: center;
}

.oxea-btn-consultar {
	background: var( --oxea-color-primary, #2e7d32 );
	color: #fff;
}

.oxea-btn-whatsapp {
	background: var( --oxea-color-secondary, #e8f5e9 );
	color: var( --oxea-color-primary, #2e7d32 );
}

.oxea-location {
	display: flex;
	align-items: center;
	gap: 0.4em;
	color: #666;
	padding-bottom: 1.25em;
	margin-bottom: 1.25em;
	border-bottom: 1px solid #ececec;
}

.oxea-location svg {
	flex: 0 0 auto;
	width: 1em;
	height: 1em;
	fill: currentColor;
}

.oxea-seller-box {
	border: none;
	padding: 0;
}

.oxea-seller-box > strong {
	display: block;
	margin-bottom: 0.75em;
	font-weight: 600;
	font-size: 16px !important;
	line-height: 22px;
	color: #1e1e1e;
}

/* Card del vendedor: mismo diseño que las cards de sucursales de Home
 * (home-featured-vendors.css), ajustado al ancho de la columna derecha. */
.oxea-seller-box .oxea-seller-card {
	display: flex;
	flex-direction: column;
	gap: 16px;
	width: 100%;
	max-width: 300px;
	padding: 0 0 14px;
	box-sizing: border-box;
	background: #fff;
	border: 1px solid #ececec;
	border-radius: 14px;
	box-shadow: 0 2px 8px rgba( 0, 0, 0, 0.06 );
}

.oxea-seller-box .oxea-seller-card__media {
	display: block;
	height: 160px;
	margin: 10px 10px 0;
	background: #fff;
	border-radius: 10px;
	overflow: hidden;
}

.oxea-seller-box .oxea-seller-card__media img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: 100%;
	object-fit: contain;
	object-position: center;
}

.oxea-seller-box .oxea-seller-card__name {
	display: block;
	padding: 0 14px;
	font-size: 13px;
	font-weight: 700;
	line-height: 1.3;
	color: #222;
	overflow-wrap: anywhere;
}

/* Sin logo la card arranca en el nombre: mismo aire de arriba que de abajo. */
.oxea-seller-box .oxea-seller-card > .oxea-seller-card__name:first-child {
	margin-top: 14px;
}

.oxea-seller-box .oxea-seller-card__button {
	align-self: flex-start;
	margin: 0 0 0 14px;
	padding: 7px 14px;
	border-radius: 999px;
	background: var( --oxea-color-primary, #2e7d32 );
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	line-height: 1.2;
	text-decoration: none;
	transition: filter 0.15s ease;
}

.oxea-seller-box .oxea-seller-card__button:hover,
.oxea-seller-box .oxea-seller-card__button:focus {
	color: #fff;
	filter: brightness( 0.9 );
}

.oxea-seller-box .oxea-seller-card__button:focus-visible {
	outline: 3px solid var( --oxea-color-primary, #2e7d32 );
	outline-offset: 2px;
}

.oxea-publication-meta {
	margin-top: 1em;
	padding-top: 1em;
	border-top: 1px solid #ececec;
	font-size: 0.85em;
	color: #888;
}

.oxea-publication-meta div + div {
	margin-top: 0.25em;
}

.oxea-product-details {
	margin-top: 2.5em;
}

.oxea-attributes-table {
	margin-bottom: 2.5em;
}

.oxea-attributes-table h2 {
	margin-bottom: 0.75em;
	font-weight: 600;
	font-size: 16px !important;
	line-height: 22px;
	color: #1e1e1e;
}

.oxea-attributes-table table {
	width: 100%;
	border-collapse: separate;
	border-spacing: 0;
	border-radius: 6px;
	overflow: hidden;
}

.oxea-attributes-table th,
.oxea-attributes-table td {
	text-align: left;
	padding: 0.9em 1.25em;
	border: none;
	font-weight: 400;
}

.oxea-attributes-table th {
	width: 35%;
	color: #888;
	font-weight: 500;
}

.oxea-attributes-table tr:nth-child(odd) {
	background: #f4f5f6;
}

.oxea-product-description {
	margin-bottom: 2.5em;
}

.oxea-product-description h2 {
	margin-bottom: 0.5em;
	font-weight: 600;
	font-size: 16px !important;
	line-height: 22px;
	color: #1e1e1e;
}

.oxea-inquiry-modal {
	position: fixed;
	inset: 0;
	z-index: 1000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1.5em;
}

.oxea-inquiry-modal[hidden] {
	display: none;
}

.oxea-inquiry-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba( 0, 0, 0, 0.55 );
}

.oxea-inquiry-modal__dialog {
	position: relative;
	width: 100%;
	max-width: 560px;
	max-height: 90vh;
	overflow-y: auto;
	background: #fff;
	border-radius: 8px;
	box-shadow: 0 10px 40px rgba( 0, 0, 0, 0.25 );
}

.oxea-inquiry-modal__close {
	position: absolute;
	top: 0.75em;
	right: 0.75em;
	width: 2em;
	height: 2em;
	line-height: 1;
	font-size: 1.5em;
	background: transparent;
	border: none;
	cursor: pointer;
	color: #666;
}

body.oxea-modal-open {
	overflow: hidden;
}

.oxea-video-button {
	display: inline-flex;
	align-items: center;
	gap: 0.4em;
	margin: 0.75em 0;
	padding: 0.5em 1em;
	border-radius: 4px;
	background: rgba( 0, 0, 0, 0.65 );
	color: #fff;
	text-decoration: none;
	font-weight: 600;
	font-size: 0.9em;
}

.oxea-video-button svg {
	width: 1.1em;
	height: 1.1em;
	fill: currentColor;
}

.oxea-video-modal .oxea-inquiry-modal__dialog {
	max-width: 900px;
	background: #000;
}

.oxea-video-modal .oxea-inquiry-modal__close {
	color: #fff;
	/* El marco del video (position: relative) viene después en el DOM y tapaba la cruz. */
	z-index: 2;
}

.oxea-video-modal__frame {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
}

.oxea-video-modal__frame iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

.oxea-inquiry-form {
	padding: 1.5em;
}

.oxea-inquiry-form h2 {
	margin-top: 0;
	margin-bottom: 1em;
	font-size: 1.4em;
}

.oxea-inquiry-form__form {
	display: flex;
	flex-direction: column;
	gap: 1em;
}

.oxea-inquiry-form label {
	display: flex;
	flex-direction: column;
	gap: 0.4em;
	font-weight: 600;
	font-size: 0.9em;
}

.oxea-inquiry-form input,
.oxea-inquiry-form textarea {
	font-weight: 400;
	font-size: 1em;
	padding: 0.65em 0.85em;
	border: 1px solid #d0d3d6;
	border-radius: 4px;
	font-family: inherit;
}

.oxea-inquiry-form__row {
	display: flex;
	gap: 1em;
	flex-wrap: wrap;
}

.oxea-inquiry-form__row label {
	flex: 1;
	min-width: 200px;
}

.oxea-inquiry-form button[type='submit'] {
	align-self: flex-start;
	border: none;
	cursor: pointer;
}

.oxea-inquiry-form button[type='submit']:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

/* Campo trampa: fuera de pantalla, no `display: none` (ver InquiryModals::render_honeypot()). */
.oxea-inquiry-form .oxea-inquiry-form__trap {
	position: absolute;
	left: -10000px;
	top: auto;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.oxea-inquiry-form__status {
	margin: 0;
	font-size: 0.9em;
}

.oxea-inquiry-form__status.is-success {
	color: var( --oxea-color-success, #1e7e34 );
}

.oxea-inquiry-form__status.is-error {
	color: #c0392b;
}

/*
 * Móvil (ficha con las dos columnas propias): una sola columna con el orden
 * pedido -- breadcrumb (lo pone el tema), galería, estado + título + precio,
 * financiación + contacto + ubicación, card del vendedor, detalles técnicos /
 * características / descripción y, al final, número de publicación y
 * actualización. El HTML no cambia: las columnas y los wrappers pasan a
 * `display: contents` para que sus hijos se ordenen con `order` en una sola
 * columna flex. Escritorio queda como arriba.
 *
 * Los `:where()` dan el orden por defecto con especificidad cero, para que
 * las reglas puntuales de cada pieza lo pisen sin pelear especificidad.
 */
@media (max-width: 767px) {
	.oxea-product-columns {
		flex-direction: column;
		flex-wrap: nowrap;
		align-items: stretch;
		gap: 0;
		max-width: 100%;
	}

	.oxea-product-columns .oxea-product-col-left,
	.oxea-product-columns .oxea-product-col-right,
	.oxea-product-columns .summary.entry-summary,
	.oxea-product-columns .entry-summary-items,
	.oxea-product-columns .oxea-product-summary,
	.oxea-product-columns .oxea-price-box,
	.oxea-product-columns .oxea-seller-box {
		display: contents;
	}

	:where( .oxea-product-columns .oxea-product-col-left ) > * {
		order: 1;
		min-width: 0;
	}

	:where( .oxea-product-columns .summary.entry-summary, .oxea-product-columns .entry-summary-items ) > * {
		order: 3;
		min-width: 0;
	}

	.oxea-product-columns .oxea-eyebrow {
		order: 2;
		margin: 0 0 0.25em;
	}

	.oxea-product-columns .product_title {
		order: 3;
		margin: 0 0 0.35em;
	}

	.oxea-product-columns .oxea-price-old,
	.oxea-product-columns .oxea-price {
		order: 4;
		min-width: 0;
	}

	.oxea-product-columns .oxea-price {
		margin: 0 0 14px;
	}

	.oxea-product-col-left .woocommerce-product-gallery {
		margin-bottom: 1em;
	}

	/* Miniaturas en una fila horizontal que se desliza si no entran. */
	.oxea-product-col-left .flexy-pills[data-type='thumbs'] {
		width: 100%;
		max-width: 100%;
	}

	.oxea-product-col-left .flexy-pills[data-type='thumbs'] ol {
		flex-direction: row;
		flex-wrap: nowrap;
		overflow-x: auto;
		padding-bottom: 4px;
	}

	.oxea-product-col-left .flexy-pills[data-type='thumbs'] li {
		flex: 0 0 64px;
	}

	/* El divisor que antes cerraba la caja de precio ahora cierra la financiación. */
	.oxea-product-columns .oxea-financing-box,
	.oxea-product-columns .oxea-cta-buttons,
	.oxea-product-columns .oxea-location {
		order: 5;
		min-width: 0;
	}

	.oxea-product-columns .oxea-financing-box {
		margin: 0 0 1em;
		padding-bottom: 1em;
		border-bottom: 1px solid #ececec;
	}

	.oxea-product-columns .oxea-seller-box > strong,
	.oxea-product-columns .oxea-seller-card {
		order: 6;
	}

	.oxea-product-columns .oxea-seller-card {
		max-width: none;
		margin-bottom: 1em;
	}

	.oxea-product-columns .oxea-product-details {
		order: 7;
		min-width: 0;
		margin-top: 1em;
		overflow-wrap: anywhere;
	}

	.oxea-product-columns .oxea-attributes-table,
	.oxea-product-columns .oxea-product-description {
		margin-bottom: 1.5em;
	}

	.oxea-product-columns .oxea-attributes-table th,
	.oxea-product-columns .oxea-attributes-table td {
		padding: 0.7em 0.9em;
	}

	.oxea-product-columns .oxea-attributes-table th {
		width: 42%;
	}

	.oxea-product-columns .oxea-publication-meta {
		order: 8;
		margin-top: 0.5em;
	}
}
