/*
 * Checkout Flow — base styles.
 * Colors/typography here are FALLBACK defaults; the Elementor Style tab
 * controls (see class-rudcf-widget.php) override the same properties with
 * higher specificity ({{WRAPPER}} prefix), so nothing here uses CSS custom
 * properties for anything editable in the panel.
 */

.rudcf-flow {
	--rudcf-radius: 2px;
	color-scheme: dark;
	background-color: #0d0d0d;
	color: #f5f5f2;
	font-size: 13px;
	line-height: 1.6;
	padding: 32px clamp(16px, 4vw, 48px);
}

.rudcf-flow * {
	box-sizing: border-box;
}

.rudcf-flow a {
	color: inherit;
}

.rudcf-flow button {
	/* Buttons do NOT inherit font/color from the UA stylesheet by default,
	   and :disabled buttons in particular get extra native chrome (a light
	   "ButtonFace" background + dimmed text) that plain `background: none`
	   does not reliably clear — this is what produced the gray/white boxes
	   instead of styled tabs. `appearance: none` plus explicit resets on
	   every state (including :disabled) is the correct, standard fix.
	   box-sizing is forced here too (safe as a blanket rule — nothing in
	   this widget wants a different value): without it, native button
	   padding can add to an explicit width/height instead of being
	   contained within it, which is exactly what turned the circular
	   remove button into an oval. Padding itself is intentionally NOT
	   reset here, since .rudcf-btn and .rudcf-tabs__item both rely on
	   their own explicit padding — it's reset individually on
	   .rudcf-cart-item__remove below instead, the one button that needs
	   zero padding for its shape to hold. */
	appearance: none;
	-webkit-appearance: none;
	-moz-appearance: none;
	font: inherit;
	margin: 0;
	box-sizing: border-box !important;
}

/* ---------- Tabs ---------- */

.rudcf-tabs {
	display: flex;
	gap: 32px;
	border-bottom: 1px solid rgba(245, 245, 242, 0.14);
	padding-bottom: 16px;
	margin-bottom: 32px;
}

.rudcf-tabs__item,
.rudcf-tabs__item:disabled {
	background-color: transparent !important;
	background-image: none !important;
	border: none !important;
	border-bottom: 2px solid transparent !important;
	box-shadow: none !important;
	color: #8a8a86;
	-webkit-text-fill-color: currentColor; /* Safari forces its own disabled text color otherwise */
	/* !important: confirmed same root cause as background/border above —
	   the theme's own button font-size wins on "Cart" (the one enabled,
	   clickable tab) while the disabled Shipping/Payment tabs happen to
	   take a different cascade path and render at our intended size,
	   producing a visible size mismatch between them. */
	font-size: 11px !important;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	padding: 0 0 15px;
	margin-bottom: -17px;
	cursor: pointer;
}

.rudcf-tabs__item:disabled {
	cursor: not-allowed;
	opacity: 0.45;
}

.rudcf-tabs__item.is-active {
	color: #f5f5f2;
	border-bottom-color: #f5f5f2 !important;
}

/* ---------- Steps ---------- */

.rudcf-step {
	display: none;
}

.rudcf-step.is-active {
	display: block;
}

/* ---------- Buttons ---------- */

.rudcf-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	border: 1px solid transparent;
	border-radius: 999px;
	padding: 14px 24px;
	font-size: 11px;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	cursor: pointer;
	transition: opacity 0.15s ease;
}

.rudcf-btn:hover {
	opacity: 0.85;
}

.rudcf-btn--confirm {
	background-color: #f5f5f2;
	color: #0d0d0d;
	border-color: #f5f5f2;
}

.rudcf-btn--confirm:hover {
	background-color: #d8d8d3;
	border-color: #d8d8d3;
	color: #0d0d0d;
	opacity: 1;
}

.rudcf-btn--outline {
	background: transparent;
	border-color: rgba(245, 245, 242, 0.3);
	color: #f5f5f2;
}

/* ---------- Cart step ---------- */

.rudcf-cart-layout {
	display: grid;
	grid-template-columns: 1fr 340px;
	gap: 48px;
	align-items: start;
}

.rudcf-cart-items {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
	gap: 32px;
}

.rudcf-cart-item {
	position: relative;
	border-bottom: 1px solid rgba(245, 245, 242, 0.14);
	padding-bottom: 16px;
}

.rudcf-cart-item__image {
	background: #1a1a1a;
	aspect-ratio: 3 / 4;
	overflow: hidden;
	margin-bottom: 12px;
}

.rudcf-cart-item__image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.rudcf-cart-item__remove {
	position: absolute;
	top: 10px !important;
	right: 10px !important;
	z-index: 2;
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	width: 24px !important;
	height: 24px !important;
	padding: 0 !important;
	border: none !important;
	border-radius: 50% !important;
	background: rgba(13, 13, 13, 0.7);
	color: #f5f5f2;
	font-size: 16px;
	line-height: 1;
	cursor: pointer;
}

.rudcf-cart-item__title {
	font-size: 11px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	font-weight: 600;
}

.rudcf-cart-item__subtitle {
	font-size: 12px;
	color: #8a8a86;
	margin-top: 2px;
}

.rudcf-cart-item__price {
	font-size: 12px;
	margin-top: 8px;
}

.rudcf-empty-cart {
	text-align: center;
	padding: 64px 0;
}

/* ---------- Order summary card ---------- */

.rudcf-order-summary {
	border: 1px solid rgba(245, 245, 242, 0.14);
	padding: 24px;
}

.rudcf-order-summary__title {
	font-size: 11px;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	margin: 0 0 20px;
}

.rudcf-summary-row {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	padding: 10px 0;
	border-top: 1px solid rgba(245, 245, 242, 0.14);
	font-size: 12px;
}

.rudcf-summary-row:first-of-type {
	border-top: none;
}

.rudcf-summary-row--total {
	font-weight: 600;
	font-size: 13px;
}

.rudcf-summary-row small {
	color: #8a8a86;
	font-weight: 400;
}

.rudcf-terms-check {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	font-size: 11px;
	color: #8a8a86;
	margin: 18px 0;
	cursor: pointer;
}

.rudcf-terms-check input {
	margin-top: 2px;
}

.rudcf-order-summary .rudcf-btn {
	margin-top: 8px;
}

/* ---------- Shipping step ---------- */

.rudcf-shipping-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 64px;
	align-items: start;
}

.rudcf-field-group {
	margin-bottom: 28px;
}

.rudcf-field-group__title {
	font-size: 11px;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: #8a8a86;
	margin: 0 0 14px;
}

.rudcf-field-grid {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}

.rudcf-flow .form-row {
	margin: 0 0 12px;
	width: 100%;
}

.rudcf-flow .rudcf-field-half {
	width: calc(50% - 6px);
}

.rudcf-flow .rudcf-field-half.form-row-first,
.rudcf-flow .rudcf-field-half.form-row-last {
	width: calc(50% - 6px);
}

/* Screen-reader-only labels: placeholders carry the visible label text
   (see class-rudcf-fields.php), matching the borderless minimal mockup,
   while the real <label> stays for accessibility. */
.rudcf-flow .form-row label:not(.woocommerce-form__label-for-checkbox) {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

.rudcf-flow input[type="text"],
.rudcf-flow input[type="email"],
.rudcf-flow input[type="tel"],
.rudcf-flow input[type="password"],
.rudcf-flow select,
.rudcf-flow .select2-selection,
.rudcf-flow .woocommerce-form-coupon input,
.rudcf-flow #coupon_code {
	/* !important here for the same reason as the tabs and remove-button
	   fixes: WooCommerce can inject the active theme's own element class
	   onto inputs/buttons (see wc_wp_theme_get_element_class_name(), used
	   on the coupon "Apply" button), and that theme styling otherwise wins
	   over a plain, non-important declaration regardless of our own
	   selector's specificity. */
	width: 100% !important;
	background: transparent !important;
	border: 1px solid rgba(245, 245, 242, 0.14) !important;
	border-radius: var(--rudcf-radius) !important;
	color: #f5f5f2 !important;
	padding: 14px 16px !important;
	font-size: 12px;
}

.rudcf-flow select {
	appearance: none;
}

.rudcf-flow .select2-selection {
	display: flex;
	align-items: center;
}

.rudcf-flow .select2-selection__rendered {
	padding: 0 !important;
	line-height: normal !important;
	color: inherit;
}

.rudcf-flow .select2-selection__arrow {
	height: 100% !important;
	right: 14px !important;
}

.rudcf-flow .select2-selection__arrow b {
	border-color: #8a8a86 transparent transparent transparent !important;
}

.rudcf-flow .select2-container--open .select2-selection__arrow b {
	border-color: transparent transparent #8a8a86 transparent !important;
}

/*
 * Select2 renders its open dropdown list appended to <body> by default —
 * NOT inside this widget's own wrapper element — so it is structurally
 * unreachable by any {{WRAPPER}}-scoped Elementor Style control (same class
 * of issue as any other overlay/fullscreen element appended outside a
 * widget's box). Styled globally here as a functional dark-theme fix rather
 * than left with Select2's default white popup; not exposed as a per-
 * instance panel control since one genuinely can't reach it.
 */
.select2-dropdown {
	background-color: #17171a;
	border-color: rgba(245, 245, 242, 0.14);
}

.select2-container--default .select2-search--dropdown .select2-search__field {
	background-color: transparent;
	border-color: rgba(245, 245, 242, 0.14);
	color: #f5f5f2;
}

.select2-container--default .select2-results__option {
	color: #f5f5f2;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
	background-color: #f5f5f2;
	color: #0d0d0d;
}

.select2-container--default .select2-results__option[aria-selected="true"] {
	background-color: rgba(245, 245, 242, 0.14);
}

.rudcf-step-actions {
	margin-top: 24px;
	max-width: 320px;
}

.rudcf-info-panel {
	border-left: 1px solid rgba(245, 245, 242, 0.14);
	padding-left: 32px;
}

.rudcf-info-panel__heading {
	font-size: 13px;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	margin: 0 0 20px;
}

.rudcf-info-panel__block {
	margin-bottom: 20px;
	font-size: 11px;
	letter-spacing: 0.02em;
	color: #cfcfca;
}

.rudcf-info-panel__block-title {
	text-transform: uppercase;
	letter-spacing: 0.1em;
	color: #f5f5f2;
	font-weight: 600;
	margin: 0 0 6px;
}

.rudcf-shipping-note {
	color: #8a8a86;
	font-size: 12px;
}

/* ---------- Payment step ---------- */

#order_review.woocommerce-checkout-review-order {
	max-width: 560px;
	margin: 0 auto;
}

.rudcf-order-summary + .rudcf-payment,
.woocommerce-checkout-review-order-table + .rudcf-payment {
	margin-top: 32px;
}

.rudcf-payment__title {
	font-size: 11px;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	margin: 0 0 16px;
}

.rudcf-payment-methods {
	list-style: none;
	margin: 0 0 24px;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.wc_payment_method {
	border: 1px solid rgba(245, 245, 242, 0.14);
	border-radius: var(--rudcf-radius);
	padding: 14px 16px;
}

.wc_payment_method input.input-radio {
	margin-right: 8px;
}

.wc_payment_method label {
	font-size: 12px;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	cursor: pointer;
}

.payment_box {
	margin-top: 12px;
	padding-top: 12px;
	border-top: 1px solid rgba(245, 245, 242, 0.1);
	font-size: 12px;
	color: #cfcfca;
}

.rudcf-shipping-block {
	width: 100%;
}

.rudcf-shipping-block__label {
	font-size: 10px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #8a8a86;
	margin-bottom: 6px;
}

.rudcf-shipping-methods {
	list-style: none;
	margin: 0;
	padding: 0;
	text-align: right;
}

.rudcf-shipping-methods li {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.woocommerce-terms-and-conditions-wrapper {
	margin: 16px 0;
	font-size: 11px;
	color: #8a8a86;
}

/* ---------- Coupon form (Cart step) ---------- */

.rudcf-flow .woocommerce-form-coupon-toggle {
	margin-top: 24px;
}

.rudcf-flow .woocommerce-form-coupon-toggle .woocommerce-info {
	margin: 0;
}

.rudcf-flow .showcoupon {
	color: #f5f5f2;
	text-decoration: underline;
}

.rudcf-flow form.checkout_coupon.woocommerce-form-coupon {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	gap: 12px;
	margin-top: 12px;
	padding: 20px;
	border: 1px solid rgba(245, 245, 242, 0.14);
}

.rudcf-flow form.checkout_coupon.woocommerce-form-coupon > p.form-row {
	margin: 0;
	width: auto;
}

.rudcf-flow form.checkout_coupon.woocommerce-form-coupon > p.form-row-first {
	flex: 1 1 240px;
}

/* The "If you have a coupon code..." helper line WooCommerce prints isn't
   part of this design — hidden rather than left as stray unstyled text. */
.rudcf-flow form.checkout_coupon.woocommerce-form-coupon > p:not(.form-row) {
	display: none;
}

.rudcf-flow .woocommerce-form-coupon button[name="apply_coupon"] {
	/* !important: WooCommerce adds the active theme's own button element
	   class to this specific button (wc_wp_theme_get_element_class_name()),
	   which otherwise overrides plain declarations here regardless of our
	   selector's specificity — same root cause as the tabs and remove-
	   button fixes. */
	width: auto !important;
	background: transparent !important;
	border: 1px solid rgba(245, 245, 242, 0.3) !important;
	border-radius: 999px !important;
	color: #f5f5f2 !important;
	padding: 14px 24px !important;
	font-size: 11px;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	cursor: pointer;
}

.rudcf-flow .woocommerce-form-coupon button[name="apply_coupon"]:hover {
	opacity: 0.85;
}

.rudcf-btn--place-order {
	margin-top: 8px;
}

/* WooCommerce core notices, restyled to fit the dark theme */
.rudcf-flow .woocommerce-error,
.rudcf-flow .woocommerce-message,
.rudcf-flow .woocommerce-info {
	list-style: none;
	border: 1px solid rgba(245, 245, 242, 0.3);
	background: rgba(245, 245, 242, 0.06);
	color: #f5f5f2;
	padding: 12px 16px;
	margin: 0 0 20px;
	font-size: 12px;
}

.rudcf-flow .blockUI.blockOverlay {
	background: rgba(13, 13, 13, 0.6) !important;
}

/* ---------- Validation states ---------- */

.rudcf-flow .form-row.woocommerce-invalid input,
.rudcf-flow .form-row.woocommerce-invalid select {
	border-color: #e0655b;
}

.rudcf-terms-check.rudcf-error {
	color: #e0655b;
}

.rudcf-terms-check.rudcf-error span {
	color: #e0655b;
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
	.rudcf-cart-layout,
	.rudcf-shipping-grid {
		grid-template-columns: 1fr;
		gap: 32px;
	}

	.rudcf-info-panel {
		border-left: none;
		border-top: 1px solid rgba(245, 245, 242, 0.14);
		padding-left: 0;
		padding-top: 24px;
	}

	.rudcf-tabs {
		gap: 16px;
		overflow-x: auto;
	}
}
