/**
 * Solhaga Step Checkout — CSS
 * Clean, modern accordion checkout.
 */

/* ─── Reset & Base ─────────────────────────────── */
#ssc-checkout {
	max-width: 680px;
	margin: 0 auto 60px;
	padding: 0 16px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
	color: #1a1a1a;
}

#ssc-checkout *,
#ssc-checkout *::before,
#ssc-checkout *::after {
	box-sizing: border-box;
}

/* ─── Step Container ───────────────────────────── */
.ssc-step {
	border: 1px solid #e0e0e0;
	border-radius: 12px;
	margin-bottom: 12px;
	background: #fff;
	overflow: hidden;
	transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

.ssc-step--active {
	border-color: #4a7c59;
	box-shadow: 0 2px 12px rgba(74, 124, 89, 0.1);
}

.ssc-step--completed {
	border-color: #c5d9cb;
	background: #fcfdfb;
}

/* ─── Step Header ──────────────────────────────── */
.ssc-step__header {
	display: flex;
	align-items: center;
	padding: 18px 24px;
	gap: 14px;
	cursor: default;
	user-select: none;
}

.ssc-step--completed .ssc-step__header {
	cursor: pointer;
}

.ssc-step__number {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background: #e8e8e8;
	color: #888;
	font-weight: 600;
	font-size: 14px;
	flex-shrink: 0;
	transition: background 0.25s, color 0.25s;
}

.ssc-step--active .ssc-step__number {
	background: #4a7c59;
	color: #fff;
}

.ssc-step--completed .ssc-step__number {
	background: #c5d9cb;
	color: #4a7c59;
}

.ssc-step__title {
	margin: 0;
	font-size: 17px;
	font-weight: 600;
	flex: 1;
	color: #1a1a1a;
}

.ssc-step:not(.ssc-step--active):not(.ssc-step--completed) .ssc-step__title {
	color: #999;
}

.ssc-step__edit {
	font-size: 13px;
	color: #4a7c59;
	font-weight: 500;
	cursor: pointer;
	padding: 4px 12px;
	border-radius: 6px;
	transition: background 0.2s;
}

.ssc-step__edit:hover {
	background: #f0f7f2;
}

.ssc-step__check {
	color: #4a7c59;
	font-size: 18px;
	font-weight: 700;
}

.ssc-step__summary {
	font-size: 13px;
	color: #666;
	margin-left: auto;
}

/* ─── Step Content ─────────────────────────────── */
.ssc-step__content {
	padding: 0 24px 24px;
	animation: ssc-slideDown 0.3s ease;
}

@keyframes ssc-slideDown {
	from {
		opacity: 0;
		transform: translateY(-8px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.ssc-step__description {
	color: #666;
	font-size: 14px;
	margin: 0 0 20px;
	line-height: 1.5;
}

/* ─── Cart Table (Step 1) ──────────────────────── */
.ssc-cart-table {
	width: 100%;
	border-collapse: collapse;
	margin-bottom: 20px;
}

.ssc-cart-table thead th {
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: #999;
	font-weight: 500;
	padding: 0 0 10px;
	border-bottom: 1px solid #eee;
	text-align: left;
}

.ssc-cart-table__qty,
.ssc-cart-table__total {
	text-align: right;
}

.ssc-cart-table__qty {
	width: 60px;
	text-align: center;
}

.ssc-cart-table__total {
	width: 90px;
}

.ssc-cart-item td {
	padding: 14px 0;
	border-bottom: 1px solid #f5f5f5;
	vertical-align: middle;
}

.ssc-cart-item__qty {
	text-align: center;
}

.ssc-cart-item__total {
	text-align: right;
}

.ssc-cart-item:last-child td {
	border-bottom: none;
}

.ssc-cart-item__inner {
	display: flex;
	align-items: center;
	gap: 14px;
}

.ssc-cart-item__thumb img {
	width: 60px;
	height: 60px;
	object-fit: cover;
	border-radius: 8px;
	border: 1px solid #f0f0f0;
}

.ssc-cart-item__name {
	font-weight: 500;
	font-size: 14px;
	display: block;
}

.ssc-cart-item__variation {
	font-size: 12px;
	color: #888;
	display: block;
	margin-top: 2px;
}

.ssc-cart-item__qty {
	text-align: center;
	font-size: 14px;
	color: #666;
}

.ssc-cart-item__total {
	text-align: right;
	font-weight: 500;
	font-size: 14px;
}

/* ─── Order Totals ─────────────────────────────── */
.ssc-order-totals {
	border-top: 2px solid #f0f0f0;
	padding-top: 16px;
	margin-bottom: 20px;
}

.ssc-order-totals__row {
	display: flex;
	justify-content: space-between;
	padding: 6px 0;
	font-size: 14px;
	color: #666;
}

.ssc-order-totals__row--discount {
	color: #c04040;
}

.ssc-order-totals__row--moms {
	font-size: 13px;
	color: #888;
	font-style: italic;
}

.ssc-order-totals__row--vat {
	font-size: 13px;
	color: #888;
}

.ssc-order-totals__row--total {
	border-top: 1px solid #eee;
	margin-top: 8px;
	padding-top: 12px;
	font-size: 18px;
	font-weight: 700;
	color: #1a1a1a;
}

/* ─── Coupon ───────────────────────────────────── */
.ssc-coupon {
	margin-bottom: 20px;
}

.ssc-coupon__toggle {
	font-size: 13px;
	color: #4a7c59;
	cursor: pointer;
	text-decoration: underline;
}

.ssc-coupon__form {
	display: flex;
	gap: 8px;
	margin-top: 10px;
}

.ssc-coupon__input {
	flex: 1;
	padding: 10px 14px;
	border: 1px solid #ddd;
	border-radius: 8px;
	font-size: 14px;
}

.ssc-coupon__apply {
	padding: 10px 20px;
	background: #f5f5f5;
	border: 1px solid #ddd;
	border-radius: 8px;
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	transition: background 0.2s;
}

.ssc-coupon__apply:hover {
	background: #eee;
}

/* ─── Forms (Step 2) ──────────────────────────── */
.ssc-form-row {
	margin-bottom: 16px;
}

.ssc-form-row label {
	display: block;
	font-size: 13px;
	font-weight: 500;
	color: #555;
	margin-bottom: 6px;
}

.ssc-form-row label abbr {
	color: #c04040;
	text-decoration: none;
}

.ssc-input {
	width: 100%;
	padding: 12px 16px;
	border: 1px solid #ddd;
	border-radius: 10px;
	font-size: 15px;
	transition: border-color 0.2s, box-shadow 0.2s;
	outline: none;
}

.ssc-input:focus {
	border-color: #4a7c59;
	box-shadow: 0 0 0 3px rgba(74, 124, 89, 0.12);
}

.ssc-input--error {
	border-color: #c04040;
	box-shadow: 0 0 0 3px rgba(192, 64, 64, 0.1);
}

/* ─── Shipping Methods (Step 3) ────────────────── */
.ssc-shipping-methods {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-bottom: 20px;
}

.ssc-shipping-option {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 16px 18px;
	border: 2px solid #e8e8e8;
	border-radius: 10px;
	cursor: pointer;
	transition: border-color 0.2s, background 0.2s;
}

.ssc-shipping-option:hover {
	border-color: #c5d9cb;
	background: #fcfdfb;
}

.ssc-shipping-option--selected {
	border-color: #4a7c59;
	background: #f6faf7;
}

.ssc-shipping-option input[type="radio"] {
	accent-color: #4a7c59;
	width: 18px;
	height: 18px;
	flex-shrink: 0;
}

.ssc-shipping-option__info {
	flex: 1;
}

.ssc-shipping-option__label {
	font-weight: 500;
	font-size: 15px;
	display: block;
}

.ssc-shipping-option__price {
	font-weight: 600;
	font-size: 15px;
	color: #1a1a1a;
	white-space: nowrap;
}

.ssc-shipping-option__price--free {
	color: #4a7c59;
}

/* ─── Payment Methods (Step 4) ─────────────────── */
.ssc-payment-methods {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-bottom: 24px;
}

.ssc-payment-card {
	display: block;
	cursor: pointer;
}

.ssc-payment-card input[type="radio"] {
	display: none;
}

.ssc-payment-card__inner {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 18px 20px;
	border: 2px solid #e8e8e8;
	border-radius: 10px;
	transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.ssc-payment-card__inner:hover {
	border-color: #c5d9cb;
}

.ssc-payment-card input:checked + .ssc-payment-card__inner {
	border-color: #4a7c59;
	background: #f6faf7;
	box-shadow: 0 2px 8px rgba(74, 124, 89, 0.1);
}

.ssc-payment-card__logo {
	height: 28px;
	width: auto;
	flex-shrink: 0;
}

.ssc-payment-card__logo--swish {
	height: 24px;
}

.ssc-payment-card__label {
	font-weight: 600;
	font-size: 15px;
}

.ssc-payment-card__description {
	font-size: 13px;
	color: #888;
	margin-left: auto;
}

/* ─── Payment Containers ──────────────────────── */
.ssc-payment-container {
	margin-top: 20px;
	animation: ssc-slideDown 0.3s ease;
}

/* ─── Buttons ──────────────────────────────────── */
.ssc-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 14px 28px;
	border: none;
	border-radius: 10px;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.2s, transform 0.1s;
	width: 100%;
}

.ssc-btn:active {
	transform: scale(0.99);
}

.ssc-btn--next {
	background: #4a7c59;
	color: #fff;
}

.ssc-btn--next:hover {
	background: #3d6a4b;
}

.ssc-btn--next:disabled {
	background: #ccc;
	cursor: not-allowed;
}

.ssc-btn--loading {
	position: relative;
	color: transparent;
	pointer-events: none;
}

.ssc-btn--loading::after {
	content: '';
	position: absolute;
	width: 20px;
	height: 20px;
	border: 2px solid rgba(255, 255, 255, 0.3);
	border-top-color: #fff;
	border-radius: 50%;
	animation: ssc-spin 0.6s linear infinite;
}

@keyframes ssc-spin {
	to { transform: rotate(360deg); }
}

/* ─── Loading / Error ─────────────────────────── */
.ssc-loading {
	text-align: center;
	padding: 30px;
	color: #999;
	font-size: 14px;
}

.ssc-error {
	background: #fef2f2;
	border: 1px solid #fca5a5;
	color: #991b1b;
	padding: 12px 16px;
	border-radius: 8px;
	font-size: 14px;
	margin-bottom: 16px;
}

/* ─── WooCommerce form overrides (Step 4 Swish) ── */
#ssc-swish-container .woocommerce-billing-fields h3,
#ssc-swish-container .woocommerce-shipping-fields h3 {
	font-size: 16px;
	font-weight: 600;
	margin-bottom: 16px;
}

#ssc-swish-container .woocommerce-input-wrapper input,
#ssc-swish-container .woocommerce-input-wrapper textarea,
#ssc-swish-container .woocommerce-input-wrapper select {
	border-radius: 10px;
	border: 1px solid #ddd;
	padding: 12px 14px;
	font-size: 14px;
}

#ssc-swish-container .woocommerce-input-wrapper input:focus,
#ssc-swish-container .woocommerce-input-wrapper select:focus {
	border-color: #4a7c59;
	box-shadow: 0 0 0 3px rgba(74, 124, 89, 0.12);
	outline: none;
}

/* Pre-fill email & postcode in WC form */
#ssc-swish-container #billing_email_field,
#ssc-swish-container #billing_postcode_field {
	/* These get auto-filled from step 2 values */
}

/* ─── Responsive ──────────────────────────────── */
@media (max-width: 600px) {
	#ssc-checkout {
		padding: 0 10px;
	}

	.ssc-step__header {
		padding: 14px 16px;
	}

	.ssc-step__content {
		padding: 0 16px 20px;
	}

	.ssc-step__title {
		font-size: 15px;
	}

	.ssc-cart-item__thumb img {
		width: 48px;
		height: 48px;
	}

	.ssc-payment-card__description {
		display: none;
	}

	.ssc-payment-card__inner {
		padding: 14px 16px;
	}
}

/* ─── Swish step: hide duplicate/unnecessary elements ── */

/* Hide "Ship to different address" — not needed, billing = shipping */
#ssc-wc-checkout-form .woocommerce-shipping-fields,
#ssc-wc-checkout-form #ship-to-different-address {
	display: none !important;
}

/* Hide only the payment method radio buttons and labels — keep the active payment description/box */
#ssc-wc-checkout-form ul.payment_methods > li > input[type="radio"],
#ssc-wc-checkout-form ul.payment_methods > li > label {
	display: none !important;
}

/* But keep the payment_box (Swish info, number field etc) visible */
#ssc-wc-checkout-form ul.payment_methods > li .payment_box {
	display: block !important;
}

/* Hide non-Swish payment methods entirely */
#ssc-wc-checkout-form ul.payment_methods > li.payment_method_kco {
	display: none !important;
}

/* Keep the order review table visible in Swish step — customer needs to see totals + shipping */

/* ─── Hide WooCommerce default coupon notice above checkout ── */
.woocommerce-form-coupon-toggle,
.checkout_coupon.woocommerce-form-coupon {
	display: none !important;
}
