/**
 * WooCommerce Catalog Contact — Frontend Styles
 *
 * Modern, minimal contact card + floating button.
 * Uses CSS custom properties injected from settings.
 *
 * @package WooCommerceCatalogContact
 */

/* -------------------------------------------------------------------------
 * CSS Variables (defaults; overridden via wp_add_inline_style)
 * ------------------------------------------------------------------------- */
:root {
	--wcc-primary: #1a73e8;
	--wcc-primary-hover: color-mix(in srgb, var(--wcc-primary) 88%, #000);
	--wcc-bg: #ffffff;
	--wcc-text: inherit;
	--wcc-muted: inherit;
	--wcc-border: color-mix(in srgb, var(--wcc-primary) 12%, #e8eaed);
	--wcc-radius: 12px;
	--wcc-btn-radius: 8px;
	--wcc-font-scale: 1;
	--wcc-icon-size: 1.25em;
	--wcc-spacing: 1.25em;
	--wcc-whatsapp: #25d366;
	--wcc-whatsapp-hover: #1da851;
	--wcc-shadow: 0 4px 24px rgba(26, 26, 26, 0.08);
	--wcc-focus: 0 0 0 3px color-mix(in srgb, var(--wcc-primary) 35%, transparent);
}

/* Inherit theme typography — never load custom fonts */
.wcc-contact-card,
.wcc-contact-card__title,
.wcc-contact-card__desc,
.wcc-btn,
.wcc-btn__label,
.wcc-loop-contact,
.wcc-floating-btn {
	font-family: inherit;
	font-weight: inherit;
	line-height: inherit;
}

/* -------------------------------------------------------------------------
 * Hide prices / cart / quantity (theme & builder compatibility)
 * ------------------------------------------------------------------------- */
.wcc-hide-prices .price,
.wcc-hide-prices .woocommerce-Price-amount,
.wcc-hide-prices .amount,
.wcc-hide-prices .woocommerce-Price-currencySymbol,
.wcc-hide-prices .elementor-widget-woocommerce-product-price,
.wcc-hide-prices .wd-product-price,
.wcc-hide-prices .product-price,
.wcc-hide-prices .price-wrapper,
.wcc-hide-prices .wc-block-components-product-price,
.wcc-hide-prices .wc-block-grid__product-price,
.wcc-hide-prices del,
.wcc-hide-prices ins {
	display: none !important;
}

.wcc-disable-cart .single_add_to_cart_button,
.wcc-disable-cart .add_to_cart_button,
.wcc-disable-cart .ajax_add_to_cart,
.wcc-disable-cart .button.product_type_simple,
.wcc-disable-cart .button.product_type_variable,
.wcc-disable-cart .button.product_type_grouped,
.wcc-disable-cart .button.product_type_external,
.wcc-disable-cart .wc-block-components-product-button,
.wcc-disable-cart .wp-block-button.wc-block-components-product-button,
.wcc-disable-cart form.cart .variations_button,
.wcc-disable-cart .widget_shopping_cart .buttons,
.wcc-disable-cart .woocommerce-mini-cart__buttons {
	display: none !important;
}

.wcc-hide-quantity .quantity,
.wcc-hide-quantity .wcc-qty-hidden,
.wcc-hide-quantity input.qty,
.wcc-hide-quantity .qty {
	display: none !important;
}

/* -------------------------------------------------------------------------
 * Contact Card
 * ------------------------------------------------------------------------- */
.wcc-contact-card {
	display: block;
	margin: var(--wcc-spacing) 0;
	padding: var(--wcc-spacing);
	background: var(--wcc-bg);
	border: 1px solid var(--wcc-border);
	border-radius: var(--wcc-radius);
	box-shadow: var(--wcc-shadow);
	font-size: calc(1em * var(--wcc-font-scale));
	line-height: inherit;
	color: var(--wcc-text);
	box-sizing: border-box;
	max-width: 100%;
	animation: wcc-fade-in 0.35s ease-out;
}

.wcc-contact-card *,
.wcc-contact-card *::before,
.wcc-contact-card *::after {
	box-sizing: border-box;
}

.wcc-contact-card__inner {
	display: flex;
	flex-direction: column;
	gap: calc(var(--wcc-spacing) * 0.55);
}

.wcc-contact-card__title {
	margin: 0;
	padding: 0;
	font-size: calc(1em * var(--wcc-font-scale) * 1.15);
	font-weight: inherit;
	line-height: inherit;
	color: var(--wcc-text);
	letter-spacing: -0.01em;
}

.wcc-contact-card__desc {
	margin: 0;
	padding: 0;
	color: inherit;
	opacity: 0.82;
	font-size: calc(1em * var(--wcc-font-scale));
	line-height: inherit;
}

.wcc-contact-card__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.65rem;
	margin-top: calc(var(--wcc-spacing) * 0.25);
}

/* -------------------------------------------------------------------------
 * Buttons
 * ------------------------------------------------------------------------- */
.wcc-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	padding: 0.7rem 1.15rem;
	border: none;
	border-radius: var(--wcc-btn-radius);
	font-size: calc(1em * var(--wcc-font-scale));
	font-weight: inherit;
	line-height: inherit;
	text-decoration: none !important;
	cursor: pointer;
	transition: background-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
	min-height: 44px;
}

.wcc-btn:hover {
	transform: translateY(-1px);
	text-decoration: none !important;
}

.wcc-btn:focus {
	outline: none;
}

.wcc-btn:focus-visible {
	outline: none;
	box-shadow: var(--wcc-focus);
}

.wcc-btn--primary {
	background: var(--wcc-primary);
	color: #fff !important;
}

.wcc-btn--primary:hover,
.wcc-btn--primary:focus-visible {
	background: var(--wcc-primary-hover);
	color: #fff !important;
}

.wcc-btn--whatsapp {
	background: var(--wcc-whatsapp);
	color: #fff !important;
}

.wcc-btn--whatsapp:hover,
.wcc-btn--whatsapp:focus-visible {
	background: var(--wcc-whatsapp-hover);
	color: #fff !important;
}

.wcc-btn--sm {
	padding: 0.55rem 0.95rem;
	min-height: 40px;
	font-size: calc(1em * var(--wcc-font-scale) * 0.93);
}

.wcc-btn__icon {
	display: inline-flex;
	width: var(--wcc-icon-size);
	height: var(--wcc-icon-size);
	flex-shrink: 0;
}

.wcc-btn__icon svg {
	width: 100%;
	height: 100%;
	display: block;
}

.wcc-btn__label {
	display: inline-block;
}

.wcc-loop-contact {
	margin-top: 0.75rem;
	width: 100%;
}

.wcc-loop-contact .wcc-btn {
	width: 100%;
}

/* -------------------------------------------------------------------------
 * Floating Button
 * ------------------------------------------------------------------------- */
.wcc-floating-btn {
	position: fixed;
	right: var(--wcc-floating-offset, 1.25rem);
	bottom: var(--wcc-floating-offset, 1.25rem);
	z-index: 99999;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: var(--wcc-floating-size, 56px);
	height: var(--wcc-floating-size, 56px);
	border-radius: 50%;
	background: var(--wcc-floating-color, var(--wcc-primary));
	color: #fff !important;
	box-shadow: 0 6px 20px color-mix(in srgb, var(--wcc-floating-color, var(--wcc-primary)) 40%, transparent);
	text-decoration: none !important;
	transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
	animation: wcc-float-in 0.4s ease-out;
}

.wcc-floating-btn:hover {
	transform: scale(1.06);
	background: color-mix(in srgb, var(--wcc-floating-color, var(--wcc-primary)) 88%, #000);
	color: #fff !important;
}

.wcc-floating-btn:focus-visible {
	outline: none;
	box-shadow: var(--wcc-focus), 0 6px 20px color-mix(in srgb, var(--wcc-floating-color, var(--wcc-primary)) 40%, transparent);
}

.wcc-floating-btn__icon {
	display: flex;
	width: var(--wcc-floating-icon-size, 24px);
	height: var(--wcc-floating-icon-size, 24px);
}

.wcc-floating-btn__icon svg {
	width: 100%;
	height: 100%;
}

/* -------------------------------------------------------------------------
 * RTL
 * ------------------------------------------------------------------------- */
[dir="rtl"] .wcc-floating-btn,
.rtl .wcc-floating-btn {
	right: auto;
	left: var(--wcc-floating-offset, 1.25rem);
}

[dir="rtl"] .wcc-contact-card__actions,
.rtl .wcc-contact-card__actions {
	flex-direction: row;
}

/* -------------------------------------------------------------------------
 * Accessibility
 * ------------------------------------------------------------------------- */
.wcc-contact-card .screen-reader-text,
.wcc-floating-btn .screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	width: 1px;
	word-wrap: normal !important;
}

@media (prefers-reduced-motion: reduce) {
	.wcc-contact-card,
	.wcc-floating-btn,
	.wcc-btn {
		animation: none !important;
		transition: none !important;
	}

	.wcc-btn:hover,
	.wcc-floating-btn:hover {
		transform: none;
	}
}

/* -------------------------------------------------------------------------
 * Responsive
 * ------------------------------------------------------------------------- */
@media (max-width: 600px) {
	.wcc-contact-card__actions {
		flex-direction: column;
	}

	.wcc-contact-card__actions .wcc-btn {
		width: 100%;
	}

	.wcc-floating-btn {
		width: calc(var(--wcc-floating-size, 56px) - 4px);
		height: calc(var(--wcc-floating-size, 56px) - 4px);
	}

	[dir="rtl"] .wcc-floating-btn,
	.rtl .wcc-floating-btn {
		right: auto;
		left: var(--wcc-floating-offset, 1rem);
	}
}

/* -------------------------------------------------------------------------
 * Animations
 * ------------------------------------------------------------------------- */
@keyframes wcc-fade-in {
	from {
		opacity: 0;
		transform: translateY(6px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@keyframes wcc-float-in {
	from {
		opacity: 0;
		transform: scale(0.85);
	}
	to {
		opacity: 1;
		transform: scale(1);
	}
}

/* -------------------------------------------------------------------------
 * Theme / builder extras
 * ------------------------------------------------------------------------- */
.theme-flatsome .wcc-contact-card,
.theme-woodmart .wcc-contact-card,
.theme-astra .wcc-contact-card,
.theme-kadence .wcc-contact-card,
.theme-generatepress .wcc-contact-card,
.theme-hello-elementor .wcc-contact-card {
	clear: both;
}

.elementor-widget-woocommerce-product-add-to-cart .wcc-contact-card {
	margin-top: 0;
}
