/*
 * Fancy Elementor Add To Cart Widget - base stylesheet
 *
 * This file only contains STRUCTURE: layout, spacing defaults, resets and
 * responsive behaviour. Colors, fonts, borders and most spacing are meant
 * to be edited from the Elementor "Style" tab of the widget - those values
 * are generated by Elementor itself and load after this file, so they
 * always win.
 */

.fpew-box,
.fpew-box *,
.fpew-box *::before,
.fpew-box *::after {
	box-sizing: border-box;
}

.fpew-box {
	max-width: 640px;
}

.fpew-box p {
	margin: 0;
}

.fpew-box .fpew-notice,
.fpew-box.fpew-editor-placeholder {
	border: 1px dashed #c7cdd6;
	border-radius: 8px;
	padding: 16px;
	color: #6b7280;
	font-size: 14px;
}

/* ---------- Section 1: variation attributes ---------- */

.fpew-attributes {
	border-bottom: 1px solid #dce2e8;
}

.fpew-attr-group + .fpew-attr-group {
	margin-top: 14px;
}

.fpew-attr-label {
	font-weight: 600;
	margin-bottom: 8px;
}

.fpew-attr-current {
	font-weight: 700;
}

.fpew-attr-buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.fpew-attr-btn {
	appearance: none;
	-webkit-appearance: none;
	font: inherit;
	line-height: 1.2;
	cursor: pointer;
	transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.fpew-attr-btn:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.fpew-reset-variations {
	display: inline-block;
	margin-top: 12px;
	text-decoration: none;
	cursor: pointer;
}

.fpew-reset-variations:hover {
	text-decoration: underline;
}

/* ---------- Section 2: stock + price ---------- */

.fpew-stock-price-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 12px;
}

/* Space belongs BETWEEN rows, never before the first one or after the last
   one - this is what keeps top/bottom spacing symmetric regardless of
   whether section 1 (variations) or the shipping note are present. */
.fpew-cart-form > * + * {
	margin-top: 20px;
}

.fpew-stock-box .stock {
	font-weight: 600;
	margin: 0;
}

.fpew-price-box {
	text-align: right;
}

.fpew-price-plain .fpew-price-now {
	font-size: 26px;
	font-weight: 700;
	line-height: 1.2;
}

.fpew-price-sale {
	display: inline-block;
	text-align: left;
	padding: 10px 16px;
	border: 1px solid transparent;
}

.fpew-save-badge {
	display: inline-block;
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	padding: 3px 10px;
	border-radius: 999px;
	margin-bottom: 6px;
	line-height: 1.6;
}

.fpew-price-sale .fpew-price-now {
	display: block;
	font-size: 22px;
	font-weight: 700;
	line-height: 1.2;
}

.fpew-price-sale .fpew-price-old {
	display: block;
	font-size: 14px;
	text-decoration: line-through;
	margin-top: 2px;
}

/* ---------- Section 3: quantity + add to cart ---------- */

.fpew-cart-row {
	display: flex;
	align-items: stretch;
	gap: 12px;
	flex-wrap: nowrap;
}

/* Fix #4: when the current product/variation is confirmed out of stock,
   hide the quantity selector and Add to cart button entirely (the stock
   text itself, e.g. "Vypredané", still stays visible above). */
.fpew-box.fpew-out-of-stock .fpew-cart-row {
	display: none;
}

.fpew-qty-selector {
	display: flex;
	align-items: stretch;
	border: 1.5px solid #dce2e8;
	flex: 0 0 calc(40% - 6px);
	min-width: 128px;
}

.fpew-qty-selector button {
	appearance: none;
	-webkit-appearance: none;
	background: transparent;
	border: none;
	flex: 0 0 42px;
	width: 42px;
	font-size: 18px;
	font-weight: 700;
	line-height: 1;
	cursor: pointer;
	color: inherit;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.fpew-qty-selector button:hover:not(:disabled) {
	background-color: rgba(0, 0, 0, 0.045);
}

.fpew-qty-selector button:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: -2px;
}

.fpew-qty-selector.is-disabled {
	opacity: 0.55;
}

.fpew-qty-selector.is-disabled button,
.fpew-qty-selector.is-disabled input,
.fpew-qty-selector button:disabled,
.fpew-qty-input:disabled {
	cursor: not-allowed;
}

.fpew-qty-input {
	flex: 1 1 auto;
	min-width: 42px;
	width: 48px;
	border: 1.5px solid rgba(0, 0, 0, 0.12);
	text-align: center;
	font: inherit;
	font-weight: 700;
	color: inherit;
	background: transparent;
	-moz-appearance: textfield;
}

.fpew-qty-input::-webkit-outer-spin-button,
.fpew-qty-input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.fpew-add-to-cart-btn {
	appearance: none;
	-webkit-appearance: none;
	flex: 1 1 calc(60% - 6px);
	border: none;
	font: inherit;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 0 20px;
	min-height: 44px;
	transition: background-color 0.15s ease;
}

.fpew-add-to-cart-btn:disabled {
	cursor: not-allowed;
}

.fpew-add-to-cart-btn:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.fpew-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 20px;
	height: 20px;
	flex-shrink: 0;
	color: inherit;
	font-size: 20px;
	line-height: 1;
}

.fpew-icon i {
	font-size: inherit;
}

.fpew-icon svg {
	width: 100%;
	height: 100%;
	display: block;
	fill: currentColor;
}

/* ---------- Section 4: shipping note ---------- */

.fpew-shipping-note {
	display: flex;
	align-items: center;
	gap: 8px;
}

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

@media (max-width: 480px) {
	.fpew-price-box {
		text-align: left;
		width: 100%;
	}

	.fpew-stock-price-row {
		flex-direction: column;
		align-items: flex-start;
	}

	.fpew-cart-row {
		flex-direction: column;
	}

	.fpew-qty-selector {
		align-self: stretch;
		flex-basis: auto;
		width: 100%;
	}

	.fpew-add-to-cart-btn {
		flex-basis: auto;
		width: 100%;
	}
}

/* Respect reduced-motion preference */
@media (prefers-reduced-motion: reduce) {
	.fpew-attr-btn,
	.fpew-add-to-cart-btn {
		transition: none;
	}
}

/* Defensive fallback: section 1 is only ever printed by PHP for variable
   products, but keep this in case a future change ever renders an empty
   wrapper for simple products too. */
.fpew-box.fpew-is-simple .fpew-attributes {
	display: none !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
}


/* Mobile/touch hardening: keep the interactive controls above surrounding Elementor layers. */
.fpew-attributes,
.fpew-cart-row,
.fpew-attr-buttons,
.fpew-qty-selector,
.fpew-add-to-cart-btn {
	position: relative;
	z-index: 2;
}

.fpew-attr-btn,
.fpew-reset-variations,
.fpew-qty-selector button,
.fpew-qty-input,
.fpew-add-to-cart-btn {
	pointer-events: auto;
	touch-action: manipulation;
	-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

.fpew-attr-btn,
.fpew-qty-selector button,
.fpew-add-to-cart-btn {
	user-select: none;
	-webkit-user-select: none;
}
