/* =============================================================
   Guided Flower Finder — Float button, wizard overlay, results
   ============================================================= */

/* ---------- FAB wrapper ---------- */
#gfd-finder-fab {
	position: fixed;
	bottom: 28px;
	left: 24px;
	z-index: 9000;
	display: flex;
	align-items: center;
	gap: 0;
	border-radius: 50px;
	box-shadow: 0 4px 22px rgba(139, 31, 169, 0.45);
	transition: box-shadow 0.15s ease;
}

#gfd-finder-fab:hover {
	box-shadow: 0 6px 30px rgba(139, 31, 169, 0.6);
}

/* ---------- Find Flowers button ---------- */
#gfd-finder-btn {
	display: flex;
	align-items: center;
	gap: 7px;
	padding: 12px 18px 12px 22px;
	background: linear-gradient(135deg, #8b1fa9 0%, #6d1685 100%);
	color: #fff;
	border: none;
	border-radius: 50px 0 0 50px;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	white-space: nowrap;
	letter-spacing: 0.01em;
	transition: opacity 0.15s;
}

#gfd-finder-btn:hover { opacity: 0.92; }

#gfd-finder-btn:focus-visible {
	outline: 2px solid #c97fd8;
	outline-offset: 3px;
}

/* ---------- Dismiss button ---------- */
#gfd-finder-dismiss {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0 12px;
	align-self: stretch;
	background: rgba(80, 15, 105, 0.95);
	border: none;
	border-left: 1px solid rgba(255, 255, 255, 0.15);
	border-radius: 0 50px 50px 0;
	color: rgba(255, 255, 255, 0.7);
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
	transition: color 0.15s, background 0.15s;
}

#gfd-finder-dismiss:hover {
	color: #fff;
	background: rgba(100, 20, 130, 0.98);
}

#gfd-finder-dismiss:focus-visible {
	outline: 2px solid #c97fd8;
	outline-offset: 2px;
}

/* =============================================================
   OVERLAY — light & clean
   ============================================================= */

/* ---------- Backdrop ---------- */
#gfd-finder-overlay {
	position: fixed;
	inset: 0;
	z-index: 9100;
	background: rgba(30, 10, 50, 0.4);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	opacity: 0;
	transition: opacity 0.22s ease;
	backdrop-filter: blur(3px);
	-webkit-backdrop-filter: blur(3px);
}

#gfd-finder-overlay.is-open { opacity: 1; }

/* ---------- Modal card ---------- */
#gfd-finder-modal {
	position: relative;
	width: 100%;
	max-width: 500px;
	max-height: 92vh;
	overflow-y: auto;
	background: #ffffff;
	border: 1px solid #ede5f4;
	border-radius: 20px;
	padding: 36px 32px 32px;
	box-shadow: 0 20px 60px rgba(80, 10, 120, 0.14), 0 2px 8px rgba(0, 0, 0, 0.06);
	transform: translateY(16px);
	transition: transform 0.22s ease;
	scrollbar-width: thin;
	scrollbar-color: #d8c8e8 transparent;
}

#gfd-finder-overlay.is-open #gfd-finder-modal { transform: translateY(0); }

/* ---------- Close button ---------- */
#gfd-finder-close {
	position: absolute;
	top: 14px;
	right: 14px;
	width: 32px;
	height: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
	border: none;
	background: #f5f0fa;
	color: #9ca3af;
	border-radius: 50%;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	transition: background 0.15s, color 0.15s;
}

#gfd-finder-close:hover { background: #ede5f4; color: #374151; }

/* ---------- Step layout ---------- */

/* Step 1 brand headline — bigger than the sub-question */
.gfd-step-brand {
	font-size: 30px;
	font-weight: 800;
	color: #8b1fa9;
	margin: 0 0 4px;
	line-height: 1.1;
	text-wrap: balance;
}

/* Sub-question under the brand headline */
.gfd-step-question {
	font-size: 14px;
	font-weight: 500;
	color: #9ca3af;
	margin: 0 0 20px;
}

/* Used for step 2+ headings */
.gfd-step-title {
	font-size: 19px;
	font-weight: 700;
	color: #1a0a2e;
	margin: 0 0 20px;
	line-height: 1.25;
	text-wrap: balance;
}

.gfd-back {
	background: none;
	border: none;
	color: #8b1fa9;
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
	padding: 0;
	margin-bottom: 14px;
	display: inline-flex;
	align-items: center;
	gap: 4px;
}

.gfd-back:hover { color: #6d1685; text-decoration: none; }

/* ---------- Step 1: 2×2 card grid ---------- */
.gfd-cards {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
}

.gfd-card-full {
	grid-column: 1 / -1;
	flex-direction: row;
	align-items: center;
	gap: 12px;
}

.gfd-card {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 2px;
	padding: 15px 16px;
	background: #faf7fd;
	border: 1.5px solid #ede5f4;
	border-radius: 12px;
	cursor: pointer;
	text-align: left;
	color: inherit;
	transition: background 0.14s, border-color 0.14s, transform 0.1s;
}

.gfd-card:hover {
	background: #f3e8fb;
	border-color: #c97fd8;
	transform: translateY(-1px);
}

.gfd-card-full .gfd-card-icon { margin-bottom: 0; }

.gfd-card-icon {
	font-size: 24px;
	line-height: 1;
	margin-bottom: 5px;
	display: block;
	transition: transform 0.15s;
}

.gfd-card-full:hover .gfd-card-icon { transform: scale(1.1); }

.gfd-card-label {
	font-size: 14px;
	font-weight: 600;
	color: #1a0a2e;
	display: block;
}

.gfd-card-sub {
	font-size: 11px;
	color: #9ca3af;
	display: block;
}

/* ---------- Divider between cards and step title ---------- */
.gfd-step-divider {
	height: 1px;
	background: #f0e8f8;
	margin: 20px 0;
}

/* ---------- Step 2a: Slot grid ---------- */
.gfd-slots-grid {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 4px;
}

.gfd-slot-btn {
	padding: 10px 18px;
	background: #faf7fd;
	border: 1.5px solid #ede5f4;
	border-radius: 8px;
	color: #1a0a2e;
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	transition: background 0.14s, border-color 0.14s;
}

.gfd-slot-btn:hover {
	background: #f3e8fb;
	border-color: #c97fd8;
}

.gfd-slots-loading,
.gfd-no-slots {
	color: #9ca3af;
	font-size: 14px;
	margin: 0;
}

/* ---------- Step 2b: Date + time picker ---------- */
#gfd-date-input {
	width: 100%;
	padding: 11px 14px;
	background: #faf7fd;
	border: 1.5px solid #ede5f4;
	border-radius: 10px;
	color: #1a0a2e;
	font-size: 15px;
	color-scheme: light;
	box-sizing: border-box;
	margin-bottom: 18px;
	transition: border-color 0.14s;
}

#gfd-date-input:focus {
	outline: none;
	border-color: #8b1fa9;
	box-shadow: 0 0 0 3px rgba(139, 31, 169, 0.08);
}

#gfd-time-opts { margin-bottom: 20px; }

.gfd-time-label {
	font-size: 11px;
	font-weight: 700;
	color: #9ca3af;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	margin: 0 0 10px;
}

.gfd-time-cards {
	display: flex;
	gap: 10px;
}

.gfd-time-card {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	padding: 14px 10px;
	background: #faf7fd;
	border: 1.5px solid #ede5f4;
	border-radius: 10px;
	cursor: pointer;
	font-size: 13px;
	font-weight: 500;
	color: #374151;
	transition: background 0.14s, border-color 0.14s;
}

.gfd-time-card input[type="radio"] {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.gfd-time-card:has(input:checked) {
	background: #f3e8fb;
	border-color: #8b1fa9;
	color: #6d1685;
}

.gfd-time-card:hover { background: #f3e8fb; border-color: #d8a8ea; }

.gfd-time-icon { font-size: 22px; line-height: 1; }

.gfd-primary-btn {
	width: 100%;
	padding: 13px;
	background: linear-gradient(135deg, #8b1fa9 0%, #6d1685 100%);
	border: none;
	border-radius: 10px;
	color: #fff;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	letter-spacing: 0.01em;
	transition: opacity 0.15s, transform 0.1s;
}

.gfd-primary-btn:hover:not(:disabled) { opacity: 0.9; transform: translateY(-1px); }
.gfd-primary-btn:disabled { opacity: 0.3; cursor: not-allowed; }

/* ---------- Step 2c: Occasion grid ---------- */
.gfd-occ-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 10px;
}

.gfd-occ-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	padding: 16px 8px;
	background: #faf7fd;
	border: 1.5px solid #ede5f4;
	border-radius: 12px;
	text-decoration: none;
	transition: background 0.14s, border-color 0.14s, transform 0.1s;
}

.gfd-occ-card:hover {
	background: #f3e8fb;
	border-color: #c97fd8;
	transform: translateY(-1px);
	text-decoration: none;
}

.gfd-occ-icon { font-size: 26px; line-height: 1; }

.gfd-occ-label {
	font-size: 11px;
	font-weight: 600;
	color: #374151;
	text-align: center;
	line-height: 1.3;
}

/* =============================================================
   RESULTS PAGE — full-width layout
   ============================================================= */

/* Break out of the theme's narrow content column */
.gfd-finder-results-page .entry-content,
.gfd-finder-results-page .post-content,
.gfd-finder-results-page .site-main .entry-content {
	max-width: none !important;
	padding-left: 0 !important;
	padding-right: 0 !important;
}

.gfd-finder-results-page .gfd-finder-results {
	width: 92%;
	max-width: 1600px;
	margin: 0 auto;
	box-sizing: border-box;
}

@media (max-width: 768px) {
	.gfd-finder-results-page .gfd-finder-results {
		width: 100%;
		padding: 0 12px;
	}
}

/* =============================================================
   RESULTS PAGE — filter bar
   ============================================================= */

.gfd-fr-filters {
	display: flex;
	align-items: center;
	gap: 16px;
	margin-bottom: 20px;
	padding: 12px 0;
	border-top: 1px solid #f0e8f8;
	border-bottom: 1px solid #f0e8f8;
	flex-wrap: wrap;
}

/* Horizontally scrollable category pills */
.gfd-fr-filter-scroll {
	flex: 1;
	min-width: 0;
	overflow-x: auto;
	scrollbar-width: none;
	-ms-overflow-style: none;
}
.gfd-fr-filter-scroll::-webkit-scrollbar { display: none; }

.gfd-fr-cats {
	display: flex;
	gap: 8px;
	white-space: nowrap;
}

.gfd-fr-cat-btn {
	padding: 7px 16px;
	background: #faf7fd;
	border: 1.5px solid #ede5f4;
	border-radius: 20px;
	color: #374151;
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
	white-space: nowrap;
	transition: background 0.14s, border-color 0.14s, color 0.14s;
}

.gfd-fr-cat-btn.is-active {
	background: #8b1fa9;
	border-color: #8b1fa9;
	color: #fff;
}

.gfd-fr-cat-btn:hover:not(.is-active) {
	background: #f3e8fb;
	border-color: #c97fd8;
}

/* Price filter */
.gfd-fr-price {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-shrink: 0;
}

.gfd-fr-price-label {
	font-size: 11px;
	font-weight: 700;
	color: #9ca3af;
	text-transform: uppercase;
	letter-spacing: 0.08em;
}

.gfd-fr-price-ctrl {
	display: flex;
	align-items: center;
	gap: 4px;
	background: #faf7fd;
	border: 1.5px solid #ede5f4;
	border-radius: 8px;
	padding: 6px 12px;
	transition: border-color 0.14s;
}

.gfd-fr-price-ctrl:focus-within {
	border-color: #8b1fa9;
}

.gfd-fr-price-sym {
	color: #9ca3af;
	font-size: 13px;
}

.gfd-fr-price-input {
	width: 70px;
	border: none;
	background: none;
	color: #1a0a2e;
	font-size: 14px;
	font-weight: 500;
	outline: none;
	-moz-appearance: textfield;
}

.gfd-fr-price-input::-webkit-outer-spin-button,
.gfd-fr-price-input::-webkit-inner-spin-button { -webkit-appearance: none; }

/* Auto-load sentinel + spinner */
.gfd-fr-sentinel {
	height: 1px;
}

.gfd-fr-loading {
	text-align: center;
	padding: 28px;
	color: #9ca3af;
	font-size: 14px;
}

.gfd-fr-loading::before {
	content: '';
	display: inline-block;
	width: 18px;
	height: 18px;
	border: 2px solid #ede5f4;
	border-top-color: #8b1fa9;
	border-radius: 50%;
	animation: gfd-spin 0.7s linear infinite;
	vertical-align: middle;
	margin-right: 8px;
}

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

/* "No slots" next-available hint */
.gfd-no-slots-next {
	color: #374151;
	font-size: 13px;
	margin: 10px 0 8px;
}

/* =============================================================
   RESULTS PAGE — header
   ============================================================= */

/* ---------- Results page header ---------- */
.gfd-fr-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 24px;
	flex-wrap: wrap;
}

.gfd-fr-count {
	font-size: 18px;
	font-weight: 600;
	line-height: 1.4;
}

.gfd-fr-change,
.gfd-fr-open-btn {
	display: inline-flex;
	align-items: center;
	padding: 8px 18px;
	background: rgba(139, 31, 169, 0.07);
	border: 1px solid rgba(139, 31, 169, 0.22);
	border-radius: 20px;
	color: #8b1fa9;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	text-decoration: none;
	white-space: nowrap;
	transition: background 0.14s;
}

.gfd-fr-change:hover,
.gfd-fr-open-btn:hover {
	background: rgba(139, 31, 169, 0.14);
	color: #6d1685;
	text-decoration: none;
}

.gfd-fr-empty-state {
	text-align: center;
	padding: 56px 24px;
}

.gfd-fr-empty-state p { margin-bottom: 16px; color: #6b7280; }

/* =============================================================
   RESULTS PAGE — sidebar layout
   ============================================================= */

.gfd-fr-layout {
	display: flex;
	align-items: flex-start;
	gap: 28px;
}

/* ----- Left sidebar ----- */
.gfd-fr-sidebar {
	width: 220px;
	flex-shrink: 0;
	position: sticky;
	top: 20px;
	background: #faf7fd;
	border: 1.5px solid #ede5f4;
	border-radius: 14px;
	overflow: hidden;
}

.gfd-fr-sidebar-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 16px;
	border-bottom: 1px solid #ede5f4;
	font-size: 13px;
	font-weight: 700;
	color: #1a0a2e;
	text-transform: uppercase;
	letter-spacing: 0.08em;
}

.gfd-fr-sidebar-close {
	display: none; /* visible only on mobile */
	background: none;
	border: none;
	font-size: 20px;
	line-height: 1;
	color: #9ca3af;
	cursor: pointer;
	padding: 0;
}

.gfd-fr-sidebar-close:hover { color: #374151; }

/* Filter section */
.gfd-fr-filter-section {
	padding: 14px 16px;
	border-bottom: 1px solid #ede5f4;
}

.gfd-fr-filter-section:last-child { border-bottom: 0; }

.gfd-fr-filter-heading {
	font-size: 11px;
	font-weight: 700;
	color: #9ca3af;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	margin: 0 0 10px;
}

/* Parent category radio list */
.gfd-fr-cat-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.gfd-fr-cat-item {
	margin: 0;
}

.gfd-fr-cat-label {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 7px 0;
	font-size: 13px;
	font-weight: 500;
	color: #374151;
	cursor: pointer;
	transition: color 0.12s;
}

.gfd-fr-cat-label:hover { color: #8b1fa9; }

.gfd-fr-cat-label input[type="radio"] {
	accent-color: #8b1fa9;
	width: 14px;
	height: 14px;
	flex-shrink: 0;
	cursor: pointer;
}

/* Sub-category checkbox list (hidden until parent selected) */
.gfd-fr-subcat-list {
	display: none;
	list-style: none;
	margin: 0 0 4px 22px;
	padding: 0;
}

.gfd-fr-subcat-label {
	display: flex;
	align-items: center;
	gap: 7px;
	padding: 5px 0;
	font-size: 12px;
	color: #6b7280;
	cursor: pointer;
	transition: color 0.12s;
}

.gfd-fr-subcat-label:hover { color: #8b1fa9; }

.gfd-fr-subcat-label input[type="checkbox"] {
	accent-color: #8b1fa9;
	width: 13px;
	height: 13px;
	flex-shrink: 0;
	cursor: pointer;
}

/* Price section — sidebar overrides for .gfd-fr-price-ctrl (shared with old bar) */
.gfd-fr-sidebar .gfd-fr-price-ctrl {
	background: #fff;
	border-radius: 8px;
	padding: 7px 12px;
	width: 100%;
	box-sizing: border-box;
}

.gfd-fr-sidebar .gfd-fr-price-input {
	flex: 1;
	width: 100%;
}

/* ----- Main content area ----- */
.gfd-fr-main {
	flex: 1;
	min-width: 0;
}

/* Mobile filter toggle button */
.gfd-fr-filter-toggle {
	display: none;
	align-items: center;
	gap: 8px;
	padding: 9px 18px;
	background: #faf7fd;
	border: 1.5px solid #ede5f4;
	border-radius: 20px;
	color: #374151;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	margin-bottom: 16px;
	transition: background 0.14s, border-color 0.14s;
}

.gfd-fr-filter-toggle:hover {
	background: #f3e8fb;
	border-color: #c97fd8;
}

/* Badge showing active filter count */
.gfd-fr-badge {
	display: none;
	background: #8b1fa9;
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	border-radius: 50%;
	width: 18px;
	height: 18px;
	line-height: 18px;
	text-align: center;
	flex-shrink: 0;
}

/* ---- Product grid: force CSS grid 4-col ----
   The theme's column CSS needs a .woocommerce.columns-4 ancestor which
   our markup doesn't have, so we override with explicit CSS grid.         */
.gfd-fr-main .gfd-sd-grid ul.products {
	display: grid !important;
	grid-template-columns: repeat(4, 1fr) !important;
	gap: 0 !important;
	margin: 0 !important;
}

.gfd-fr-main .gfd-sd-grid ul.products li.product {
	display: block !important;
	float: none !important;
	width: auto !important;
	clear: none !important;
	margin-left: 0 !important;
	margin-right: 0 !important;
}

/* ---- Uniform image height ----
   The child theme's content-product.php opens <div class="mkdf-pl-image">
   before the thumbnail but never closes it — so title, price and the
   add-to-cart button all end up inside that div.  Applying aspect-ratio
   to the div clips everything after the image.  Target only the img tag
   so the containing div can still expand to show all card content.      */
.gfd-fr-main .gfd-sd-grid ul.products li.product img.wp-post-image,
.gfd-fr-main .gfd-sd-grid ul.products li.product img.attachment-woocommerce_thumbnail {
	aspect-ratio: 1 / 1 !important;
	width: 100% !important;
	height: auto !important;
	object-fit: cover !important;
	object-position: center top !important;
	display: block !important;
}

/* ---- Add-to-cart button: stop it being clipped on hover ----
   The theme positions the button absolute at bottom:7px. Setting
   overflow:visible on both .mkdf-pl-inner and li.product ensures
   the button is never clipped by either container.                      */
.gfd-fr-main .gfd-sd-grid ul.products li.product,
.gfd-fr-main .gfd-sd-grid ul.products li.product .mkdf-pl-inner {
	overflow: visible !important;
}

/* =============================================================
   RESULTS PAGE — mobile sidebar drawer
   ============================================================= */

@media (max-width: 900px) {
	.gfd-fr-layout {
		display: block;
	}

	.gfd-fr-filter-toggle {
		display: inline-flex;
	}

	.gfd-fr-sidebar {
		position: fixed;
		top: 0;
		left: 0;
		bottom: 0;
		z-index: 8900;
		width: 280px;
		max-width: 85vw;
		border-radius: 0;
		overflow-y: auto;
		transform: translateX(-100%);
		transition: transform 0.25s ease;
		box-shadow: 4px 0 24px rgba(0, 0, 0, 0.12);
	}

	.gfd-fr-sidebar.is-open {
		transform: translateX(0);
	}

	body.gfd-sidebar-open::after {
		content: '';
		position: fixed;
		inset: 0;
		z-index: 8800;
		background: rgba(30, 10, 50, 0.4);
	}

	.gfd-fr-sidebar-close {
		display: flex;
	}

	.gfd-fr-main .gfd-sd-grid ul.products {
		grid-template-columns: repeat(2, 1fr) !important;
	}
}

/* ---------- Mobile ---------- */
@media (max-width: 480px) {
	#gfd-finder-fab {
		bottom: 16px;
		left: 16px;
	}

	#gfd-finder-btn {
		padding: 10px 14px 10px 16px;
		font-size: 14px;
	}

	#gfd-finder-modal {
		padding: 28px 20px 24px;
		border-radius: 16px;
	}

	.gfd-step-brand {
		font-size: 24px;
	}

	.gfd-step-title {
		font-size: 19px;
		margin-bottom: 16px;
	}

	.gfd-fr-filters {
		gap: 10px;
	}

	.gfd-fr-cat-btn {
		padding: 6px 13px;
		font-size: 12px;
	}

	.gfd-cards { gap: 8px; }
	.gfd-card { padding: 12px 13px; }
	.gfd-card-icon { font-size: 20px; }
	.gfd-card-label { font-size: 13px; }

	.gfd-occ-grid { gap: 8px; }
	.gfd-occ-card { padding: 12px 6px; }
	.gfd-occ-icon { font-size: 22px; }
	.gfd-occ-label { font-size: 10px; }

	.gfd-fr-count { font-size: 16px; }
}
