@CHARSET "UTF-8";
/* =====================================================================
   Combinations in Catalog – Variación D ("Botón circular icónico")
   Diseño: listado-cat/README.md
   --------------------------------------------------------------------- */

.cic-card {
	--cic-brand:        #7BC9C9;
	--cic-brand-dark:   #5FAEAE;
	--cic-brand-soft:   #E8F4F4;
	--cic-accent:       #B197D8;
	--cic-text:         #3A3A3A;
	--cic-text-muted:   #8A8A8A;
	--cic-border:       #E5E5E2;
	--cic-border-soft:  #F0EFEB;
	--cic-bg:           #FFFFFF;
	--cic-bg-soft:      #FAFAF7;
	--cic-success:      #7BB97B;

	margin-top: 14px;
}

.cic-card .cic-form {
	display: flex;
	flex-direction: column;
	gap: 14px;
	margin: 0;
	padding: 0;
}

/* ---- Reset/override de estilos viejos del módulo dentro de la card ---- */
.cic-card .product-variants-item {
	margin: 0;
}
.cic-card .control-label {
	bottom: auto;
	position: static;
	display: block;
	margin: 0 0 4px 0;
	font-size: 11px;
	font-weight: 500;
	letter-spacing: 0.3px;
	color: var(--cic-text-muted);
	text-transform: uppercase;
}

/* ---- Grid de selectores (color + talla) ---- */
.cic-variants-wrapper {
	width: 100%;
}
.cic-variants-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
	width: 100%;
}
.cic-variants-grid > .cic-variant-item {
	min-width: 0;
}
.cic-variants-grid > .cic-variant-item--single,
.cic-variants-grid > .cic-variant-item:only-child {
	grid-column: 1 / -1;
}

/* ---- Select estilizado ---- */
.cic-select-wrapper {
	position: relative;
	width: 100%;
}
.cic-card .cic-select {
	display: block;
	width: 100%;
	height: auto;
	margin: 0;
	padding: 8px 26px 8px 12px;
	font-size: 12px;
	line-height: 1.2;
	color: var(--cic-text);
	background: var(--cic-bg);
	border: 1px solid var(--cic-border);
	border-radius: 8px;
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	cursor: pointer;
	box-shadow: none;
	text-align: left;
	-ms-text-align-last: left;
	-moz-text-align-last: left;
	text-align-last: left;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.cic-card .cic-select:focus {
	outline: none;
	border-color: var(--cic-brand);
	box-shadow: 0 0 0 3px rgba(123, 201, 201, 0.18);
}
.cic-card .cic-select::-ms-expand { display: none; }

/* select de color (con muestra a la izquierda) */
.cic-select-wrapper--color {
	cursor: pointer;
}
.cic-select-wrapper--color .cic-select {
	padding-left: 30px;
	/* Desactivamos el dropdown nativo: lo gestionamos con un picker custom
	   (ver .cic-color-options en JS) para poder mostrar el swatch en cada
	   opción, cosa que <option> no permite cross-browser. */
	pointer-events: none;
}
.cic-color-swatch {
	position: absolute;
	left: 10px;
	top: 50%;
	transform: translateY(-50%);
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: #ffffff;
	border: 1px solid var(--cic-border);
	pointer-events: none;
	z-index: 1;
}

/* Dropdown custom con swatch en cada opción.
   IMPORTANTE: position: fixed por defecto. Si dejáramos position: static,
   al pasar de display:none a display:block el <ul> entraría en el flow
   del wrapper y aumentaría su altura, contaminando getBoundingClientRect()
   y haciendo que el cálculo de "abrir arriba/abajo" salga mal el primer
   click. Con position: fixed nunca afecta al wrapper. */
.cic-color-options {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	margin: 0;
	padding: 4px;
	list-style: none;
	background: var(--cic-bg);
	border: 1px solid var(--cic-border);
	border-radius: 8px;
	box-shadow: 0 8px 24px rgba(58, 58, 58, 0.12);
	max-height: 280px;
	overflow-y: auto;
	z-index: 9999;
	font-family: inherit;
}
.cic-select-wrapper--color.is-open .cic-color-options {
	display: block;
}
/* Indicador visual: borde turquesa sobre el select cuando está abierto */
.cic-select-wrapper--color.is-open .cic-select {
	border-color: var(--cic-brand);
	box-shadow: 0 0 0 3px rgba(123, 201, 201, 0.18);
}
.cic-color-option {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 7px 10px;
	margin: 0;
	border-radius: 6px;
	cursor: pointer;
	font-size: 12px;
	color: var(--cic-text);
	line-height: 1.2;
	transition: background-color 0.15s ease;
	user-select: none;
}
.cic-color-option:hover,
.cic-color-option:focus {
	background: var(--cic-brand-soft);
	outline: none;
}
.cic-color-option.is-selected {
	background: var(--cic-brand-soft);
	font-weight: 600;
}
.cic-color-option-swatch {
	display: inline-block;
	width: 14px;
	height: 14px;
	border-radius: 50%;
	border: 1px solid var(--cic-border);
	background-color: #ffffff;
	flex: 0 0 14px;
}
.cic-color-option-label {
	flex: 1 1 auto;
	min-width: 0;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* chevron */
.cic-select-chevron {
	position: absolute;
	right: 10px;
	top: 50%;
	transform: translateY(-50%);
	width: 10px;
	height: 6px;
	color: var(--cic-text-muted);
	pointer-events: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}
.cic-select-chevron svg { display: block; }

/* ---- Radios fallback (si quedaran grupos no convertibles) ---- */
.cic-radio-list {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 0;
	padding: 0;
	list-style: none;
}
.cic-radio-list li { float: none !important; margin: 0; }
.cic-radio-label {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 6px 10px;
	font-size: 12px;
	color: var(--cic-text);
	background: var(--cic-bg);
	border: 1px solid var(--cic-border);
	border-radius: 100px;
	cursor: pointer;
	margin: 0;
}
.cic-radio-label input { margin: 0; }

/* ---- Footer: qty (opcional) + botón circular ---- */
.cic-footer {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 10px;
	width: 100%;
}
.cic-card .cic-qty {
	height: 44px;
	width: 64px;
	flex: 0 0 64px;
	padding: 8px 10px;
	font-size: 14px;
	color: var(--cic-text);
	background: var(--cic-bg);
	border: 1px solid var(--cic-border);
	border-radius: 8px;
	box-shadow: none;
	text-align: center;
}
.cic-card .cic-qty:focus {
	outline: none;
	border-color: var(--cic-brand);
	box-shadow: 0 0 0 3px rgba(123, 201, 201, 0.18);
}

/* botón principal */
.cic-card .cic-btn {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-width: 44px;
	height: 44px;
	padding: 0;
	margin: 0;
	background: var(--cic-brand);
	color: #fff;
	border: none;
	border-radius: 100px;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.4px;
	text-transform: uppercase;
	cursor: pointer;
	white-space: nowrap;
	overflow: hidden;
	box-shadow: none;
	transition: padding 0.25s ease, background-color 0.25s ease, box-shadow 0.25s ease, color 0.2s ease;
	-webkit-appearance: none;
	appearance: none;
}
.cic-card .cic-btn:focus { outline: none; }
.cic-card .cic-btn:focus-visible {
	box-shadow: 0 0 0 3px rgba(123, 201, 201, 0.35);
}

/* iconos dentro del botón */
.cic-btn-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	line-height: 0;
}
.cic-btn-icon svg { display: block; }
.cic-btn-icon--check { display: none; }

/* textos dentro del botón */
.cic-btn-text {
	display: none;
	line-height: 1;
}
.cic-btn-text--oos {
	display: inline-flex;
	padding: 0 14px;
	font-size: 11px;
}

/* hover: se expande y muestra "AÑADIR" */
@media (hover: hover) {
	.cic-card .cic-btn:not(.cic-btn--disabled):not(.cic-btn--added):hover {
		padding: 0 16px;
		background: var(--cic-brand);
		box-shadow: 0 4px 12px rgba(123, 201, 201, 0.4);
	}
	.cic-card .cic-btn:not(.cic-btn--disabled):not(.cic-btn--added):hover .cic-btn-text--add {
		display: inline-flex;
	}
}

/* estado añadido */
.cic-card .cic-btn--added {
	padding: 0 16px;
	background: var(--cic-success) !important;
	box-shadow: 0 4px 12px rgba(123, 185, 123, 0.35);
}
.cic-card .cic-btn--added .cic-btn-icon--cart { display: none; }
.cic-card .cic-btn--added .cic-btn-icon--check { display: inline-flex; }
.cic-card .cic-btn--added .cic-btn-text--add { display: none !important; }
.cic-card .cic-btn--added .cic-btn-text--added { display: inline-flex; }

/* deshabilitado / agotado */
.cic-card .cic-btn--disabled,
.cic-card .cic-btn[disabled] {
	background: #cfcfcf;
	color: #fff;
	cursor: not-allowed;
	box-shadow: none;
	padding: 0 14px;
}
.cic-card .cic-btn--disabled .cic-btn-icon,
.cic-card .cic-btn[disabled] .cic-btn-icon { display: none; }

/* ---- Spinner heredado del módulo ---- */
.preLoading {
	display: none;
	position: absolute;
	top: 0;
	bottom: 0;
	left: 0;
	right: 0;
	background: rgba(0, 0, 0, 0.35) !important;
	background-image: url(../../img/spinner.gif) !important;
	background-size: 24px !important;
	background-repeat: no-repeat !important;
	background-position: center !important;
	border-radius: 100px;
	z-index: 2;
	border: none !important;
}

/* ---- Compatibilidad con clases viejas si quedaran en ajax ---- */
.addToCartFormWrapper .control-label { bottom: auto; position: static; }
.addToCartFormWrapper .form-control-select { margin-bottom: 0; }
.addToCartFormWrapper .groupUl { margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.addToCartFormWrapper .groupUl li { float: none !important; }

/* ---- Responsive: en móviles muy estrechos, stack vertical ---- */
@media (max-width: 360px) {
	.cic-variants-grid {
		grid-template-columns: 1fr;
	}
}
