/**
 * SalesHub Checkout — front-end styles.
 * All theming goes through CSS custom properties (see class-sh-checkout-assets.php)
 * so a store's brand color can be changed from Settings without editing this file.
 */

.sh-checkout {
	--sh-primary: #1a6b6b;
	--sh-primary-hover: #14504f;
	--sh-primary-text: #ffffff;
	--sh-radius: 10px;
	--sh-border: #e2e5e9;
	--sh-bg: #ffffff;
	--sh-bg-muted: #f7f8fa;
	--sh-text: #1f2328;
	--sh-text-muted: #6b7280;
	--sh-danger: #d64545;
	--sh-success: #1a9c6b;

	max-width: 1240px;
	margin: 0 auto;
	color: var(--sh-text);
	font-size: 15px;
	line-height: 1.5;
	position: relative;
	box-sizing: border-box;
}
.sh-checkout *,
.sh-checkout *::before,
.sh-checkout *::after {
	box-sizing: border-box;
}

/* Steps indicator */
.sh-checkout__steps {
	display: flex;
	align-items: center;
	gap: 8px;
	background: var(--sh-bg-muted);
	border: 1px solid var(--sh-border);
	border-radius: var(--sh-radius);
	padding: 16px 24px;
	margin-bottom: 24px;
	flex-wrap: wrap;
}
.sh-step {
	display: flex;
	align-items: center;
	gap: 10px;
	color: var(--sh-text-muted);
	font-weight: 500;
}
.sh-step__icon {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	border: 1px solid var(--sh-border);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 12px;
	background: var(--sh-bg);
}
.sh-step--done .sh-step__icon {
	background: var(--sh-primary);
	border-color: var(--sh-primary);
	color: var(--sh-primary-text);
}
.sh-step--active {
	color: var(--sh-text);
}
.sh-step--active .sh-step__icon {
	border-color: var(--sh-primary);
	color: var(--sh-primary);
}
.sh-step:not(:last-child)::after {
	content: '›';
	margin-left: 8px;
	color: var(--sh-border);
}

/* Layout */
.sh-checkout__layout {
	display: grid;
	grid-template-columns: 1fr 380px;
	gap: 32px;
	align-items: start;
}
@media (max-width: 900px) {
	.sh-checkout__layout {
		grid-template-columns: 1fr;
	}
	.sh-checkout__sidebar {
		order: -1;
	}
}

.sh-panel__title {
	font-size: 20px;
	font-weight: 600;
	margin: 0 0 16px;
}
.sh-panel__title--spaced {
	margin-top: 32px;
}
.sh-panel__subtitle {
	font-size: 16px;
	font-weight: 600;
	margin: 24px 0 12px;
}

.sh-field,
.sh-field-group {
	margin-bottom: 16px;
}
.sh-field-group--2col {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
}
@media (max-width: 560px) {
	.sh-field-group--2col {
		grid-template-columns: 1fr;
	}
}
.sh-field label,
.sh-field__label {
	display: block;
	font-weight: 500;
	margin-bottom: 6px;
	font-size: 14px;
}
.sh-field input[type="text"],
.sh-field input[type="email"],
.sh-field input[type="tel"],
.sh-field select,
.sh-field textarea {
	width: 100%;
	padding: 11px 14px;
	border: 1px solid var(--sh-border);
	border-radius: var(--sh-radius);
	font-size: 14px;
	background: var(--sh-bg);
	color: var(--sh-text);
	transition: border-color .15s ease;
}
.sh-field input:focus,
.sh-field select:focus,
.sh-field textarea:focus {
	outline: none;
	border-color: var(--sh-primary);
}
.sh-field.has-error input,
.sh-field.has-error select {
	border-color: var(--sh-danger);
}
.sh-field__error {
	color: var(--sh-danger);
	font-size: 12px;
	margin-top: 4px;
}

.sh-field--radio-group {
	display: flex;
	align-items: center;
	gap: 24px;
}
.sh-radio {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-weight: 500;
	cursor: pointer;
}

.sh-checkbox {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin: 14px 0;
	font-size: 14px;
	cursor: pointer;
}
.sh-checkbox input {
	margin-top: 3px;
	width: 16px;
	height: 16px;
	accent-color: var(--sh-primary);
	flex: none;
}
.sh-checkbox a {
	color: var(--sh-primary);
}

/* Buttons */
.sh-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 13px 22px;
	border-radius: var(--sh-radius);
	font-size: 15px;
	font-weight: 600;
	border: 1px solid transparent;
	cursor: pointer;
	transition: background-color .15s ease, opacity .15s ease;
}
.sh-btn--block {
	width: 100%;
}
.sh-btn--primary {
	background: var(--sh-primary);
	color: var(--sh-primary-text);
}
.sh-btn--primary:hover:not(:disabled) {
	background: var(--sh-primary-hover);
}
.sh-btn--primary:disabled {
	opacity: .5;
	cursor: not-allowed;
}
.sh-btn--secondary {
	background: var(--sh-bg-muted);
	color: var(--sh-text);
	border-color: var(--sh-border);
}
.sh-btn--ghost {
	background: transparent;
	color: var(--sh-text);
	border-color: var(--sh-border);
}
.sh-panel__actions {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	margin-top: 24px;
}
.sh-panel__actions .sh-btn--primary {
	flex: 1;
}

/* Option cards (shipping / payment) */
.sh-options {
	display: flex;
	flex-direction: column;
	gap: 10px;
}
.sh-option {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 14px 16px;
	border: 1px solid var(--sh-border);
	border-radius: var(--sh-radius);
	cursor: pointer;
	transition: border-color .15s ease, background-color .15s ease;
}
.sh-option:hover {
	border-color: var(--sh-primary);
}
.sh-option input {
	accent-color: var(--sh-primary);
	width: 16px;
	height: 16px;
	flex: none;
}
.sh-option.is-selected {
	border-color: var(--sh-primary);
	background: color-mix(in srgb, var(--sh-primary) 6%, white);
}
.sh-option__label {
	flex: 1;
	font-weight: 500;
}
.sh-option__desc {
	display: block;
	font-weight: 400;
	color: var(--sh-text-muted);
	font-size: 13px;
	margin-top: 2px;
}
.sh-option__price {
	font-weight: 600;
}

/* Sidebar / order summary */
.sh-checkout__sidebar {
	background: var(--sh-bg);
	border: 1px solid var(--sh-border);
	border-radius: var(--sh-radius);
	padding: 20px;
}
.sh-sidebar__title {
	font-size: 16px;
	font-weight: 600;
	margin: 8px 0 14px;
}
.sh-coupon {
	border: 1px solid var(--sh-primary);
	border-left-width: 4px;
	border-radius: var(--sh-radius);
	padding: 14px 16px;
	margin-bottom: 16px;
}
.sh-coupon__toggle {
	width: 100%;
	background: none;
	border: none;
	display: flex;
	align-items: center;
	gap: 12px;
	cursor: pointer;
	text-align: left;
	color: var(--sh-text);
	padding: 0;
}
.sh-coupon__icon {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: var(--sh-bg-muted);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: var(--sh-primary);
	font-weight: 700;
	flex: none;
}
.sh-coupon__toggle strong {
	display: block;
	color: var(--sh-primary);
	font-size: 14px;
}
.sh-coupon__toggle small {
	display: block;
	color: var(--sh-text-muted);
	font-size: 12px;
}
.sh-coupon__chevron {
	margin-left: auto;
}
.sh-coupon__body {
	display: flex;
	gap: 8px;
	margin-top: 12px;
}
.sh-coupon__body input {
	flex: 1;
	padding: 10px 12px;
	border: 1px solid var(--sh-border);
	border-radius: var(--sh-radius);
}

.sh-cart-item {
	display: flex;
	gap: 12px;
	padding: 14px 0;
	border-bottom: 1px solid var(--sh-border);
}
.sh-cart-item img {
	width: 64px;
	height: 64px;
	object-fit: cover;
	border-radius: calc(var(--sh-radius) - 4px);
	border: 1px solid var(--sh-border);
	flex: none;
}
.sh-cart-item__info {
	flex: 1;
	min-width: 0;
}
.sh-cart-item__name {
	font-size: 14px;
	font-weight: 500;
	margin: 0 0 8px;
}
.sh-cart-item__row {
	display: flex;
	align-items: center;
	justify-content: space-between;
}
.sh-qty {
	display: inline-flex;
	align-items: center;
	border: 1px solid var(--sh-border);
	border-radius: var(--sh-radius);
	overflow: hidden;
}
.sh-qty button {
	width: 30px;
	height: 30px;
	border: none;
	background: var(--sh-bg-muted);
	cursor: pointer;
	font-size: 16px;
	line-height: 1;
}
.sh-qty input {
	width: 40px;
	text-align: center;
	border: none;
	border-left: 1px solid var(--sh-border);
	border-right: 1px solid var(--sh-border);
	height: 30px;
}
.sh-cart-item__remove {
	background: none;
	border: none;
	cursor: pointer;
	color: var(--sh-text-muted);
	font-size: 16px;
}
.sh-cart-item__remove:hover {
	color: var(--sh-danger);
}

.sh-totals {
	margin-top: 8px;
}
.sh-totals__row {
	display: flex;
	justify-content: space-between;
	padding: 10px 0;
	font-size: 14px;
	border-bottom: 1px solid var(--sh-border);
}
.sh-totals__row--total {
	border-bottom: none;
	padding-top: 16px;
	font-size: 18px;
	font-weight: 700;
}
.sh-totals__note {
	color: var(--sh-primary);
	font-size: 13px;
}

.sh-review .sh-cart-item img {
	width: 48px;
	height: 48px;
}
.sh-review__block {
	padding: 14px 0;
	border-bottom: 1px solid var(--sh-border);
}
.sh-review__block:last-child {
	border-bottom: none;
}
.sh-review__label {
	color: var(--sh-text-muted);
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: .03em;
	margin: 0 0 4px;
}
.sh-review__value {
	font-weight: 500;
}

.sh-notice {
	padding: 12px 16px;
	border-radius: var(--sh-radius);
	margin-bottom: 16px;
	font-size: 14px;
}
.sh-notice--error {
	background: #fdecec;
	color: var(--sh-danger);
	border: 1px solid #f5c6c6;
}
.sh-notice--success {
	background: #e9f9f1;
	color: var(--sh-success);
	border: 1px solid #b9ecd3;
}

.sh-muted {
	color: var(--sh-text-muted);
	font-size: 14px;
}

.sh-checkout--empty {
	text-align: center;
	padding: 60px 20px;
}
.sh-checkout--empty .sh-btn {
	margin-top: 16px;
}

.sh-loading-overlay {
	position: absolute;
	inset: 0;
	background: rgba(255, 255, 255, .7);
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: var(--sh-radius);
	z-index: 10;
}
.sh-spinner {
	width: 36px;
	height: 36px;
	border: 3px solid var(--sh-border);
	border-top-color: var(--sh-primary);
	border-radius: 50%;
	animation: sh-spin .8s linear infinite;
}
@keyframes sh-spin {
	to { transform: rotate(360deg); }
}
