/*
Theme Name: Stovery
Theme URI: https://stovery.local
Author: Stovery Team
Author URI: https://stovery.local
Description: Minimal WooCommerce Block Theme for Stovery, inspired by UniShop2 and Twenty Twenty-Five.
Version: 1.1.0
Requires at least: 6.7
Tested up to: 6.7
Requires PHP: 8.1
License: GNU General Public License v2 or later
Text Domain: stovery
*/

/* ========================================================
   CSS VARIABLES (OPTIMIZED UNISHOP2 PALETTE)
   ======================================================== */
/* Legacy aliases kept for older selectors below; values come from theme.json presets. */
:root {
	--stovery-color-primary: var(--wp--preset--color--primary);
	--stovery-color-primary-dark: var(--wp--preset--color--primary-dark);
	--stovery-color-accent: var(--wp--preset--color--accent);
	--stovery-color-text: var(--wp--preset--color--contrast);
	--stovery-color-text-subtle: var(--wp--preset--color--muted);
	--stovery-color-muted: var(--wp--preset--color--muted);
	--stovery-color-border: var(--wp--preset--color--line);
	--stovery-color-subtle: var(--wp--preset--color--surface-subtle);
	--stovery-color-sale: var(--wp--preset--color--accent-sale);
	--stovery-color-rating: var(--wp--preset--color--accent-rating);
}

body {
	-webkit-font-smoothing: antialiased;
}

/* ========================================================
   6. FLOATING WIDGETS
   ======================================================== */
.floating-callback-btn {
	position: fixed;
	bottom: 80px;
	right: 24px;
	width: 52px;
	height: 52px;
	border-radius: 50%;
	background: var(--stovery-color-primary);
	color: var(--wp--preset--color--base);
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	z-index: 999;
	box-shadow: 0 4px 14px rgba(50, 132, 8, 0.4);
}

.callback-phone-icon {
	width: 1.5rem;
	height: 1.5rem;
	background-color: currentColor;
	-webkit-mask: var(--stovery-icon) center / contain no-repeat;
	mask: var(--stovery-icon) center / contain no-repeat;
}

.scroll-to-top__icon {
	display: inline-block;
	width: 0.6rem;
	height: 0.6rem;
	margin-top: 0.2rem;
	border-top: 2px solid currentColor;
	border-left: 2px solid currentColor;
	transform: rotate(45deg);
}

.callback-pulse {
	position: absolute;
	top: -6px;
	left: -6px;
	right: -6px;
	bottom: -6px;
	border-radius: 50%;
	border: 2px solid var(--stovery-color-accent);
	opacity: 0.7;
	animation: callbackPulse 1.8s infinite;
}

@keyframes callbackPulse {
	0% { transform: scale(0.9); opacity: 0.8; }
	50% { transform: scale(1.15); opacity: 0.2; }
	100% { transform: scale(0.9); opacity: 0.8; }
}

.scroll-to-top {
	position: fixed;
	bottom: 24px;
	right: 28px;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--base);
	border: none;
	font-size: 14px;
	cursor: pointer;
	z-index: 999;
	opacity: 0.8;
	transition: opacity 0.2s, background-color 0.2s;
}

.scroll-to-top:hover {
	opacity: 1;
	background-color: var(--stovery-color-primary);
}

/* ========================================================
   7. FLOATING BUTTONS ABOVE THE MOBILE BOTTOM BAR (core/group is-style-bottom-bar)
   ======================================================== */
@media (width <= 991px) {
	.floating-callback-btn {
		bottom: 5.5rem;
		right: var(--wp--preset--spacing--40);
		width: 3rem;
		height: 3rem;
	}

	.scroll-to-top {
		bottom: 5.5rem;
		left: var(--wp--preset--spacing--40);
		right: auto;
		width: 2.5rem;
		height: 2.5rem;
	}
}

/* ========================================================
   MODAL REQUEST FORM (CALLBACK / ЗАМОВЛЕННЯ ДЗВІНКА)
   ======================================================== */
.modal-backdrop {
	position: fixed;
	top: 0;
	left: 0;
	z-index: 1040;
	width: 100vw;
	height: 100vh;
	background-color: rgba(0, 0, 0, 0.55);
	backdrop-filter: blur(2px);
	transition: opacity 0.2s ease-in-out;
}

.modal {
	position: fixed;
	top: 0;
	left: 0;
	z-index: 1050;
	display: none;
	width: 100%;
	height: 100%;
	overflow-x: hidden;
	overflow-y: auto;
	outline: 0;
	align-items: center;
	justify-content: center;
	padding: 1rem;
	box-sizing: border-box;
}

.modal.show,
.modal.open {
	display: flex !important;
}

.modal-dialog {
	position: relative;
	width: 100%;
	max-width: 440px;
	margin: auto;
	pointer-events: auto;
	animation: modalSlideDown 0.22s ease-out;
}

@keyframes modalSlideDown {
	from {
		opacity: 0;
		transform: translateY(-24px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.modal-content {
	position: relative;
	display: flex;
	flex-direction: column;
	width: 100%;
	background-color: var(--wp--preset--color--base);
	border: 1px solid rgba(0, 0, 0, 0.1);
	border-radius: 8px;
	box-shadow: 0 12px 35px rgba(0, 0, 0, 0.25);
	outline: 0;
	overflow: hidden;
}

.modal-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 20px;
	border-bottom: 1px solid var(--wp--preset--color--line);
	background: var(--wp--preset--color--surface-subtle);
}

.modal-title {
	margin: 0;
	font-size: 1.2rem;
	font-weight: 700;
	color: var(--wp--preset--color--contrast);
}

.modal-header .close {
	background: none;
	border: none;
	font-size: 26px;
	font-weight: 300;
	line-height: 1;
	color: var(--wp--preset--color--muted);
	cursor: pointer;
	padding: 0;
	margin: 0;
	transition: color 0.15s;
}

.modal-header .close:hover {
	color: var(--wp--preset--color--contrast);
}

.modal-body {
	position: relative;
	padding: 20px;
}

.modal-request__input {
	width: 100%;
	height: 42px;
	padding: 8px 14px;
	font-size: 14.5px;
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 4px;
	outline: none;
	box-sizing: border-box;
	margin-bottom: 14px;
	transition: border-color 0.15s, box-shadow 0.15s;
	color: var(--wp--preset--color--contrast);
}

.modal-request__input:focus {
	border-color: var(--stovery-color-primary);
	box-shadow: 0 0 0 3px rgba(50, 132, 8, 0.15);
}

textarea.modal-request__comment {
	height: 80px;
	resize: vertical;
	padding-top: 10px;
}

.modal-request__reasons {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-bottom: 14px;
	padding: 10px 12px;
	background: var(--wp--preset--color--surface-subtle);
	border-radius: 4px;
	border: 1px solid var(--wp--preset--color--surface-subtle);
}

.modal-request__label {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 13.5px;
	color: var(--wp--preset--color--muted);
	cursor: pointer;
	margin: 0;
}

.modal-request__label input[type="radio"] {
	accent-color: var(--stovery-color-primary);
	cursor: pointer;
	width: 16px;
	height: 16px;
	margin: 0;
}

.modal-request__agree {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	font-size: 12.5px;
	color: var(--wp--preset--color--muted);
	margin-bottom: 16px;
	cursor: pointer;
	line-height: 1.4;
}

.modal-request__agree input[type="checkbox"] {
	accent-color: var(--stovery-color-primary);
	cursor: pointer;
	width: 16px;
	height: 16px;
	margin-top: 2px;
}

.modal-request__agree a {
	color: var(--stovery-color-primary);
	text-decoration: underline;
}

.modal-request__btn {
	width: 100%;
	height: 46px;
	background-color: var(--stovery-color-primary);
	color: var(--wp--preset--color--base);
	border: none;
	border-radius: 4px;
	font-size: 15px;
	font-weight: 700;
	cursor: pointer;
	transition: background-color 0.15s ease, transform 0.1s;
	box-shadow: 0 2px 6px rgba(50, 132, 8, 0.2);
}

.modal-request__btn:hover {
	background-color: var(--stovery-color-primary-dark);
}

.callback-success-message {
	text-align: center;
	padding: 20px 10px;
}

.callback-success-icon {
	width: 52px;
	height: 52px;
	line-height: 52px;
	margin: 0 auto 12px;
	background: var(--wp--preset--color--surface-subtle);
	color: var(--stovery-color-primary);
	border-radius: 50%;
	font-size: 26px;
	font-weight: 700;
}

.callback-success-title {
	font-size: 18px;
	font-weight: 700;
	color: var(--wp--preset--color--contrast);
	margin-bottom: 6px;
}

.callback-success-desc {
	font-size: 14px;
	color: var(--wp--preset--color--muted);
	line-height: 1.5;
}
