/*
 * Carrito lateral propio (sustituto de side-cart-woocommerce).
 * Mismos colores y tipografías que el resto de la venta (Clash Display / Satoshi).
 * Los !important son por el tema y Elementor, que estilan botones y enlaces por su cuenta.
 */

body.opo180-cart-open {
	overflow: hidden;
}

/* --- disparador (cabecera) ---------------------------------------------- */

.opo180-cart-trigger {
	display: inline-flex;
	line-height: 0;
}

/* En la cabecera el widget de shortcode de Elementor se pega arriba de su columna, que mide
   lo que el botón "Área del Opositor" de al lado: el icono quedaba unos píxeles por encima.
   Se centra la línea del contenedor en vertical sin depender de tocar la columna en Elementor. */
.elementor-widget-wrap:has(> .elementor-widget-shortcode .opo180-cart-trigger) {
	align-content: center !important;
	align-items: center !important;
}

.elementor-widget-shortcode .elementor-shortcode:has(> .opo180-cart-trigger) {
	display: flex;
	justify-content: center;
	line-height: 0;
}

.opo180-cart-trigger .opo180-cart-trigger__button {
	align-items: center;
	background: none !important;
	border: 0 !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	/* La cabecera es roja: el icono va en blanco por defecto. Sin !important para que el
	   tema pueda recolocarlo si algún día el disparador vive sobre fondo claro. */
	color: #fff;
	cursor: pointer !important;
	display: inline-flex !important;
	justify-content: center;
	line-height: 0 !important;
	min-height: 0 !important;
	padding: 4px !important;
	position: relative;
}

.opo180-cart-trigger .opo180-cart-trigger__button:hover {
	opacity: 0.8;
}

.opo180-cart-trigger__count {
	align-items: center;
	background: #edb926;
	border-radius: 999px;
	color: #2d2d2d;
	display: flex;
	font-family: "Satoshi", Sans-serif;
	font-size: 11px;
	font-weight: 700;
	height: 18px;
	justify-content: center;
	line-height: 1;
	min-width: 18px;
	padding: 0 5px;
	position: absolute;
	right: -4px;
	top: -2px;
}

/* --- botón flotante (esquina inferior derecha) --------------------------- */

/* Lo que tenía el plugin anterior y el cliente quiere conservar. Va justo encima del botón de
   WhatsApp (joinchat): mismo margen lateral y mismo tamaño, 60px, con 16px de aire entre los
   dos. Si se cambia el tamaño o el margen de joinchat en sus ajustes, hay que tocarlo aquí. */
.opo180-cart-float {
	bottom: calc(18px + 80px + 16px);
	line-height: 0;
	position: fixed;
	right: 27px;
	z-index: 8999;
}

.opo180-cart-float .opo180-cart-float__button {
	align-items: center;
	background: #fff !important;
	border: 0 !important;
	border-radius: 999px !important;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18) !important;
	color: #c1301d !important;
	cursor: pointer !important;
	display: inline-flex !important;
	height: 60px;
	justify-content: center;
	line-height: 0 !important;
	min-height: 0 !important;
	padding: 0 !important;
	position: relative;
	transition: transform 0.2s ease;
	width: 60px;
}

.opo180-cart-float .opo180-cart-float__button:hover {
	transform: scale(1.06);
}

.opo180-cart-float .opo180-cart-trigger__count {
	right: auto;
	left: -4px;
	top: -4px;
	height: 22px;
	min-width: 22px;
	font-size: 12px;
}

/* joinchat baja su margen a 6px en móvil. */
@media (max-width: 480px), (orientation: landscape) and (max-height: 480px) {
	.opo180-cart-float {
		bottom: calc(6px + 60px + 12px);
		right: 6px;
	}
}

/* --- panel ---------------------------------------------------------------- */

.opo180-cart {
	inset: 0 !important;
	position: fixed !important;
	transform: none !important;
	z-index: 10000;
}

.opo180-cart[hidden] {
	display: none;
}

.opo180-cart *,
.opo180-cart *::before,
.opo180-cart *::after {
	box-sizing: border-box;
}

.opo180-cart__overlay {
	background: rgba(20, 15, 12, 0.55);
	inset: 0;
	opacity: 0;
	position: absolute;
	transition: opacity 0.25s ease;
}

/* Dos clases + !important: algo del tema centra los [role="dialog"] con top/left al 50% y
   un translate, y el panel salía descolocado. */
.opo180-cart .opo180-cart__panel {
	background: #fff;
	/* Cuatro longhands en vez del atajo `inset`: el atajo reescribiría las que van antes
	   por orden alfabético y el panel se quedaba sin `bottom`, a media altura. */
	bottom: 0 !important;
	display: flex;
	flex-direction: column;
	left: auto !important;
	max-width: 100%;
	position: absolute !important;
	right: 0 !important;
	top: 0 !important;
	transform: translateX(100%);
	transition: transform 0.25s ease;
	width: 420px;
}

/* La barra del admin es fija y tapaba el título del cajón. La ven todos los usuarios con
   sesión iniciada, no solo el administrador, así que el panel arranca por debajo. */
body.admin-bar .opo180-cart .opo180-cart__panel {
	top: 32px !important;
}

@media screen and (max-width: 782px) {
	body.admin-bar .opo180-cart .opo180-cart__panel {
		top: 46px !important;
	}
}

.opo180-cart.is-open .opo180-cart__overlay {
	opacity: 1;
}

.opo180-cart.is-open .opo180-cart__panel {
	transform: translateX(0);
}

@media (prefers-reduced-motion: reduce) {
	.opo180-cart__overlay,
	.opo180-cart .opo180-cart__panel {
		transition: none;
	}
}

.opo180-cart__head {
	align-items: center;
	display: flex;
	gap: 16px;
	justify-content: space-between;
	padding: 28px 28px 18px;
}

.opo180-cart__title {
	color: #2d2d2d;
	font-family: "ClashDisplay", Sans-serif;
	font-size: 26px;
	font-weight: 500;
	line-height: 1.2;
	margin: 0;
}

.opo180-cart .opo180-cart__close {
	align-items: center;
	background: none !important;
	border: 0 !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	color: #2d2d2d !important;
	cursor: pointer !important;
	display: inline-flex !important;
	flex-shrink: 0;
	line-height: 0 !important;
	min-height: 0 !important;
	padding: 4px !important;
}

.opo180-cart .opo180-cart__close:hover {
	color: #c1301d !important;
}

/* El cuerpo se repinta entero (fragmentos / AJAX), así que se estira él solo: las líneas
   hacen scroll y el pie se queda abajo aunque haya una sola línea. */
.opo180-cart__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	min-height: 0;
}

.opo180-cart__lines {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 12px;
	overflow-y: auto;
	padding: 0 28px 20px;
}

.opo180-cart__empty {
	color: #6b6b6b;
	font-family: "Satoshi", Sans-serif;
	font-size: 15px;
	margin: 0;
}

.opo180-cart__line {
	align-items: flex-start;
	background: #fef8e7;
	border-radius: 12px;
	display: flex;
	gap: 14px;
	padding: 16px 18px;
}

.opo180-cart__line-text {
	flex: 1;
	min-width: 0;
}

.opo180-cart__line-name {
	color: #2d2d2d;
	font-family: "Satoshi", Sans-serif;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.35;
	margin: 0;
	overflow-wrap: break-word;
}

.opo180-cart__line-detail {
	color: #6b6b6b;
	font-family: "Satoshi", Sans-serif;
	font-size: 13px;
	line-height: 1.45;
	margin: 6px 0 0;
	overflow-wrap: break-word;
}

.opo180-cart .opo180-cart__remove {
	align-items: center;
	background: #fff !important;
	border: 1px solid #e0d3b6 !important;
	border-radius: 8px !important;
	box-shadow: none !important;
	color: #2d2d2d !important;
	cursor: pointer !important;
	display: inline-flex !important;
	flex-shrink: 0;
	height: 26px !important;
	justify-content: center;
	line-height: 0 !important;
	min-height: 0 !important;
	padding: 0 !important;
	width: 26px !important;
}

.opo180-cart .opo180-cart__remove:hover:not(:disabled) {
	border-color: #c1301d !important;
	color: #c1301d !important;
}

.opo180-cart .opo180-cart__remove:disabled {
	cursor: default !important;
	opacity: 0.5;
}

/* --- totales y botones ---------------------------------------------------- */

.opo180-cart__foot {
	border-top: 1px solid #ecdfc4;
	margin-top: auto;
	padding: 18px 28px 28px;
}

/* Con el carrito vacío no hay nada que separar y la línea quedaba suelta en medio. */
.opo180-cart__lines--empty + .opo180-cart__foot {
	border-top: 0;
}

.opo180-cart__totals {
	font-family: "Satoshi", Sans-serif;
}

.opo180-cart__total-row {
	color: #2d2d2d;
	display: flex;
	font-size: 15px;
	justify-content: space-between;
	padding: 7px 0;
}

.opo180-cart__total-row--final {
	font-weight: 700;
}

.opo180-cart__total-row--final span:last-child {
	color: #c1301d;
	font-size: 18px;
}

.opo180-cart .opo180-cart__checkout {
	background: #edb926 !important;
	border: 0 !important;
	border-radius: 999px !important;
	color: #2d2d2d !important;
	cursor: pointer !important;
	display: block !important;
	font-family: "Satoshi", Sans-serif;
	font-size: 16px !important;
	font-weight: 700 !important;
	margin-top: 18px !important;
	padding: 18px 24px !important;
	text-align: center !important;
	text-decoration: none !important;
	width: 100% !important;
}

.opo180-cart .opo180-cart__checkout:hover {
	background: #d8a71c !important;
}

.opo180-cart .opo180-cart__continue {
	background: none !important;
	border: 0 !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	color: #6b6b6b !important;
	cursor: pointer !important;
	display: block !important;
	font-family: "Satoshi", Sans-serif;
	font-size: 14px !important;
	margin: 14px auto 0 !important;
	min-height: 0 !important;
	padding: 4px !important;
	text-decoration: underline !important;
	text-underline-offset: 4px;
	width: auto !important;
}

.opo180-cart .opo180-cart__continue:hover {
	color: #c1301d !important;
}

@media (max-width: 480px) {
	.opo180-cart .opo180-cart__panel {
		width: 100%;
	}

	.opo180-cart__head {
		padding: 20px 20px 14px;
	}

	.opo180-cart__title {
		font-size: 22px;
	}

	.opo180-cart__lines {
		padding: 0 20px 16px;
	}

	.opo180-cart__foot {
		padding: 16px 20px 22px;
	}
}
