/*
 * Rahma Ice — WooCommerce Design
 * WooCommerce Cart and Checkout Blocks
 *
 * This layer deliberately targets WooCommerce's public component classes and
 * high-level block wrappers. It avoids altering the Blocks DOM or checkout
 * behaviour, which keeps the design compatible with WooCommerce updates.
 */

.riwc-active .wc-block-cart,
.riwc-active .wc-block-checkout {
	--riwc-block-border: 2px solid var(--riwc-black);
	--riwc-block-radius: 20px;
	color: var(--riwc-black);
	font-family: var(--riwc-font-body);
}

.riwc-active .wc-block-components-sidebar-layout {
	align-items: flex-start;
	gap: clamp(24px, 4vw, 54px);
}

.riwc-active .wc-block-components-sidebar-layout .wc-block-components-main {
	margin: 0;
	padding-right: 0;
}

.riwc-active .wc-block-components-sidebar-layout .wc-block-components-sidebar {
	background: var(--riwc-cream);
	border: var(--riwc-block-border);
	border-radius: var(--riwc-block-radius);
	box-shadow: var(--riwc-shadow-small);
	margin: 0;
	overflow: hidden;
	padding: clamp(20px, 3vw, 30px);
	position: sticky;
	top: 28px;
}

.riwc-active .wc-block-components-title,
.riwc-active .wc-block-components-checkout-step__title,
.riwc-active .wc-block-components-order-summary__button-text,
.riwc-active .wc-block-cart__totals-title,
.riwc-active .wc-block-components-totals-wrapper .wc-block-components-totals-item__label,
.riwc-active .wc-block-components-totals-footer-item .wc-block-components-totals-item__label {
	color: var(--riwc-black);
	font-family: var(--riwc-font-heading);
	font-weight: 400;
	letter-spacing: .01em;
}

.riwc-active .wc-block-components-title,
.riwc-active .wc-block-cart__totals-title {
	font-size: clamp(1.65rem, 3vw, 2.25rem);
	line-height: 1.05;
}

.riwc-active .wc-block-components-checkout-step {
	background: #fff;
	border: var(--riwc-block-border);
	border-radius: var(--riwc-block-radius);
	box-shadow: var(--riwc-shadow-small);
	margin-bottom: 24px;
	padding: clamp(22px, 4vw, 34px);
}

.riwc-active .wc-block-components-checkout-step__heading {
	margin-bottom: 20px;
}

.riwc-active .wc-block-components-checkout-step__title {
	font-size: clamp(1.35rem, 2.5vw, 1.8rem);
	line-height: 1.1;
}

.riwc-active .wc-block-components-checkout-step__description,
.riwc-active .wc-block-components-formatted-money-amount,
.riwc-active .wc-block-components-product-metadata,
.riwc-active .wc-block-components-product-details,
.riwc-active .wc-block-components-address-card,
.riwc-active .wc-block-components-address-form,
.riwc-active .wc-block-components-checkbox,
.riwc-active .wc-block-components-radio-control {
	color: var(--riwc-text);
	font-family: var(--riwc-font-body);
}

/* Inputs and accessible focus states. */
.riwc-active .wc-block-components-text-input input,
.riwc-active .wc-block-components-combobox .wc-block-components-combobox-control input.components-combobox-control__input,
.riwc-active .wc-block-components-address-form select,
.riwc-active .wc-block-components-select .wc-block-components-select__select,
.riwc-active .wc-block-components-textarea {
	background: #fff;
	border: 2px solid #cfc7b6;
	border-radius: 12px;
	box-shadow: none;
	color: var(--riwc-black);
	font-family: var(--riwc-font-body);
	min-height: 52px;
	transition: border-color .2s ease, box-shadow .2s ease;
}

.riwc-active .wc-block-components-text-input input:focus,
.riwc-active .wc-block-components-combobox .wc-block-components-combobox-control input.components-combobox-control__input:focus,
.riwc-active .wc-block-components-address-form select:focus,
.riwc-active .wc-block-components-select .wc-block-components-select__select:focus,
.riwc-active .wc-block-components-textarea:focus {
	border-color: var(--riwc-orange);
	box-shadow: 0 0 0 3px rgb(251 95 1 / 18%);
	outline: 0;
}

.riwc-active .wc-block-components-text-input label,
.riwc-active .wc-block-components-combobox .wc-block-components-combobox-control label.components-base-control__label,
.riwc-active .wc-block-components-select .wc-block-components-select__label {
	color: #554d40;
	font-family: var(--riwc-font-body);
	font-weight: 800;
}

.riwc-active .wc-block-components-checkbox .wc-block-components-checkbox__input[type="checkbox"] {
	border: 2px solid var(--riwc-black);
	border-radius: 5px;
}

.riwc-active .wc-block-components-checkbox .wc-block-components-checkbox__input[type="checkbox"]:checked {
	background: var(--riwc-orange);
	border-color: var(--riwc-orange);
}

.riwc-active .wc-block-components-radio-control__input[type="radio"]:checked {
	border-color: var(--riwc-orange);
}

.riwc-active .wc-block-components-radio-control__input[type="radio"]:checked::before {
	background: var(--riwc-orange);
}

/* Buttons. */
.riwc-active .wc-block-components-button,
.riwc-active .wc-block-cart__submit-button,
.riwc-active .wc-block-checkout__actions_row .wc-block-components-checkout-place-order-button {
	align-items: center;
	background: var(--riwc-black);
	border: 2px solid var(--riwc-black);
	border-radius: 12px;
	box-shadow: 4px 4px 0 var(--riwc-orange);
	color: #fff;
	font-family: var(--riwc-font-body);
	font-size: .96rem;
	font-weight: 900;
	justify-content: center;
	letter-spacing: .01em;
	min-height: 52px;
	padding: 13px 22px;
	text-decoration: none;
	transition: background-color .2s ease, color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.riwc-active .wc-block-components-button:hover,
.riwc-active .wc-block-cart__submit-button:hover,
.riwc-active .wc-block-checkout__actions_row .wc-block-components-checkout-place-order-button:hover {
	background: var(--riwc-yellow);
	color: var(--riwc-black);
	transform: translate(-1px, -1px);
}

.riwc-active .wc-block-components-button:focus-visible,
.riwc-active .wc-block-cart__submit-button:focus-visible,
.riwc-active .wc-block-checkout__actions_row .wc-block-components-checkout-place-order-button:focus-visible {
	box-shadow: 0 0 0 4px rgb(253 207 1 / 45%), 4px 4px 0 var(--riwc-orange);
	outline: 2px solid var(--riwc-black);
	outline-offset: 3px;
}

.riwc-active .wc-block-components-button:disabled,
.riwc-active .wc-block-components-button[aria-disabled="true"] {
	box-shadow: none;
	cursor: not-allowed;
	opacity: .58;
	transform: none;
}

/* Cart line items. */
.riwc-active .wc-block-cart-items {
	border-collapse: separate;
	border-spacing: 0 16px;
	margin-top: -16px;
}

.riwc-active .wc-block-cart-items thead {
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	overflow: hidden;
	position: absolute;
	width: 1px;
}

.riwc-active .wc-block-cart-items tbody tr {
	background: #fff;
	border-radius: var(--riwc-block-radius);
	box-shadow: var(--riwc-shadow-small);
}

.riwc-active .wc-block-cart-items td {
	border-bottom: var(--riwc-block-border);
	border-top: var(--riwc-block-border);
	padding-bottom: clamp(18px, 3vw, 26px);
	padding-top: clamp(18px, 3vw, 26px);
}

.riwc-active .wc-block-cart-items td:first-child {
	border-left: var(--riwc-block-border);
	border-radius: var(--riwc-block-radius) 0 0 var(--riwc-block-radius);
	padding-left: clamp(18px, 3vw, 26px);
}

.riwc-active .wc-block-cart-items td:last-child {
	border-radius: 0 var(--riwc-block-radius) var(--riwc-block-radius) 0;
	border-right: var(--riwc-block-border);
	padding-right: clamp(18px, 3vw, 26px);
}

.riwc-active .wc-block-cart-item__image img,
.riwc-active .wc-block-components-order-summary-item__image img {
	background: var(--riwc-cream);
	border: 2px solid var(--riwc-black);
	border-radius: 14px;
}

.riwc-active .wc-block-components-product-name {
	color: var(--riwc-black);
	font-family: var(--riwc-font-heading);
	font-size: clamp(1.12rem, 2vw, 1.4rem);
	font-weight: 400;
	line-height: 1.1;
	text-decoration: none;
}

.riwc-active a.wc-block-components-product-name:hover {
	color: var(--riwc-orange);
}

.riwc-active .wc-block-cart-item__prices,
.riwc-active .wc-block-components-product-price,
.riwc-active .wc-block-components-order-summary-item__individual-prices {
	font-weight: 900;
}

.riwc-active .wc-block-components-quantity-selector {
	background: #fff;
	border: 2px solid var(--riwc-black);
	border-radius: 10px;
	box-shadow: none;
	height: 44px;
}

.riwc-active .wc-block-components-quantity-selector input.wc-block-components-quantity-selector__input {
	color: var(--riwc-black);
	font-family: var(--riwc-font-body);
	font-weight: 900;
}

.riwc-active .wc-block-components-quantity-selector button {
	color: var(--riwc-black);
}

.riwc-active .wc-block-components-quantity-selector button:hover {
	background: var(--riwc-yellow);
}

.riwc-active .wc-block-cart-item__remove-link,
.riwc-active .wc-block-components-product-metadata__description a {
	color: #7a3320;
	font-weight: 800;
	text-decoration-thickness: 2px;
	text-underline-offset: 3px;
}

.riwc-active .wc-block-cart-item__remove-link:hover,
.riwc-active .wc-block-components-product-metadata__description a:hover {
	color: var(--riwc-orange);
}

/* Order summaries, totals and coupons. */
.riwc-active .wc-block-components-order-summary,
.riwc-active .wc-block-components-totals-wrapper {
	border-color: #d8d0c0;
}

.riwc-active .wc-block-components-order-summary__content {
	padding-right: 6px;
}

.riwc-active .wc-block-components-order-summary-item {
	border-bottom: 1px solid #d8d0c0;
	padding-bottom: 18px;
	padding-top: 18px;
}

.riwc-active .wc-block-components-order-summary-item:last-child {
	border-bottom: 0;
}

.riwc-active .wc-block-components-order-summary-item__quantity {
	background: var(--riwc-orange);
	border: 2px solid var(--riwc-black);
	box-shadow: 2px 2px 0 var(--riwc-yellow);
	color: #fff;
	font-weight: 900;
}

.riwc-active .wc-block-components-totals-item {
	color: var(--riwc-text);
	font-weight: 700;
}

.riwc-active .wc-block-components-totals-item__value {
	color: var(--riwc-black);
	font-weight: 900;
}

.riwc-active .wc-block-components-totals-footer-item {
	border-top: 2px solid var(--riwc-black);
	font-size: 1.16rem;
	margin-top: 12px;
	padding-top: 18px;
}

.riwc-active .wc-block-components-panel__button,
.riwc-active .wc-block-components-totals-coupon-link {
	color: var(--riwc-black);
	font-family: var(--riwc-font-body);
	font-weight: 900;
	text-decoration-color: var(--riwc-orange);
	text-decoration-thickness: 3px;
	text-underline-offset: 4px;
}

.riwc-active .wc-block-components-panel__button:hover,
.riwc-active .wc-block-components-totals-coupon-link:hover {
	color: var(--riwc-orange);
}

.riwc-active .wc-block-components-totals-coupon__form {
	gap: 12px;
}

.riwc-active .wc-block-components-totals-coupon__button {
	box-shadow: 3px 3px 0 var(--riwc-orange);
	min-height: 52px;
}

/* Shipping, payment and address cards. */
.riwc-active .wc-block-components-shipping-rates-control,
.riwc-active .wc-block-components-radio-control,
.riwc-active .wc-block-components-address-card,
.riwc-active .wc-block-checkout__payment-method .wc-block-components-radio-control-accordion-option,
.riwc-active .wc-block-checkout__shipping-method-option {
	background: var(--riwc-cream);
	border: 2px solid #d5cbb8;
	border-radius: 14px;
}

.riwc-active .wc-block-components-radio-control-accordion-option--checked-option-highlighted,
.riwc-active .wc-block-checkout__shipping-method-option--selected {
	border-color: var(--riwc-orange);
	box-shadow: 0 0 0 3px rgb(251 95 1 / 15%);
}

.riwc-active .wc-block-components-address-card {
	padding: 18px;
}

.riwc-active .wc-block-components-address-card__edit {
	color: var(--riwc-orange);
	font-weight: 900;
}

.riwc-active .wc-block-components-checkout-return-to-cart-button {
	color: var(--riwc-black);
	font-weight: 900;
	text-decoration-color: var(--riwc-orange);
	text-decoration-thickness: 3px;
	text-underline-offset: 4px;
}

.riwc-active .wc-block-components-checkout-return-to-cart-button:hover {
	color: var(--riwc-orange);
}

/* Block notices and validation. */
.riwc-active .wc-block-components-notice-banner {
	background: #fff;
	border: 2px solid var(--riwc-black);
	border-radius: 12px;
	box-shadow: 4px 4px 0 var(--riwc-yellow);
	color: var(--riwc-black);
	font-family: var(--riwc-font-body);
	font-weight: 700;
	margin-bottom: 22px;
}

.riwc-active .wc-block-components-notice-banner.is-error {
	box-shadow: 4px 4px 0 #d93333;
}

.riwc-active .wc-block-components-validation-error {
	color: #a52b1d;
	font-weight: 800;
}

/* Empty cart state and cross-sells. */
.riwc-active .wp-block-woocommerce-empty-cart-block {
	background: #fff;
	border: 2px solid var(--riwc-black);
	border-radius: 24px;
	box-shadow: 8px 8px 0 var(--riwc-yellow);
	margin: 0 auto;
	max-width: 900px;
	padding: clamp(38px, 7vw, 82px) clamp(20px, 5vw, 60px);
	text-align: center;
}

.riwc-active .wp-block-woocommerce-empty-cart-block .wp-block-heading {
	font-family: var(--riwc-font-heading);
	font-weight: 400;
}

.riwc-active .wp-block-woocommerce-cart-cross-sells-block {
	margin-top: clamp(48px, 7vw, 82px);
}

.riwc-active .wp-block-woocommerce-cart-cross-sells-block > h2 {
	font-family: var(--riwc-font-heading);
	font-size: clamp(2rem, 5vw, 3.5rem);
	font-weight: 400;
	text-align: center;
}

@media (max-width: 900px) {
	.riwc-active .wc-block-components-sidebar-layout {
		display: block;
	}

	.riwc-active .wc-block-components-sidebar-layout .wc-block-components-main,
	.riwc-active .wc-block-components-sidebar-layout .wc-block-components-sidebar {
		width: 100%;
	}

	.riwc-active .wc-block-components-sidebar-layout .wc-block-components-sidebar {
		margin-top: 30px;
		position: static;
	}
}

@media (max-width: 700px) {
	.riwc-active .wc-block-components-checkout-step {
		border-radius: 16px;
		padding: 20px 16px;
	}

	.riwc-active .wc-block-components-sidebar-layout .wc-block-components-sidebar {
		border-radius: 16px;
		padding: 20px 16px;
	}

	.riwc-active .wc-block-cart-items tbody tr {
		border: var(--riwc-block-border);
		border-radius: 16px;
		display: grid;
		grid-template-columns: 96px minmax(0, 1fr);
		padding: 16px;
	}

	.riwc-active .wc-block-cart-items td,
	.riwc-active .wc-block-cart-items td:first-child,
	.riwc-active .wc-block-cart-items td:last-child {
		border: 0;
		border-radius: 0;
		padding: 0;
	}

	.riwc-active .wc-block-cart-items .wc-block-cart-item__image {
		grid-column: 1;
		grid-row: 1 / span 2;
		padding-right: 14px;
	}

	.riwc-active .wc-block-cart-items .wc-block-cart-item__product,
	.riwc-active .wc-block-cart-items .wc-block-cart-item__total {
		grid-column: 2;
	}

	.riwc-active .wc-block-cart-items .wc-block-cart-item__total {
		margin-top: 12px;
		text-align: left;
	}

	.riwc-active .wc-block-components-totals-coupon__form {
		align-items: stretch;
		flex-direction: column;
	}

	.riwc-active .wc-block-components-totals-coupon__button {
		width: 100%;
	}

	.riwc-active .wc-block-checkout__actions {
		background: #fff;
		border-top: 2px solid var(--riwc-black);
		box-shadow: 0 -8px 24px rgb(0 0 0 / 10%);
		margin: 20px -16px -20px;
		padding: 16px;
	}

	.riwc-active .wc-block-checkout__actions_row {
		gap: 12px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.riwc-active .wc-block-components-button,
	.riwc-active .wc-block-cart__submit-button,
	.riwc-active .wc-block-checkout__actions_row .wc-block-components-checkout-place-order-button {
		transition: none;
	}
}

@media print {
	.riwc-active .wc-block-components-sidebar-layout .wc-block-components-sidebar,
	.riwc-active .wc-block-components-checkout-step,
	.riwc-active .wc-block-cart-items tbody tr {
		box-shadow: none;
	}
}
