/*
 * Cart and checkout screens: bag, checkout details, review and pay, Cashfree hand-off,
 * order confirmed / payment failed. Tokens only (tokens.css). Prefix .st-co-.
 * Loaded by the views in Views/store/cart.php and Views/store/checkout/*.
 * Candidates for components.css are marked "promote".
 */

.st-co {
	padding-top: var(--st-space-4);
}

/* ---------- Progress row: steps + secure line ---------- */
.st-co-top {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: var(--st-space-2) var(--st-space-4);
	padding-bottom: var(--st-space-4);
	border-bottom: 1px solid var(--st-border);
	margin-bottom: var(--st-space-4);
}

.st-co-secure {
	display: flex;
	align-items: center;
	gap: var(--st-space-2);
	margin: 0;
	font-size: var(--st-text-ui);
	font-weight: var(--st-weight-medium);
	color: var(--st-success-fg);
}

/* ---------- Page head ---------- */
.st-co-head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: var(--st-space-2) var(--st-space-3);
	margin-bottom: var(--st-space-4);
}

.st-co-head__title {
	margin: 0;
}

.st-co-head__meta {
	margin: 0;
	color: var(--st-ink-muted);
}

/* ---------- Two-column layout ---------- */
.st-co-layout {
	display: grid;
	gap: var(--st-space-5);
}

.st-co-main {
	min-width: 0;
}

@media (min-width: 1024px) {
	.st-co-layout {
		grid-template-columns: minmax(0, 1fr) 400px;
		gap: var(--st-space-6);
		align-items: start;
	}

	.st-co-aside {
		position: sticky;
		top: var(--st-sticky-top, calc(var(--st-header-offset) + var(--st-space-4)));
	}
}

@media (min-width: 1280px) {
	.st-co-layout {
		grid-template-columns: minmax(0, 1fr) 432px;
		gap: var(--st-space-7);
	}
}

/* ---------- Bag items ---------- */
.st-co-items {
	margin: 0;
	padding: 0;
	list-style: none;
	border-top: 1px solid var(--st-border);
}

.st-co-item {
	display: grid;
	grid-template-columns: 96px minmax(0, 1fr);
	gap: var(--st-space-3);
	padding: var(--st-space-4) 0;
	border-bottom: 1px solid var(--st-border);
}

.st-co-item__media {
	display: block;
	aspect-ratio: 4 / 5;
	border-radius: var(--st-radius-md);
	background: var(--st-surface-muted);
	overflow: hidden;
}

.st-co-item__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.st-co-item__body {
	display: flex;
	flex-direction: column;
	gap: var(--st-space-2);
	min-width: 0;
}

.st-co-item__top {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: var(--st-space-3);
}

.st-co-item__name {
	margin: 0;
	font-size: var(--st-text-base);
	font-weight: var(--st-weight-semibold);
	line-height: var(--st-leading-snug);
}

.st-co-item__name a {
	color: var(--st-ink);
	text-decoration: none;
}

.st .st-co-item__name a:hover {
	text-decoration: underline;
}

.st-co-item__total {
	margin: 0;
	font-weight: var(--st-weight-semibold);
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.st-co-item__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 0 var(--st-space-3);
	margin: 0;
	font-size: var(--st-text-ui);
	line-height: var(--st-leading-ui);
	color: var(--st-ink-muted);
}

.st-co-item__meta div {
	display: flex;
	gap: var(--st-space-1);
}

.st-co-item__meta dt::after {
	content: ":";
}

.st-co-item__meta dd {
	margin: 0;
	color: var(--st-ink);
	font-variant-numeric: tabular-nums;
}

.st-co-item__mrp {
	color: var(--st-ink-subtle);
}

.st-co-item__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: var(--st-space-2) var(--st-space-4);
	margin-top: var(--st-space-1);
}

.st-co-item__note {
	margin: 0;
	font-size: var(--st-text-sm);
	color: var(--st-warning-fg);
}

.st-co-item[aria-busy="true"] {
	opacity: 0.6;
	pointer-events: none;
}

@media (min-width: 768px) {
	.st-co-item {
		grid-template-columns: 128px minmax(0, 1fr);
		gap: var(--st-space-4);
	}

	.st-co-item__name {
		font-size: var(--st-text-md);
	}
}

/* Quantity: − value + (server changes the quantity one step at a time) */
.st-co-qty {
	display: inline-flex;
	align-items: stretch;
	height: var(--st-control-height);
	border: 1px solid var(--st-border-control);
	border-radius: var(--st-radius-sm);
	background: var(--st-surface);
}

.st-co-qty__value {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: var(--st-control-height);
	border-inline: 1px solid var(--st-border);
	font-weight: var(--st-weight-semibold);
	font-variant-numeric: tabular-nums;
}

.st-co-continue {
	margin: var(--st-space-4) 0 0;
}

/* ---------- Summary panel ---------- */
.st-co-summary {
	padding: var(--st-space-4);
	border: 1px solid var(--st-border);
	border-radius: var(--st-radius-md);
	background: var(--st-surface-warm);
}

.st-co-summary__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: var(--st-space-3);
	margin-bottom: var(--st-space-3);
}

.st-co-summary__title {
	margin: 0;
	font-size: var(--st-text-md);
}

.st-co-summary__edit {
	display: inline-flex;
	align-items: center;
	min-height: var(--st-control-height-sm);
	font-size: var(--st-text-ui);
	font-weight: var(--st-weight-medium);
}

.st-co-mini {
	display: grid;
	gap: var(--st-space-3);
	margin: 0 0 var(--st-space-3);
	padding: 0 0 var(--st-space-3);
	list-style: none;
	border-bottom: 1px solid var(--st-border);
}

.st-co-mini__item {
	display: grid;
	grid-template-columns: 56px minmax(0, 1fr) auto;
	align-items: start;
	gap: var(--st-space-3);
}

.st-co-mini__media {
	position: relative;
	aspect-ratio: 4 / 5;
	border-radius: var(--st-radius-sm);
	background: var(--st-surface-muted);
}

.st-co-mini__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: var(--st-radius-sm);
}

.st-co-mini__qty {
	position: absolute;
	top: calc(-1 * var(--st-space-2));
	right: calc(-1 * var(--st-space-2));
	min-width: var(--st-space-4);
	height: var(--st-space-4);
	padding: 0 var(--st-space-1);
	border-radius: var(--st-space-3);
	background: var(--st-ink);
	color: var(--st-ink-inverse);
	font-size: var(--st-text-xs);
	font-weight: var(--st-weight-semibold);
	line-height: var(--st-space-4);
	text-align: center;
}

.st-co-mini__name {
	margin: 0;
	font-size: var(--st-text-ui);
	font-weight: var(--st-weight-semibold);
	line-height: var(--st-leading-ui);
}

.st-co-mini__meta {
	margin: 0;
	font-size: var(--st-text-sm);
	line-height: var(--st-leading-ui);
	color: var(--st-ink-muted);
}

.st-co-mini__price {
	margin: 0;
	font-size: var(--st-text-ui);
	font-weight: var(--st-weight-semibold);
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.st-co-coupon {
	margin-bottom: var(--st-space-3);
	padding-bottom: var(--st-space-3);
	border-bottom: 1px solid var(--st-border);
}

.st-co-coupon .st-label {
	display: block;
	margin-bottom: var(--st-space-2);
}

.st-co-coupon .st-input {
	text-transform: uppercase;
}

.st-co-coupon .st-input::placeholder {
	text-transform: none;
}

.st-co-coupon .st-error:empty {
	display: none;
}

.st-co-coupon .st-error {
	margin-top: var(--st-space-2);
}

.st-co-cta {
	margin-top: var(--st-space-4);
}

.st-co-paynote {
	margin: var(--st-space-2) 0 0;
	font-size: var(--st-text-sm);
	color: var(--st-ink-muted);
	text-align: center;
}

.st-co-trust {
	display: grid;
	gap: var(--st-space-2);
	margin: var(--st-space-4) 0 0;
	padding: var(--st-space-3) 0 0;
	list-style: none;
	border-top: 1px solid var(--st-border);
	font-size: var(--st-text-sm);
	line-height: var(--st-leading-ui);
	color: var(--st-ink-muted);
}

.st-co-trust li {
	display: flex;
	align-items: flex-start;
	gap: var(--st-space-2);
}

.st-co-trust .st-icon {
	margin-top: 1px;
	color: var(--st-ink);
}

.st-co-trust strong {
	color: var(--st-ink);
}

/* Sticky total + checkout bar on phones and tablets (promote with .st-buybar) */
.st-co-bar {
	position: sticky;
	bottom: 0;
	z-index: var(--st-z-sticky);
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--st-space-3);
	margin: var(--st-space-5) calc(-1 * var(--st-gutter)) calc(-1 * var(--st-page-end)); /* sits on the page-end space */
	padding: var(--st-space-2) var(--st-gutter);
	border-top: 1px solid var(--st-border);
	background: var(--st-bg);
	box-shadow: var(--st-shadow-overlay);
}

.st-co-bar__total {
	display: flex;
	flex-direction: column;
	margin: 0;
	font-size: var(--st-text-sm);
	line-height: var(--st-leading-ui);
	color: var(--st-ink-muted);
}

.st-co-bar__total strong {
	color: var(--st-ink);
	font-size: var(--st-text-md);
	font-variant-numeric: tabular-nums;
}

.st-co-bar .st-btn {
	flex: 1 1 auto;
	max-width: 240px;
}

@media (min-width: 1024px) {
	.st-co-bar {
		display: none;
	}
}

/* ---------- Checkout form ---------- */
.st-co-signin {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: var(--st-space-2) var(--st-space-3);
	margin-bottom: var(--st-space-4);
	padding: var(--st-space-3);
	border: 1px solid var(--st-border);
	border-radius: var(--st-radius-md);
	background: var(--st-surface-warm);
}

.st-co-signin p {
	margin: 0;
	font-size: var(--st-text-ui);
}

.st-co-step {
	padding: var(--st-space-4) 0;
	border-top: 1px solid var(--st-border);
}

.st-co-step:first-of-type {
	border-top: 0;
	padding-top: 0;
}

.st-co-step__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: var(--st-space-3);
}

.st-co-step__title {
	display: flex;
	align-items: center;
	gap: var(--st-space-2);
	margin: 0 0 var(--st-space-4);
	font-size: var(--st-text-lg);
}

.st-co-step__num {
	display: inline-flex;
	flex: none;
	align-items: center;
	justify-content: center;
	width: var(--st-space-5);
	height: var(--st-space-5);
	border-radius: var(--st-radius-round);
	background: var(--st-ink);
	color: var(--st-ink-inverse);
	font-size: var(--st-text-ui);
	font-variant-numeric: tabular-nums;
}

.st-co-optional {
	font-size: var(--st-text-ui);
	font-weight: var(--st-weight-regular);
	color: var(--st-ink-muted);
}

.st-co-grid {
	display: grid;
	gap: 0 var(--st-space-3);
}

.st-co-field {
	margin-bottom: var(--st-space-3);
}

@media (min-width: 768px) {
	.st-co-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.st-co-field--address {
		grid-column: 1 / -1;
	}
}

.st-co-phone {
	display: grid;
	grid-template-columns: 112px minmax(0, 1fr);
	gap: var(--st-space-2);
}

.st-co-form__summary {
	margin-bottom: var(--st-space-4);
	padding: var(--st-space-3);
	border: 1px solid var(--st-danger-border);
	border-radius: var(--st-radius-md);
	background: var(--st-danger-bg);
}

.st-co-saved {
	display: grid;
	gap: var(--st-space-2);
	margin: 0 0 var(--st-space-4);
	padding: 0;
	border: 0;
}

.st-co-saved__legend {
	margin-bottom: var(--st-space-2);
	padding: 0;
	font-size: var(--st-text-ui);
	font-weight: var(--st-weight-semibold);
}

.st-co-saved__option {
	display: flex;
	align-items: flex-start;
	gap: var(--st-space-3);
	padding: var(--st-space-3);
	border: 1px solid var(--st-border-strong);
	border-radius: var(--st-radius-md);
	cursor: pointer;
	transition: border-color var(--st-duration-fast) var(--st-ease), background-color var(--st-duration-fast) var(--st-ease);
}

.st-co-saved__option:hover {
	border-color: var(--st-ink-muted);
}

.st-co-saved__option:has(:checked) {
	border-color: var(--st-ink);
	background: var(--st-surface-selected);
	box-shadow: inset 0 0 0 1px var(--st-ink);
}

.st-co-saved__input {
	flex: none;
	width: 20px;
	height: 20px;
	margin: 2px 0 0;
	accent-color: var(--st-ink);
}

.st-co-saved__text {
	display: flex;
	flex-direction: column;
	font-size: var(--st-text-ui);
	line-height: var(--st-leading-ui);
	color: var(--st-ink-muted);
}

.st-co-saved__text strong {
	color: var(--st-ink);
	font-size: var(--st-text-base);
}

.st-co-billing {
	margin-top: var(--st-space-3);
}

.st-co-billing__note {
	margin-bottom: var(--st-space-3);
}

.st-co-notes {
	min-height: 96px;
}

.st-co-paymethod {
	display: flex;
	align-items: flex-start;
	gap: var(--st-space-3);
	margin-bottom: var(--st-space-4);
	padding: var(--st-space-3);
	border: 1px solid var(--st-ink);
	border-radius: var(--st-radius-md);
	background: var(--st-surface-selected);
}

.st-co-paymethod > .st-icon {
	margin-top: 2px;
	color: var(--st-success-fg);
}

.st-co-paymethod__title {
	margin: 0;
	font-weight: var(--st-weight-semibold);
}

.st-co-paymethod__text {
	margin: var(--st-space-1) 0 0;
	font-size: var(--st-text-ui);
	line-height: var(--st-leading-ui);
	color: var(--st-ink-muted);
}

.st-co-methods {
	display: flex;
	flex-wrap: wrap;
	gap: var(--st-space-2);
	margin: var(--st-space-2) 0 0;
	padding: 0;
	list-style: none;
}

.st-co-methods li {
	padding: 0 var(--st-space-2);
	border: 1px solid var(--st-border-strong);
	border-radius: var(--st-radius-sm);
	background: var(--st-surface);
	font-size: var(--st-text-xs);
	font-weight: var(--st-weight-semibold);
	line-height: var(--st-space-4);
	color: var(--st-ink);
}

.st-co-submit {
	display: grid;
	gap: var(--st-space-2);
}

.st-co-submit__total {
	margin: 0;
	font-size: var(--st-text-sm);
	color: var(--st-ink-muted);
	text-align: center;
}

.st-co-submit__total strong {
	color: var(--st-ink);
}

/* Sign-in dialog */
.st-co-signin-form__intro {
	margin: 0 0 var(--st-space-3);
}

.st-co-signin-form__status:empty {
	display: none;
}

.st-co-signin-form__status {
	margin: 0 0 var(--st-space-3);
	font-size: var(--st-text-ui);
	color: var(--st-success-fg);
}

/* ---------- Review: addresses ---------- */
.st-co-addresses {
	display: grid;
	gap: var(--st-space-3);
}

@media (min-width: 768px) {
	.st-co-addresses {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

.st-co-address {
	padding: var(--st-space-3);
	border: 1px solid var(--st-border);
	border-radius: var(--st-radius-md);
}

.st-co-address__title {
	display: flex;
	align-items: center;
	gap: var(--st-space-2);
	margin: 0 0 var(--st-space-2);
	font-size: var(--st-text-ui);
	color: var(--st-ink-muted);
}

.st-co-address p {
	margin: 0;
	font-size: var(--st-text-ui);
	line-height: var(--st-leading-body);
	overflow-wrap: anywhere;
}

/* ---------- Result pages (hand-off, failed) ---------- */
.st-co-result {
	display: flex;
	justify-content: center;
	padding-top: var(--st-space-6);
}

.st-co-result__card {
	width: 100%;
	max-width: 560px;
	text-align: center;
}

.st-co-result__icon,
.st-co-done__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: var(--st-space-7);
	height: var(--st-space-7);
	margin-bottom: var(--st-space-3);
	border-radius: var(--st-radius-round);
	background: var(--st-success-bg);
	color: var(--st-success-fg);
}

.st-co-result__icon .st-icon,
.st-co-done__icon .st-icon {
	width: var(--st-space-5);
	height: var(--st-space-5);
}

.st-co-result__icon--danger {
	background: var(--st-danger-bg);
	color: var(--st-danger-fg);
}

.st-co-result__title {
	margin-bottom: var(--st-space-3);
}

.st-co-result__text {
	margin: 0 auto var(--st-space-4);
	max-width: var(--st-measure);
	color: var(--st-ink-muted);
}

.st-co-result__text strong {
	color: var(--st-ink);
}

.st-co-result__small {
	margin: var(--st-space-3) 0 0;
	font-size: var(--st-text-sm);
	color: var(--st-ink-muted);
}

.st-co-result__list {
	display: grid;
	gap: var(--st-space-2);
	margin: 0 0 var(--st-space-5);
	padding: var(--st-space-3);
	list-style: none;
	border: 1px solid var(--st-border);
	border-radius: var(--st-radius-md);
	background: var(--st-surface-warm);
	font-size: var(--st-text-ui);
	line-height: var(--st-leading-ui);
	text-align: left;
}

.st-co-result__list li,
.st-co-next li {
	display: flex;
	align-items: flex-start;
	gap: var(--st-space-2);
}

.st-co-result__list .st-icon,
.st-co-next .st-icon {
	margin-top: 2px;
}

.st-co-result__actions {
	justify-content: center;
}

/* ---------- Order confirmed ---------- */
.st-co-done__head {
	display: grid;
	gap: var(--st-space-3);
	margin-bottom: var(--st-space-5);
	padding-bottom: var(--st-space-5);
	border-bottom: 1px solid var(--st-border);
}

@media (min-width: 768px) {
	.st-co-done__head {
		grid-template-columns: auto minmax(0, 1fr);
		gap: var(--st-space-4);
		align-items: start;
	}

	.st-co-done__icon {
		margin-bottom: 0;
	}
}

.st-co-done__eyebrow {
	margin: 0 0 var(--st-space-2);
	font-size: var(--st-text-xs);
	font-weight: var(--st-weight-semibold);
	letter-spacing: var(--st-tracking-caps);
	text-transform: uppercase;
	color: var(--st-ink-muted);
}

.st-co-done__title {
	margin-bottom: var(--st-space-2);
}

.st-co-done__text {
	margin: 0;
	max-width: var(--st-measure);
	color: var(--st-ink-muted);
}

.st-co-done__text strong {
	color: var(--st-ink);
}

.st-co-next {
	display: grid;
	gap: var(--st-space-3);
	margin: 0;
	padding: 0;
	list-style: none;
}

.st-co-done__actions {
	gap: var(--st-space-3);
	padding-top: var(--st-space-4);
	border-top: 1px solid var(--st-border);
}

.st-co-saved__edit {
	margin: calc(-1 * var(--st-space-2)) 0 var(--st-space-2);
}

/* Order summary disclosure on phones and tablets (checkout, payment); the sidebar
   summary takes over from 1024px. */
.st-co-peek {
	margin-bottom: var(--st-space-4);
	border: 1px solid var(--st-border);
	border-radius: var(--st-radius-md);
	background: var(--st-surface-warm);
}

.st-co-peek__toggle {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--st-space-3);
	min-height: var(--st-control-height);
	padding: var(--st-space-2) var(--st-space-3);
	font-weight: var(--st-weight-semibold);
	list-style: none;
	cursor: pointer;
}

.st-co-peek__toggle::-webkit-details-marker {
	display: none;
}

.st-co-peek__label {
	min-width: 0;
}

.st-co-peek__label::after {
	content: "";
	display: inline-block;
	width: var(--st-space-2);
	height: var(--st-space-2);
	margin: 0 0 var(--st-space-1) var(--st-space-2);
	vertical-align: middle;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(45deg);
	transition: transform var(--st-duration-fast) var(--st-ease);
}

.st-co-peek[open] .st-co-peek__label::after {
	margin-bottom: 0;
	transform: rotate(-135deg);
}

.st-co-peek__hint {
	font-weight: var(--st-weight-regular);
	color: var(--st-ink-muted);
}

.st-co-peek__toggle strong {
	white-space: nowrap;
	font-size: var(--st-text-md);
	font-variant-numeric: tabular-nums;
}

.st-co-peek .st-co-summary {
	border: 0;
	border-top: 1px solid var(--st-border);
	border-radius: 0 0 var(--st-radius-md) var(--st-radius-md);
}

.st-co-aside--wide {
	display: none;
}

@media (min-width: 1024px) {
	.st-co-peek {
		display: none;
	}

	.st-co-aside--wide {
		display: block;
	}
}
