/**
 * Danos Checkout Styles
 *
 * @package DanosClick\Subscriptions
 */

/* Custom checkout fields */
.woocommerce-billing-fields .form-row-wide {
	margin-bottom: 1rem;
}

.woocommerce-billing-fields #billing_business_name_field,
.woocommerce-billing-fields #billing_contact_name_field {
	clear: both;
}

/* Order details custom fields */
.woocommerce-customer-details .woocommerce-column__title {
	font-size: 1.2em;
	margin-top: 2em;
	margin-bottom: 0.5em;
}

.woocommerce-customer-details address p {
	margin: 0.5em 0;
}

/* Cart item meta */
.woocommerce-cart-form dl.variation,
.woocommerce-checkout-review-order dl.variation {
	margin-top: 0.5em;
	font-size: 0.9em;
}

.woocommerce-cart-form dl.variation dt,
.woocommerce-checkout-review-order dl.variation dt {
	font-weight: 600;
	margin-right: 0.5em;
}

.woocommerce-cart-form dl.variation dd,
.woocommerce-checkout-review-order dl.variation dd {
	margin: 0 0 0.5em;
}

/* Hide payment section when no gateways available (free trial) */
.woocommerce-checkout #payment:has(ul.payment_methods:empty),
.woocommerce-checkout #payment:not(:has(ul.payment_methods li)) {
	display: none !important;
}

/* Alternative for browsers that don't support :has() */
.woocommerce-checkout #payment ul.payment_methods:empty {
	display: none !important;
}

.woocommerce-checkout #payment ul.payment_methods:empty+.form-row {
	display: none !important;
}

/* Checkout Blocks - Botón de realizar pedido con texto blanco */
.wc-block-components-checkout-place-order-button,
.wc-block-components-button.wc-block-components-checkout-place-order-button {
	color: #ffffff !important;
}

.wc-block-components-checkout-place-order-button .wc-block-components-button__text,
.wc-block-components-checkout-place-order-button__text {
	color: #ffffff !important;
}

.wc-block-components-checkout-place-order-button.danos-checkout-submitting {
	cursor: wait !important;
	opacity: 0.72;
	pointer-events: none;
}

.wc-block-components-checkout-place-order-button.danos-checkout-submitting::before {
	animation: danos-checkout-spin 0.75s linear infinite;
	border: 2px solid currentColor;
	border-right-color: transparent;
	border-radius: 50%;
	content: "";
	display: inline-block;
	height: 16px;
	margin-right: 8px;
	width: 16px;
}

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

/* Hide payment error message when no gateways available (free trial) */
.wc-block-checkout__no-payment-methods-notice {
	display: none !important;
}

/* Custom checkout errors are controlled by JS */
.wc-block-components-notice-banner.is-error.danos-checkout-error {
	display: none;
}

.wc-block-components-notice-banner.is-error.danos-checkout-error.is-visible {
	display: block;
	visibility: visible;
	opacity: 1;
}

.woocommerce-checkout .wp-block-woocommerce-checkout .wc-block-checkout__billing-fields,
.wc-block-checkout__billing-fields.danos-billing-fields-hidden {
	display: none !important;
}

.danos-internal-billing-field {
	display: none !important;
}

div#contact {
	display: flex;
	flex-direction: column;
}

.wc-block-components-text-input.wc-block-components-address-form__danos-business-name {
	order: 1;
}

.wc-block-components-text-input.wc-block-components-address-form__danos-site-slug {
	order: 2;
}

.wc-block-components-text-input.wc-block-components-address-form__danos-contact-name {
	order: 3;
}

.wc-block-components-text-input.wc-block-components-address-form__danos-phone {
	order: 4;
}

.wc-block-components-text-input.wc-block-components-address-form__email {
	order: 5;
	margin-top: 10px !important;
}

.wc-block-components-text-input.wc-block-components-address-form__danos-admin-password {
	order: 6;
}

.wc-block-components-text-input.wc-block-components-address-form__danos-admin-password-confirm {
	order: 7;
}

.wc-block-checkout__actions .wc-block-components-text-input.wc-block-components-address-form__danos-admin-password,
.wc-block-checkout__actions .wc-block-components-text-input.wc-block-components-address-form__danos-admin-password-confirm,
.wc-block-checkout__actions_row .wc-block-components-text-input.wc-block-components-address-form__danos-admin-password,
.wc-block-checkout__actions_row .wc-block-components-text-input.wc-block-components-address-form__danos-admin-password-confirm {
	display: none !important;
}

.wc-block-components-checkout-return-to-cart-button {
	display: none !important;
}

#danos-admin-password-hidden,
#danos-admin-password-confirm-hidden {
	display: none !important;
}

@media (max-width:768px) {
	small.danos-site-preview {
		text-wrap: auto;
	}

	fieldset#contact-fields {
		max-width: 91vw;
		display: block;
	}

	.wc-block-components-checkout-step__content {
		max-width: 100vw;
	}
}

.url-input {
	display: flex;
	align-items: stretch;
	width: 100%;
	max-width: 600px;
}

.url-prefix {
	display: flex;
	align-items: center;
	padding: 0 12px;
	background: #f3f4f6;
	border: 1px solid #d1d5db;
	border-right: 0;
	border-radius: 8px 0 0 8px;
	color: #6b7280;
	white-space: nowrap;
}

.url-input input {
	flex: 1;
	min-width: 0;
	padding: 10px 12px;
	border: 1px solid #d1d5db;
	border-radius: 0 8px 8px 0;
	outline: none;
}

.url-input input:focus {
	border-color: #2271b1;
	box-shadow: 0 0 0 1px #2271b1;
}