/* ============================================================
 * phase-g.css — Phase G UX polish additions.
 *
 * Bundles styling for:
 *   - Recently-viewed strip (localStorage-driven, any page)
 *   - No-results empty state (search_results.php)
 *   - Header search dropdown (popular + autocomplete)
 *   - 404 page layout
 *   - Price-alert inline flow (Option C — inline, no modal)
 *   - Loading / interaction states (spinners, busy buttons)
 *   - Form success / error states
 *
 * Loaded after core/assets/style.css so rules here win the cascade where
 * needed. Kept in one file so the whole phase is easy to review/revert.
 * ============================================================ */


/* ----------------------------------------------------------
 * Recently-viewed strip
 * Hidden by default; JS unsets `hidden` after render if non-empty.
 * ---------------------------------------------------------- */

.recently-viewed-strip[hidden] { display: none; }

.recently-viewed-strip {
	margin: 1.5rem 0;
}

.recently-viewed-header {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	margin-bottom: 0.75rem;
}

.recently-viewed-title {
	/* font-size + weight + colour now inherited from .swipe-row-title
	   so this header reads identically to the More-from-{brand},
	   More-from-{store} and Related-products headings. Keep margin=0
	   so the header row's flex baseline alignment with the Clear
	   button stays clean. */
	margin: 0;
}
.recently-viewed-hint {
	font-style: italic;
	font-size: 0.7em;
	font-weight: 400;
	color: #888;
	margin-left: 0.4em;
	letter-spacing: 0;
}
@media (max-width: 767px) {
	/* Hide the inline "check multiple products to compare" hint on
	   mobile so the strip title stays on one line. The compare-checkbox
	   tray still works; the hint was a desktop-only flourish. Was
	   `display:block` originally — switched to `display:none` 2026-04-27
	   per user feedback. */
	.recently-viewed-hint { display: none; }
}
/* "compare" word in the hint — inert text by default; compare.js
   adds .is-active + an href once 2+ products are in the tray, at
   which point it becomes an underlined orange link. */
.rv-compare-link {
	color: inherit;
	text-decoration: none;
	cursor: default;
}
.rv-compare-link.is-active {
	color: #F68600;
	text-decoration: underline;
	cursor: pointer;
	font-weight: 500;
}
.rv-compare-link.is-active:hover {
	color: #d97500;
}

.recently-viewed-clear {
	background: none;
	border: none;
	color: #7e8683;
	font-size: 0.85rem;
	cursor: pointer;
	padding: 0.25rem 0.5rem;
	text-decoration: underline;
}
.recently-viewed-clear:hover { color: #333; }

/* Recently-viewed cards now render the same .grid_item.product
   markup as listings/related/more-from rows — see loop-product.php
   and the .product CSS in style.css. The old .recently-viewed-card
   styles have been removed; this comment kept as a finder for
   future debugging. */

/* ----------------------------------------------------------
 * No-results empty state
 * Used by search_results.php when product count is 0.
 * ---------------------------------------------------------- */

.empty-state {
	text-align: center;
	padding: 2.5rem 1rem 1.5rem;
}

/* Pure-CSS "no results" mark — avoids pulling in an FA glyph that
 * isn't guaranteed to be in the site's curated icon subset. A plain
 * ring with a faint diagonal line reads as "nothing found" at a glance. */
.empty-state-icon {
	width: 72px;
	height: 72px;
	margin: 0 auto 1rem;
	border: 4px solid #dde1df;
	border-radius: 50%;
	position: relative;
}
.empty-state-icon::after {
	content: "";
	position: absolute;
	top: 50%; left: 8%;
	width: 84%;
	height: 4px;
	background: #dde1df;
	transform: translateY(-50%) rotate(-45deg);
	border-radius: 2px;
}

.empty-state-title {
	font-size: 1.5rem;
	font-weight: 500;
	margin-bottom: 0.5rem;
}

.empty-state-body {
	color: #555;
	max-width: 540px;
	margin: 0 auto 1.5rem;
}

.empty-state-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	justify-content: center;
	margin-bottom: 1.5rem;
}

.empty-state-actions .btn-clear-filters {
	background: #7e8683;
	color: #fff;
	border: none;
	padding: 0.6rem 1.25rem;
	border-radius: 3px;
	text-decoration: none;
	font-size: 0.95rem;
}
.empty-state-actions .btn-clear-filters:hover {
	background: #5a615e;
	color: #fff;
	text-decoration: none;
}

.empty-state-suggestions {
	max-width: 720px;
	margin: 0 auto 2rem;
}

.empty-state-suggestions-title {
	font-size: 1rem;
	color: #555;
	margin-bottom: 0.75rem;
}

.empty-state-suggestions-list {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	justify-content: center;
	list-style: none;
	padding: 0;
	margin: 0;
}

.empty-state-suggestions-list a {
	display: inline-block;
	background: #f1f3f2;
	border: 1px solid #dde1df;
	padding: 0.4rem 0.9rem;
	border-radius: 20px;
	font-size: 0.9rem;
	text-decoration: none;
	color: #333;
}
.empty-state-suggestions-list a:hover {
	background: #e3e7e5;
	border-color: #b8c0bc;
	text-decoration: none;
}


/* ----------------------------------------------------------
 * Header search dropdown (popular + autocomplete)
 * Dropdown is a <div> sibling of the <input>, positioned absolutely
 * below the search form. Hidden by default.
 * ---------------------------------------------------------- */

.search_form, .search_form_2 {
	position: relative;
}

.search-dropdown {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	background: #fff;
	border: 1px solid #dde1df;
	border-top: none;
	border-radius: 0 0 4px 4px;
	box-shadow: 0 6px 16px rgba(0,0,0,0.08);
	max-height: 420px;
	overflow-y: auto;
	z-index: 200;
	display: none;
}
.search-dropdown.is-open { display: block; }

.search-dropdown-section-title {
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: #7e8683;
	padding: 0.6rem 1rem 0.3rem;
	margin: 0;
}

.search-dropdown-item {
	display: flex;
	align-items: center;
	padding: 0.5rem 1rem;
	text-decoration: none;
	color: #333;
	cursor: pointer;
	border-bottom: 1px solid #f1f3f2;
	font-size: 0.9rem;
}
.search-dropdown-item:last-child { border-bottom: none; }
.search-dropdown-item:hover,
.search-dropdown-item.is-focused {
	background: #f7f9f8;
	color: #333;
	text-decoration: none;
}

.search-dropdown-item .sd-icon {
	color: #b8c0bc;
	margin-right: 0.6rem;
	font-size: 0.85rem;
	width: 1em;
	text-align: center;
}

/* Type-indicator dot — replaces per-type FA icons so we don't depend on
 * curated glyphs. Colour per type. Popular = brand red so it feels "hot". */
.search-dropdown-item .sd-dot {
	display: inline-block;
	width: 6px;
	height: 6px;
	margin-right: 0.7rem;
	margin-left: 2px;
	border-radius: 50%;
	background: #b8c0bc;
	flex-shrink: 0;
}
.search-dropdown-item .sd-dot-popular  { background: #E10000; }
.search-dropdown-item .sd-dot-category { background: #4a7a5f; }
.search-dropdown-item .sd-dot-brand    { background: #4a6d8f; }

.search-dropdown-item .sd-term {
	flex: 1;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.search-dropdown-item .sd-term mark {
	background: none;
	color: inherit;
	font-weight: 600;
}

.search-dropdown-empty {
	padding: 1rem;
	color: #7e8683;
	font-size: 0.9rem;
	text-align: center;
}

.search-dropdown-loading {
	padding: 1rem;
	color: #7e8683;
	font-size: 0.85rem;
	text-align: center;
}


/* ----------------------------------------------------------
 * 404 page layout
 * ---------------------------------------------------------- */

.page-404 {
	padding: 2rem 1rem 3rem;
	max-width: 960px;
	margin: 0 auto;
}

.page-404-hero {
	text-align: center;
	padding: 1rem 0 2rem;
}

.page-404-image {
	display: inline-block;
	max-width: 280px;
	margin: 0 auto 1rem;
}
.page-404-image img {
	width: 100%;
	height: auto;
	display: block;
}

.page-404-title {
	font-size: 1.75rem;
	font-weight: 500;
	margin: 0.5rem 0 1rem;
}

.page-404-body {
	color: #555;
	max-width: 540px;
	margin: 0 auto 1.5rem;
}

.page-404-requested {
	color: #999;
	font-size: 0.85rem;
	margin-top: 1rem;
}

/* Search box — wider than the header one; the 404 hero gets the whole
 * row to itself so we can afford ~640px. Override the global .search_form
 * width:592px rule because this one sits inside a narrower container. */
.page-404-search {
	max-width: 640px;
	margin: 0 auto 2rem;
}

.page-404-search .search_form {
	width: 100%;
	position: relative;
}

.page-404-search input[type="text"] {
	width: 100%;
	padding: 0.85rem 7rem 0.85rem 1.1rem;
	border: 1px solid #dde1df;
	border-radius: 4px;
	font-size: 1rem;
	line-height: 1.4;
	height: auto;
	float: none;
}
.page-404-search button {
	position: absolute;
	right: 4px;
	top: 4px;
	bottom: 4px;
	padding: 0 1.25rem;
	background: #7e8683;
	color: #fff;
	border: none;
	border-radius: 3px;
	cursor: pointer;
	font-size: 0.95rem;
	min-width: 90px;
}

.page-404-section {
	margin: 2rem 0;
}

.page-404-section-title {
	font-size: 1.25rem;
	margin-bottom: 0.75rem;
}

.page-404-category-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
	gap: 0.75rem;
}

.page-404-category-card {
	background: #f7f9f8;
	border: 1px solid #e5e8e7;
	border-radius: 4px;
	padding: 0.75rem 1rem;
	text-align: center;
	text-decoration: none;
	color: #333;
	font-size: 0.9rem;
	transition: background 0.15s;
}
.page-404-category-card:hover {
	background: #e3e7e5;
	color: #333;
	text-decoration: none;
}


/* ----------------------------------------------------------
 * Price-alert inline flow (Option C)
 * Trigger is a proper button; form slide-down on click.
 * ---------------------------------------------------------- */

.watch-price {
	margin-top: 0.75rem;
}

.watch-price-btn {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	background: #fff;
	border: 1px solid #dde1df;
	border-radius: 3px;
	padding: 0.5rem 0.9rem;
	font-size: 0.9rem;
	color: #333;
	cursor: pointer;
	transition: border-color 0.15s, background 0.15s;
}
.watch-price-btn:hover {
	border-color: #7e8683;
	background: #f7f9f8;
}
.watch-price-btn.is-open {
	border-color: #7e8683;
	background: #f7f9f8;
}
.watch-price-btn i { color: #7e8683; }

.watch-price-body {
	display: none;
	margin-top: 0.6rem;
	padding: 0.9rem;
	background: #f7f9f8;
	border: 1px solid #e5e8e7;
	border-radius: 4px;
}
.watch-price-body.is-open { display: block; }

.watch-price-form .form-row {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	align-items: center;
}
.watch-price-form input[type="email"] { flex: 1; min-width: 180px; max-width: 260px; }
.watch-price-form input[type="number"] { max-width: 160px; }

.watch-price-hint {
	display: block;
	margin-top: 0.5rem;
	font-size: 0.8rem;
	color: #7e8683;
}

.watch-price-success {
	display: none;
	padding: 0.9rem;
	background: #eef6ef;
	border: 1px solid #c9e2cc;
	border-radius: 4px;
	color: #2e5a34;
	font-size: 0.9rem;
	margin-top: 0.6rem;
}
.watch-price-success.is-open { display: block; }


/* ----------------------------------------------------------
 * Generic form states (inline validation, success, error)
 * Applied to .lhs-form elements across subscribe/watch/etc.
 * ---------------------------------------------------------- */

.lhs-form .form-error {
	display: none;
	margin-top: 0.5rem;
	padding: 0.5rem 0.75rem;
	background: #fbeaea;
	border: 1px solid #e8c1c1;
	border-radius: 3px;
	color: #8a2a2a;
	font-size: 0.85rem;
}
.lhs-form .form-error.is-open { display: block; }

.lhs-form .form-success {
	display: none;
	margin-top: 0.5rem;
	padding: 0.5rem 0.75rem;
	background: #eef6ef;
	border: 1px solid #c9e2cc;
	border-radius: 3px;
	color: #2e5a34;
	font-size: 0.85rem;
}
.lhs-form .form-success.is-open { display: block; }

.lhs-form input.is-invalid,
.lhs-form textarea.is-invalid {
	border-color: #c47a7a !important;
	background: #fff7f7;
}

/* ----------------------------------------------------------
 * Loading / busy states
 * ---------------------------------------------------------- */

.btn[aria-busy="true"],
button[aria-busy="true"],
input[aria-busy="true"] {
	position: relative;
	color: transparent !important;
	pointer-events: none;
}
.btn[aria-busy="true"]::after,
button[aria-busy="true"]::after {
	content: "";
	position: absolute;
	top: 50%; left: 50%;
	width: 1em; height: 1em;
	margin: -0.5em 0 0 -0.5em;
	border: 2px solid currentColor;
	border-right-color: transparent;
	border-radius: 50%;
	color: #fff;
	animation: lhs-spin 0.7s linear infinite;
}

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

/* Inline spinner that can be slotted anywhere (e.g. filter sidebar while
 * a filter change is submitting). Usage: <span class="lhs-spinner"></span> */
.lhs-spinner {
	display: inline-block;
	width: 1em; height: 1em;
	border: 2px solid rgba(126, 134, 131, 0.3);
	border-right-color: #7e8683;
	border-radius: 50%;
	animation: lhs-spin 0.7s linear infinite;
	vertical-align: middle;
}

/* Dim the product grid while a filter/sort change is in-flight. Gives the
 * user a visible "working" signal on what was otherwise a silent reload.
 * No transition on the way IN — needs to feel instant when user clicks. */
.grid_styling.is-loading {
	opacity: 0.35;
	pointer-events: none;
}

/* Top progress bar shown during filter/sort navigation.
 * Brand red (#E10000 — matches .featured_save and the on-sale menu link)
 * so the loading signal ties visually to "this site is about deals". */
.lhs-topbar {
	position: fixed;
	top: 0; left: 0;
	height: 6px;
	width: 0;
	z-index: 9999;
	pointer-events: none;
	background-image: linear-gradient(90deg, #E10000 0%, #ff4d4d 50%, #E10000 100%);
	background-size: 200% 100%;
	box-shadow: 0 2px 10px rgba(225, 0, 0, 0.55);
	opacity: 0;
	transition: width 0.25s ease, opacity 0.1s ease;
}
.lhs-topbar.is-active {
	width: 70%;
	opacity: 1;
	animation: lhs-topbar-shimmer 1.1s linear infinite;
}
@keyframes lhs-topbar-shimmer {
	0%   { background-position:   0% 50%; }
	100% { background-position: 200% 50%; }
}


/* ----------------------------------------------------------
 * Category-page breadcrumb trail (Phase H item #2)
 *
 * Rendered by site/search-templates/default.php above the category H1.
 * Mirrors the BreadcrumbList JSON-LD emitted by search.php. Core
 * .breadcrumbs class already has font-size / margin; we just add link
 * colour + a lighter separator glyph so it reads as navigation, not body.
 * ---------------------------------------------------------- */
.category-breadcrumbs {
	color: #666;
}
.category-breadcrumbs a {
	color: #5a5a5a;
	text-decoration: none;
}
.category-breadcrumbs a:hover {
	text-decoration: underline;
}
.category-breadcrumbs .sep {
	color: #bbb;
	margin: 0 2px;
}
.category-breadcrumbs [aria-current="page"] {
	color: #222;
}

