/* ==========================================================================
   Kamala — carrito: página "Tu selección" y carrito lateral "Tu carrito".
   Medidas de los bocetos a 1440 px. Los dos comparten el artículo, el
   selector de cantidad y las filas de importes.
   ========================================================================== */

/* Piezas comunes ------------------------------------------------------------- */

.stepper {
	display: inline-grid;
	grid-template-columns: 56px 60px 56px;
	height: 44px;
	border: 1px solid var(--ink);
	border-radius: 2px;
}

.stepper__button {
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 1.25rem;
	font-weight: 200;
	line-height: 1;
}

.stepper__input {
	width: 100%;
	min-width: 0;
	padding: 0;
	border: 0;
	border-inline: 1px solid var(--grey);
	border-radius: 0;
	background: none;
	font-size: 0.9375rem;
	text-align: center;
	appearance: textfield;
	-moz-appearance: textfield;
}

.stepper__input::-webkit-outer-spin-button,
.stepper__input::-webkit-inner-spin-button {
	margin: 0;
	appearance: none;
}

.cart-row {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 16px;
	margin: 0;
	font-size: clamp(0.9375rem, 0.85rem + 0.3vw, 1.0625rem);
}

.cart-note {
	margin: 0;
	font-size: clamp(0.75rem, 0.7rem + 0.2vw, 0.84375rem);
	color: var(--muted);
}

.back-link {
	display: inline-flex;
	align-items: center;
	gap: 22px;
	min-height: var(--tap);
	font-size: 0.75rem;
	font-weight: 500;
	letter-spacing: 0.15em;
	text-decoration: none;
	text-transform: uppercase;
}

.back-link .icon {
	transform: scaleX(-1);
}

.back-link span {
	padding-bottom: 3px;
	/* La raya solo al pasar el cursor (Luca, 17/10). */
	border-bottom: 1px solid transparent;
}

.back-link:hover span {
	border-bottom-color: currentColor;
	text-decoration: none;
}

/* Artículo */

.cart-item__media {
	display: block;
	overflow: hidden;
	background: var(--surface);
}

.cart-item .cart-item__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	filter: brightness(1.02);
	mix-blend-mode: multiply;
}

.cart-item__kicker {
	margin: 0 0 16px;
	font-size: 0.6875rem;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: var(--muted);
}

.cart-item__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 16px;
}

.cart-item__name {
	font-size: clamp(1.125rem, 0.9rem + 0.9vw, 1.53125rem);
	letter-spacing: 0.15em;
	text-transform: uppercase;
	line-height: 1.2;
}

.cart-item__name a {
	text-decoration: none;
}

.cart-item__price {
	flex: none;
	margin: 0;
	font-size: clamp(1rem, 0.9rem + 0.4vw, 1.1875rem);
	white-space: nowrap;
}

.cart-item__color,
.cart-item__label {
	margin: 0;
	font-size: clamp(0.875rem, 0.82rem + 0.25vw, 0.96875rem);
}

.cart-item__color {
	margin-top: 18px;
}

.cart-item__label {
	margin: 22px 0 10px;
}

.cart-item__qty {
	display: flex;
	align-items: center;
	gap: clamp(20px, 2.6vw, 38px);
}

.cart-item__remove {
	font-size: clamp(0.8125rem, 0.78rem + 0.2vw, 0.90625rem);
	text-underline-offset: 0.3em;
}

/* Página ----------------------------------------------------------------------- */

.cart-page {
	padding-block: clamp(18px, 4vw, 58px) clamp(40px, 4vw, 60px);
}

.cart-page .crumbs {
	margin-bottom: clamp(14px, 2.6vw, 38px);
	font-size: clamp(0.75rem, 0.7rem + 0.2vw, 0.84375rem);
}

.cart-page__title {
	font-size: clamp(1.375rem, 1.1rem + 0.8vw, 1.6875rem);
	font-weight: 300;
	letter-spacing: 0.18em;
	text-transform: uppercase;
}

.cart-page__count {
	margin: 12px 0 0;
	font-size: clamp(0.9375rem, 0.85rem + 0.35vw, 1.125rem);
}

.cart-page__empty {
	margin: 40px 0 80px;
}

.cart-page__layout {
	display: grid;
	grid-template-columns: minmax(0, 908fr) minmax(0, 487fr);
	gap: 0 clamp(32px, 6.2vw, 90px);
	align-items: start;
	margin-top: clamp(18px, 1.8vw, 26px);
}

/* La línea vertical entre la selección y el resumen. */
.cart-summary {
	position: relative;
	padding-top: 16px;
}

.cart-summary::before {
	content: "";
	position: absolute;
	inset: -26px auto 0 calc(clamp(32px, 6.2vw, 90px) / -2);
	width: 1px;
	background: var(--line);
}

.cart-page__items {
	margin: 0;
	padding: 0;
	list-style: none;
}

.cart-page .cart-item {
	display: grid;
	grid-template-columns: minmax(0, 472fr) minmax(0, 396fr);
	gap: clamp(20px, 2.6vw, 38px);
}

.cart-page .cart-item + .cart-item {
	margin-top: 40px;
}

.cart-page .cart-item__media {
	aspect-ratio: 472 / 370;
}

.cart-page .cart-item__body {
	padding-top: 14px;
}

/* En la página el precio va debajo del color, no junto al nombre. */
.cart-page .cart-item__head {
	display: contents;
}

.cart-page .cart-item__body {
	display: flex;
	flex-direction: column;
}

.cart-page .cart-item__color {
	order: 1;
}

.cart-page .cart-item__price {
	order: 2;
	margin-top: 24px;
}

.cart-page .cart-item__label {
	order: 3;
	margin-top: 26px;
}

.cart-page .cart-item__qty {
	order: 4;
}

.cart-item__subtotal {
	order: 5;
	margin-top: clamp(24px, 2.6vw, 38px);
	padding-top: clamp(22px, 2.4vw, 34px);
	border-top: 1px solid var(--line);
}

.cart-coupon {
	margin-top: clamp(28px, 3.4vw, 50px);
	border-block: 1px solid var(--line);
}

.cart-coupon > summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	min-height: 68px;
	font-size: clamp(0.9375rem, 0.85rem + 0.3vw, 1.0625rem);
	list-style: none;
	cursor: pointer;
}

.cart-coupon > summary::-webkit-details-marker {
	display: none;
}

.cart-coupon > summary::after {
	content: "";
	width: 18px;
	height: 18px;
	background:
		linear-gradient(currentColor, currentColor) center / 100% 1px no-repeat,
		linear-gradient(currentColor, currentColor) center / 1px 100% no-repeat;
}

.cart-coupon[open] > summary::after {
	background: linear-gradient(currentColor, currentColor) center / 100% 1px no-repeat;
}

.cart-coupon__form {
	display: flex;
	align-items: flex-end;
	gap: 16px;
	padding-bottom: 24px;
}

.cart-coupon__form .field {
	flex: 1;
}

.cart-page__back {
	margin: clamp(14px, 1.6vw, 22px) 0 0;
}

/* Resumen */

.cart-summary__title {
	margin-bottom: clamp(18px, 2.2vw, 32px);
	font-size: clamp(1.1875rem, 1rem + 0.6vw, 1.4375rem);
	letter-spacing: 0.15em;
	text-transform: uppercase;
}

.cart-summary .cart-row + .cart-row {
	margin-top: 14px;
}

.cart-row__remove {
	margin-left: 8px;
	font-size: 0.8125rem;
	color: var(--muted);
}

.cart-summary .cart-row--total {
	margin-top: clamp(18px, 1.9vw, 28px);
	padding-top: clamp(20px, 2.2vw, 32px);
	border-top: 1px solid var(--line);
	font-size: clamp(1.0625rem, 0.95rem + 0.4vw, 1.1875rem);
}

.cart-summary .cart-note {
	margin-top: 22px;
}

.cart-summary__go {
	margin-top: clamp(22px, 2.2vw, 32px);
	font-weight: 500;
	letter-spacing: 0.2em;
}

.cart-summary__or {
	display: flex;
	align-items: center;
	gap: 18px;
	margin: 22px 0;
	font-size: 0.84375rem;
}

.cart-summary__or::before,
.cart-summary__or::after {
	content: "";
	flex: 1;
	height: 1px;
	background: var(--grey);
}

.cart-summary__help {
	margin: clamp(22px, 2.6vw, 38px) 0 0;
	font-size: 0.90625rem;
}

.cart-page .woocommerce-message,
.cart-page .woocommerce-error,
.cart-page .woocommerce-info {
	margin: 24px 0 0;
	font-size: 0.875rem;
}

/* Pie reducido (carrito, pago, confirmación, acceso) ---------------------------- */

.site-footer--simple {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	padding-block: clamp(20px, 2.2vw, 30px);
}

.site-footer--simple .site-footer__logo {
	width: 50px;
	margin: 0;
}

.site-footer__simple-links {
	display: flex;
	gap: clamp(20px, 2.6vw, 38px);
	margin: 0;
	padding: 0;
	list-style: none;
	font-size: 0.8125rem;
	color: var(--muted);
}

.site-footer__simple-links a {
	text-decoration: none;
}

.site-footer__simple-links a:hover {
	color: var(--ink);
	text-decoration: underline;
}

/* Carrito lateral ----------------------------------------------------------------
   Panel a la derecha (463 px) sobre la página atenuada; pantalla completa en móvil. */

.side-cart {
	position: fixed;
	inset: 0;
	z-index: 210;
	display: flex;
	justify-content: flex-end;
	background: rgba(16, 24, 32, 0);
	transition: background-color 0.3s var(--ease);
}

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

.side-cart.is-open {
	background: rgba(16, 24, 32, 0.5);
}

.side-cart__panel {
	width: min(463px, 100%);
	height: 100%;
	padding: 0 clamp(20px, 2.4vw, 34px) 28px;
	overflow-y: auto;
	overscroll-behavior: contain;
	background: var(--paper);
	transform: translateX(100%);
	transition: transform 0.35s var(--ease);
}

.side-cart.is-open .side-cart__panel {
	transform: none;
}

@media (prefers-reduced-motion: reduce) {
	.side-cart__panel {
		opacity: 0;
		transform: none;
		transition: opacity 0.25s var(--ease);
	}

	.side-cart.is-open .side-cart__panel {
		opacity: 1;
	}
}

.side-cart__top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	height: 78px;
}

/* Aviso de "añadida al carrito": arriba a la derecha, bajo la cabecera, y se
   va solo a los 4 s. En móvil, de lado a lado. El carrito ya no se abre solo
   al añadir (Luca, 15/10). */
.cart-notice {
	position: fixed;
	top: calc(var(--header-h) + 12px);
	right: var(--gutter);
	z-index: 150;
	display: flex;
	align-items: center;
	gap: 18px;
	max-width: min(420px, calc(100vw - 2 * var(--gutter)));
	padding: 14px 18px;
	border-radius: var(--radius);
	background: var(--ink);
	color: var(--paper);
	font-size: var(--fs-label);
	letter-spacing: 0.06em;
	line-height: 1.4;
	opacity: 0;
	transform: translateY(-8px);
	visibility: hidden;
	transition: opacity 0.3s var(--ease), transform 0.3s var(--ease), visibility 0s linear 0.3s;
}

.cart-notice.is-shown {
	opacity: 1;
	transform: none;
	visibility: visible;
	transition-delay: 0s;
}

.cart-notice__text {
	flex: 1;
	text-transform: uppercase;
}

.cart-notice__link {
	flex: none;
	color: inherit;
	text-decoration: none; /* subrayado solo al pasar el cursor (Luca, 17/10) */
	text-underline-offset: 0.35em;
	text-transform: uppercase;
	white-space: nowrap;
}

/* El número del carrito de la cabecera da un pequeño salto al añadir. */
.tool--cart.is-bumped .tool__count {
	display: inline-block;
	animation: cart-bump 0.5s var(--ease);
}

@keyframes cart-bump {
	40% {
		transform: scale(1.5);
	}
}

@media (max-width: 899px) {
	.cart-notice {
		left: var(--gutter);
		max-width: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.cart-notice {
		transform: none;
	}

	.tool--cart.is-bumped .tool__count {
		animation: none;
	}
}

.side-cart__logo {
	display: block;
	width: 46px;
}

.side-cart__logo svg {
	display: block;
	width: 100%;
	height: auto;
}

.side-cart__close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: var(--tap);
	height: var(--tap);
	margin-right: -10px;
}

.side-cart__close .icon {
	width: 26px;
	height: 26px;
}

.side-cart__title {
	margin-top: 14px;
	font-size: 1.5rem;
	letter-spacing: 0.15em;
	text-transform: uppercase;
}

.side-cart__count {
	margin: 10px 0 18px;
	font-size: 1.0625rem;
}

.side-cart__items {
	margin: 0;
	padding: 0;
	list-style: none;
}

.cart-item--side + .cart-item--side {
	margin-top: 28px;
	padding-top: 28px;
	border-top: 1px solid var(--line);
}

.cart-item--side .cart-item__media {
	aspect-ratio: 432 / 247;
	margin-bottom: 14px;
}

.cart-item--side .cart-item__kicker {
	margin-bottom: 14px;
}

.cart-item--side .cart-item__name {
	font-size: 1.1875rem;
}

.cart-item--side .cart-item__color {
	margin-top: 12px;
}

.side-cart__summary {
	margin-top: 30px;
	padding-top: 24px;
	border-top: 1px solid var(--line);
}

.side-cart__summary .cart-note {
	margin: 10px 0 22px;
}

.side-cart__summary .btn {
	font-weight: 500;
	letter-spacing: 0.2em;
}

.side-cart__summary .btn + .btn {
	margin-top: 13px;
}

.side-cart__back {
	margin: 22px 0 0;
}

.side-cart-open {
	overflow: hidden;
}

/* Mientras se actualiza una cantidad. */
.side-cart__content.is-busy {
	opacity: 0.5;
	pointer-events: none;
}

/* Móvil ------------------------------------------------------------------------ */

@media (max-width: 899px) {
	/* Una columna. "Seguir comprando" baja al final, después del resumen. */
	.cart-page__layout {
		display: flex;
		flex-direction: column;
		/* Sin esto hereda "start" de la rejilla de escritorio y el código de
		   descuento y el resumen se quedan al ancho de su texto. */
		align-items: stretch;
	}

	.cart-page__main {
		display: contents;
	}

	.cart-summary {
		order: 2;
	}

	.cart-page__back {
		order: 3;
	}

	.cart-page .cart-item {
		display: block;
	}

	.cart-page .cart-item__media {
		aspect-ratio: 766 / 358;
		margin-inline: -4px;
	}

	.cart-page .cart-item__body {
		display: block;
		padding-top: 12px;
	}

	.cart-page .cart-item__kicker {
		margin-bottom: 10px;
	}

	/* En móvil el precio vuelve junto al nombre. */
	.cart-page .cart-item__head {
		display: flex;
	}

	.cart-page .cart-item__price {
		margin-top: 0;
	}

	.cart-page .cart-item__color {
		margin-top: 10px;
	}

	.cart-page .cart-item__label {
		margin-top: 16px;
	}

	.cart-item__subtotal {
		display: none;
	}

	.cart-coupon {
		margin-top: 16px;
	}

	.cart-coupon > summary {
		min-height: 48px;
	}

	.cart-page__back {
		margin: 8px 0 0;
	}

	.cart-summary {
		margin-top: 28px;
		padding-top: 0;
	}

	.cart-summary::before {
		display: none;
	}

	.cart-summary .cart-row + .cart-row {
		margin-top: 4px;
	}

	.cart-summary .cart-row--total {
		margin-top: 12px;
		padding-top: 14px;
	}

	.cart-summary .cart-note {
		margin-top: 4px;
	}

	.cart-summary__go {
		margin-top: 14px;
	}

	.cart-summary__or {
		margin: 8px 0;
	}

	.cart-summary__help {
		margin-top: 4px;
	}

	.site-footer--simple {
		flex-direction: column;
		gap: 12px;
	}

	.site-footer--simple .site-footer__logo {
		display: none;
	}

	.side-cart__panel {
		width: 100%;
	}

	.side-cart__top {
		height: 60px;
	}
}

.cart-notice__link:hover {
	text-decoration: underline;
}
