/* CustomAll cart/checkout bridge styles. Cart layout lives in the active theme. */
.customall-cart-preview-figure {
	display: grid;
	gap: .25rem;
	margin: 0;
	max-width: 128px;
}

.customall-cart-preview-frame {
	position: relative;
	display: block;
	width: 128px;
	height: 128px;
	overflow: hidden;
	background: var(--bg-soft, #f7f7f8);
	border: 1px solid var(--line, #ebebef);
	border-radius: 8px;
}

.customall-cart-preview {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.customall-cart-preview-frame .customall-cart-preview[hidden] { display: none; }

.customall-cart-preview-fallback {
	position: absolute;
	inset: 0;
	display: none;
	place-items: center;
	padding: .4rem;
	color: var(--muted, #6e6d7a);
	background: var(--bg-soft, #f7f7f8);
	font-size: .62rem;
	font-weight: 750;
	line-height: 1.25;
	text-align: center;
}

.customall-cart-preview-frame.is-unavailable .customall-cart-preview-fallback { display: grid; }

.customall-preview-trigger {
	display: flex;
	width: fit-content;
	min-height: 44px;
	align-items: center;
	gap: .4rem;
	margin-top: .5rem;
	padding: .2rem 0;
	color: var(--accent, #ff6b00);
	font-size: .8rem;
	font-weight: 600;
	line-height: 1.3;
	text-decoration: none;
}

.customall-preview-trigger:hover { text-decoration: underline; }

.customall-preview-trigger:focus-visible {
	border-radius: 4px;
	outline: 2px solid var(--accent, #ff6b00);
	outline-offset: 3px;
}

.customall-preview-trigger__icon {
	display: block;
	width: 20px;
	height: 20px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.7;
}

.customall-cart-summary {
	margin-top: .55rem;
	padding-top: .5rem;
	border-top: 1px solid var(--line, #ebebef);
}

.customall-cart-summary__title,
.customall-order-summary strong {
	display: block;
	margin: 0 0 .4rem;
	color: var(--muted, #6e6d7a);
	font-size: .62rem;
	font-weight: 700;
	letter-spacing: .08em;
	text-transform: uppercase;
}

.customall-cart-summary dl.variation,
.customall-order-summary ul {
	display: grid;
	gap: .24rem .7rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.customall-cart-summary dl.variation {
	grid-template-columns: max-content minmax(0, 1fr);
}

.customall-cart-summary dl.variation dt,
.customall-cart-summary dl.variation dd {
	float: none;
	display: block;
	min-width: 0;
	margin: 0;
	padding: 0;
	overflow-wrap: anywhere;
	font-size: .8rem;
	line-height: 1.4;
}

.customall-cart-summary dl.variation dt {
	color: var(--muted, #6e6d7a);
	font-weight: 600;
}

.customall-cart-summary dl.variation dd {
	color: var(--ink, #0d0c22);
	font-weight: 700;
}

.customall-cart-summary dl.variation dd p { margin: 0; }

.customall-cart-summary__more {
	margin-top: .5rem;
}

.customall-cart-summary__more > summary {
	display: inline-flex;
	min-height: 44px;
	align-items: center;
	gap: .4rem;
	padding: .3rem .1rem;
	color: var(--accent, #ff6b00);
	cursor: pointer;
	font-size: .75rem;
	font-weight: 600;
	line-height: 1.35;
	list-style: none;
}

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

.customall-cart-summary__more > summary::after {
	content: "+";
	display: inline-grid;
	place-items: center;
	width: 20px;
	height: 20px;
	color: var(--accent, #ff6b00);
	background: var(--bg-soft, #f7f7f8);
	border-radius: 50%;
	font-size: .82rem;
	line-height: 1;
}

.customall-cart-summary__more > summary:focus-visible {
	border-radius: 4px;
	outline: 2px solid var(--accent, #ff6b00);
	outline-offset: 3px;
}

.customall-cart-summary__more[open] > summary::after { content: "−"; }

.customall-cart-summary__more dl.variation { margin-top: .45rem; }

.customall-order-summary {
	margin: .35rem 0 .65rem;
}

.customall-order-summary li {
	margin: 0;
	font-size: .82rem;
	line-height: 1.45;
}

.customall-order-summary li span {
	color: var(--muted, #6e6d7a);
	font-weight: 600;
}

.customall-order-preview {
	display: block;
	width: auto;
	height: auto;
	max-width: 180px;
	border-radius: 10px;
}

.customall-cart-notice-text {
	display: inline-flex;
	align-items: center;
	gap: .45rem;
	font-weight: 750;
}

.customall-cart-notice-text::before {
	content: "✓";
	display: inline-grid;
	place-items: center;
	width: 20px;
	height: 20px;
	color: #fff;
	background: var(--success, #116149);
	border-radius: 50%;
	font-size: .7rem;
	line-height: 1;
}

.customall-preview-dialog {
	width: min(92vw, 420px);
	max-width: 420px;
	max-height: min(88dvh, 760px);
	padding: 0;
	overflow: hidden;
	color: var(--ink, #0d0c22);
	background: var(--bg, #fff);
	border: 0;
	border-radius: 16px;
	box-shadow: 0 24px 72px rgba(13, 12, 34, .32);
}

.customall-preview-dialog::backdrop {
	background: rgba(13, 12, 34, .62);
	backdrop-filter: blur(2px);
}

.customall-preview-dialog__panel {
	position: relative;
	display: flex;
	max-height: min(88dvh, 760px);
	flex-direction: column;
}

.customall-preview-dialog__close {
	position: absolute;
	top: 10px;
	right: 10px;
	z-index: 2;
	display: grid;
	width: 44px;
	height: 44px;
	place-items: center;
	padding: 0 0 2px;
	color: var(--ink, #0d0c22);
	background: rgba(255, 255, 255, .94);
	border: 1px solid var(--line, #ebebef);
	border-radius: 50%;
	box-shadow: 0 2px 10px rgba(13, 12, 34, .12);
	cursor: pointer;
	font-size: 1.55rem;
	line-height: 1;
}

.customall-preview-dialog__close:hover { border-color: var(--accent, #ff6b00); color: var(--accent, #ff6b00); }

.customall-preview-dialog__close:focus-visible {
	outline: 2px solid var(--accent, #ff6b00);
	outline-offset: 3px;
}

.customall-preview-dialog__body {
	display: grid;
	min-height: 0;
	place-items: center;
	overflow: auto;
	padding: 1rem;
	background: var(--bg-soft, #f7f7f8);
}

.customall-preview-dialog__image {
	display: block;
	width: auto;
	height: auto;
	max-width: 100%;
	max-height: calc(88dvh - 9rem);
	object-fit: contain;
}

.customall-preview-dialog__image[hidden] { display: none; }

.customall-preview-dialog__error {
	margin: 0;
	padding: 3rem 1rem;
	color: var(--muted, #6e6d7a);
	font-size: .9rem;
	font-weight: 600;
	text-align: center;
}

.customall-preview-dialog__error[hidden] { display: none; }

.customall-preview-dialog__footer {
	padding: .75rem 1rem 1rem;
	background: #fff;
	border-top: 1px solid var(--line, #ebebef);
}

.customall-preview-dialog__primary {
	display: flex;
	width: 100%;
	min-height: 50px;
	align-items: center;
	justify-content: center;
	padding: .7rem 1rem;
	color: #fff !important;
	background: var(--accent, #ff6b00);
	border: 0;
	border-radius: 9px;
	font: inherit;
	font-size: 1rem;
	font-weight: 700;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
}

.customall-preview-dialog__primary:hover { filter: brightness(.94); }
.customall-preview-dialog__primary:focus-visible { outline: 2px solid var(--ink, #0d0c22); outline-offset: 2px; }
.customall-preview-dialog__primary:disabled { cursor: not-allowed; opacity: .5; }

body.customall-preview-dialog-open { overflow: hidden; }

.customall-checkout-item {
	display: grid;
	grid-template-columns: 64px minmax(0, 1fr);
	align-items: start;
	gap: .75rem;
}

.customall-checkout-item__image {
	display: block;
	width: 64px;
	height: 64px;
	object-fit: cover;
	border: 1px solid var(--line, #ebebef);
	border-radius: 8px;
}

.customall-checkout-item__name { min-width: 0; }

@media (max-width: 767px) {
	.customall-cart-preview-figure { max-width: 84px; }

	.customall-cart-preview-frame {
		width: 84px;
		height: 84px;
	}

	.customall-cart-summary dl.variation {
		grid-template-columns: max-content minmax(0, 1fr);
		gap: .2rem .3rem;
	}

	.customall-cart-summary dl.variation dt { margin-top: 0; font-size: .66rem; }
	.customall-cart-summary dl.variation dd { font-size: .66rem; }

	.customall-preview-trigger { font-size: .92rem; }

	.customall-preview-dialog {
		width: min(92vw, 420px);
		max-width: 92vw;
		max-height: 86dvh;
		border-radius: 14px;
	}

	.customall-preview-dialog__panel { max-height: 86dvh; }
	.customall-preview-dialog__body { padding: .75rem; }
	.customall-preview-dialog__image { max-height: calc(86dvh - 8.75rem); }
	.customall-preview-dialog__footer { padding: .65rem .75rem .75rem; }

	.customall-checkout-item { grid-template-columns: 56px minmax(0, 1fr); gap: .6rem; }
	.customall-checkout-item__image { width: 56px; height: 56px; }
}

@media (max-width: 380px) {
	.customall-cart-summary dl.variation {
		gap: .2rem .1rem;
	}
}

@media (max-width: 350px) {
	.customall-cart-summary dl.variation {
		grid-template-columns: minmax(0, 1fr);
		gap: .05rem;
	}

	.customall-cart-summary dl.variation dt { margin-top: .3rem; }
	.customall-cart-summary dl.variation dt:first-child { margin-top: 0; }
}

.customall-order-preview-wrap {
	display: grid;
	gap: .35rem;
	margin: .35rem 0 .65rem;
}

.customall-order-preview-wrap .customall-order-preview[hidden] { display: none; }

.customall-order-preview-fallback {
	display: block;
	padding: .65rem .75rem;
	color: var(--muted, #6e6d7a);
	background: var(--bg-soft, #f7f7f8);
	border: 1px solid var(--line, #ebebef);
	border-radius: 10px;
	font-size: .78rem;
	font-weight: 700;
}

.customall-order-preview-fallback[hidden] { display: none; }
