/* Pure Herbs Modern - Premium Shop Styles
   Full overhaul to match the high-end homepage design.
*/

:root {
	--ph-shop-sidebar-w: 280px;
	--ph-shop-accent: var(--ph-sage);
	--ph-shop-bg: #fff;
	--ph-shop-line: var(--ph-line);
}

/* Shop Hero Section */
.ph-shop-hero {
	position: relative;
	min-height: 420px;
	display: flex;
	align-items: center;
	overflow: hidden;
	background: #fff;
}

.ph-shop-hero__bg {
	position: absolute;
	inset: 0;
	z-index: 0;
}

.ph-shop-hero__gradient {
	position: absolute;
	inset: 0;
	background: 
		radial-gradient(circle at 20% 30%, var(--ph-mint-soft) 0%, transparent 50%),
		radial-gradient(circle at 80% 70%, rgba(213, 168, 77, 0.1) 0%, transparent 50%),
		linear-gradient(135deg, #f8fbf9 0%, #ffffff 100%);
}

.ph-shop-hero__noise {
	position: absolute;
	inset: 0;
	background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
	opacity: 0.04;
	pointer-events: none;
}

.ph-shop-hero__leaves {
	position: absolute;
	inset: 0;
	pointer-events: none;
	z-index: 1;
}

.ph-shop-hero__leaves .ph-leaf {
	position: absolute;
	opacity: 0.8;
	filter: blur(0.5px);
}

.ph-shop-hero__leaves .ph-leaf--1 {
	top: 10%;
	right: 5%;
	width: 280px;
	transform: rotate(15deg);
}

.ph-shop-hero__leaves .ph-leaf--2 {
	bottom: -5%;
	left: 5%;
	width: 180px;
	transform: rotate(-25deg);
}

.ph-shop-hero__leaves .ph-leaf--3 {
	top: 20%;
	left: 15%;
	width: 120px;
	opacity: 0.4;
	filter: blur(4px);
}

.ph-shop-hero__inner {
	position: relative;
	z-index: 2;
	width: var(--ph-wrap);
	margin: 0 auto;
}

.ph-shop-hero__card {
	max-width: 600px;
	padding: 60px;
	background: rgba(255, 255, 255, 0.6);
	backdrop-filter: blur(20px) saturate(180%);
	border: 1px solid rgba(255, 255, 255, 0.4);
	border-radius: var(--ph-radius);
	box-shadow: 
		0 20px 50px rgba(23, 35, 29, 0.05),
		inset 0 0 20px rgba(255, 255, 255, 0.5);
}

.ph-shop-hero__content {
	position: relative;
}

.ph-shop-hero h1 {
	margin: 15px 0 20px;
	font-size: clamp(2.5rem, 5vw, 3.8rem);
	line-height: 1;
	letter-spacing: -0.03em;
	color: var(--ph-ink);
	font-weight: 900;
}

.ph-shop-hero__desc {
	font-size: 1.2rem;
	color: var(--ph-muted);
	line-height: 1.6;
	max-width: 480px;
}

@media (max-width: 768px) {
	.ph-shop-hero {
		min-height: 340px;
		padding: 40px 0;
	}

	.ph-shop-hero__card {
		padding: 30px;
		margin: 0 15px;
	}

	.ph-shop-hero__leaves .ph-leaf--1 {
		width: 180px;
	}
}

/* Shop Layout */
.ph-shop-layout {
	display: flex;
	gap: 40px;
	width: var(--ph-wrap);
	margin: 0 auto;
	padding: 60px 0;
	align-items: flex-start;
}

/* Sidebar Styling - Premium Glassmorphic Look */
.ph-shop-sidebar {
	flex: 0 0 var(--ph-shop-sidebar-w);
	position: sticky;
	top: 100px;
	padding: 24px;
	border: 1px solid var(--ph-shop-line);
	border-radius: var(--ph-radius);
	background: rgba(255, 255, 255, 0.7);
	backdrop-filter: blur(10px);
	box-shadow: 0 15px 35px rgba(23, 35, 29, 0.05);
}

.ph-sidebar-section {
	margin-bottom: 30px;
}

.ph-sidebar-section:last-child {
	margin-bottom: 0;
}

.ph-sidebar-section h3 {
	margin: 0 0 15px;
	font-size: 0.9rem;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--ph-ink);
	border-bottom: 1px solid var(--ph-line);
	padding-bottom: 8px;
}

.ph-sidebar-search {
	position: relative;
	display: flex;
}

.ph-sidebar-search input {
	width: 100%;
	height: 44px;
	padding: 0 40px 0 15px;
	border: 1px solid var(--ph-line);
	border-radius: var(--ph-radius-sm);
	background: #fff;
	font-size: 0.9rem;
}

.ph-sidebar-search button {
	position: absolute;
	right: 12px;
	top: 50%;
	transform: translateY(-50%);
	background: none;
	border: none;
	color: var(--ph-muted);
	display: grid;
	place-items: center;
}

.ph-sidebar-list {
	list-style: none;
	padding: 0;
	margin: 0;
}

.ph-sidebar-list li {
	margin-bottom: 6px;
}

.ph-sidebar-list a {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 8px 12px;
	border-radius: 6px;
	color: var(--ph-muted);
	font-size: 0.95rem;
	transition: all 0.2s ease;
}

.ph-sidebar-list a:hover {
	background: var(--ph-mint-soft);
	color: var(--ph-sage);
	transform: translateX(4px);
}

.ph-sidebar-list a.is-active {
	background: var(--ph-sage);
	color: #fff;
	font-weight: 600;
}

.ph-sidebar-count {
	font-size: 0.8rem;
	opacity: 0.7;
}

.ph-sidebar-list a.is-active .ph-sidebar-count {
	opacity: 1;
}

.ph-sidebar-reset {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 40px;
	margin-top: 20px;
	border: 1px dashed var(--ph-sage);
	border-radius: 6px;
	color: var(--ph-sage);
	font-size: 0.85rem;
	font-weight: 700;
	transition: all 0.2s ease;
}

.ph-sidebar-reset:hover {
	background: var(--ph-sage);
	color: #fff;
	border-style: solid;
}

/* Main Shop Area */
.ph-shop-main {
	flex: 1;
	min-width: 0;
}

.ph-shop-toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 30px;
	gap: 20px;
}

/* Search bar only shows on mobile (mobile-app.css handles display) */
.ph-shop-search-bar { display: none; }

.ph-filter-toggle {
	display: none; /* Desktop hidden */
	align-items: center;
	gap: 8px;
	height: 44px;
	padding: 0 18px;
	border: 1px solid var(--ph-line);
	border-radius: var(--ph-radius-sm);
	background: #fff;
	font-weight: 700;
	color: var(--ph-ink);
}

.ph-shop-toolbar .woocommerce-result-count {
	margin: 0;
	color: var(--ph-muted);
	font-size: 0.9rem;
}

.ph-shop-toolbar .woocommerce-ordering {
	margin: 0;
}

.ph-shop-toolbar .woocommerce-ordering select {
	height: 44px;
	border: 1px solid var(--ph-line);
	border-radius: var(--ph-radius-sm);
	background: #fff;
	padding: 0 15px;
	font-size: 0.9rem;
	color: var(--ph-ink);
	cursor: pointer;
}

/* Product Grid Adjustments for Shop */
.ph-shop-products {
	position: relative;
}

.ph-shop-products .ph-product-grid {
	width: 100%; /* Override var(--ph-wrap) since it's already in the layout */
	grid-template-columns: repeat(3, 1fr);
}

.ph-shop-item {
	/* Ensure li has no default styles that break card */
	list-style: none !important;
	padding: 0 !important;
	margin: 0 !important;
}

/* Loading Overlay */
.ph-shop-loading {
	position: absolute;
	inset: 0;
	z-index: 10;
	background: rgba(255, 255, 255, 0.8);
	backdrop-filter: blur(4px);
	display: none; /* Toggle via JS */
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 15px;
	border-radius: var(--ph-radius);
}

.ph-shop-loading[aria-hidden="false"] {
	display: flex;
}

/* Pagination Styling */
.ph-shop-products .woocommerce-pagination {
	margin-top: 50px;
	text-align: center;
}

.ph-shop-products .woocommerce-pagination ul {
	display: inline-flex;
	gap: 8px;
	border: none;
	padding: 0;
	list-style: none;
}

.ph-shop-products .woocommerce-pagination ul li {
	border: none;
}

.ph-shop-products .woocommerce-pagination ul li a,
.ph-shop-products .woocommerce-pagination ul li span {
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	border: 1px solid var(--ph-line);
	border-radius: var(--ph-radius-sm);
	background: #fff;
	color: var(--ph-ink);
	font-weight: 700;
	transition: all 0.2s ease;
}

.ph-shop-products .woocommerce-pagination ul li span.current {
	background: var(--ph-sage);
	color: #fff;
	border-color: var(--ph-sage);
}

.ph-shop-products .woocommerce-pagination ul li a:hover {
	border-color: var(--ph-sage);
	color: var(--ph-sage);
	transform: translateY(-2px);
}

/* Shop Overlay for mobile filters */
.ph-shop-overlay {
	position: fixed;
	inset: 0;
	z-index: 999;
	background: rgba(23, 35, 29, 0.4);
	backdrop-filter: blur(4px);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s ease, visibility 0.3s ease;
}

.ph-shop-overlay.is-visible {
	opacity: 1;
	visibility: visible;
}

/* Responsive Overrides */
@media (max-width: 1200px) {
	.ph-shop-products .ph-product-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 1024px) {
	.ph-shop-layout {
		flex-direction: column;
		gap: 30px;
	}

	.ph-shop-sidebar {
		position: fixed;
		inset: 0 auto 0 0;
		z-index: 1000;
		width: 300px;
		height: 100dvh;
		border-radius: 0;
		transform: translateX(-100%);
		transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
		background: #fff;
		overflow-y: auto;
	}

	.ph-shop-sidebar.is-open {
		transform: translateX(0);
	}

	.ph-sidebar-close {
		display: grid;
		place-items: center;
		width: 40px;
		height: 40px;
		position: absolute;
		right: 10px;
		top: 10px;
		background: var(--ph-mint-soft);
		border: none;
		border-radius: 50%;
		color: var(--ph-sage);
	}

	.ph-filter-toggle {
		display: inline-flex;
	}
}

@media (max-width: 600px) {
	.ph-shop-products .ph-product-grid {
		grid-template-columns: 1fr;
	}

	.ph-shop-hero {
		padding: 60px 0 40px;
	}

	.ph-shop-toolbar {
		flex-direction: column;
		align-items: stretch;
	}

	.ph-shop-toolbar .woocommerce-ordering {
		width: 100%;
	}

	.ph-shop-toolbar .woocommerce-ordering select {
		width: 100%;
	}
}

/* ── Sidebar head ── */
.ph-shop-sidebar__inner {
	display: flex;
	flex-direction: column;
	gap: 0;
}

.ph-shop-sidebar__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 20px;
}

.ph-shop-sidebar__title {
	font-size: .82rem;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: .06em;
	color: var(--ph-ink);
}

.ph-sidebar-close {
	display: none;
	place-items: center;
	width: 32px;
	height: 32px;
	border: 1px solid var(--ph-line);
	border-radius: 50%;
	background: var(--ph-white);
	color: var(--ph-muted);
	cursor: pointer;
}

.ph-sidebar-link {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 7px 10px;
	border-radius: 6px;
	color: var(--ph-muted);
	font-size: .8rem;
	transition: background .18s ease, color .18s ease;
}

.ph-sidebar-link:hover {
	background: var(--ph-mint-soft);
	color: var(--ph-sage);
}

.ph-sidebar-link.is-active {
	background: var(--ph-sage);
	color: #fff;
	font-weight: 700;
}

.ph-sidebar-count {
	font-size: .72rem;
	opacity: .75;
	margin-left: 4px;
}

.ph-sidebar-link.is-active .ph-sidebar-count {
	opacity: 1;
}

/* ── Price Range Slider ── */
.ph-sidebar-price {
	background: var(--ph-mint-soft);
	padding: 14px;
	border-radius: var(--ph-radius);
	border: 1px solid var(--ph-line);
}

.ph-price-range-wrap {
	position: relative;
	height: 4px;
	margin: 18px 0 10px;
}

.ph-range-track {
	position: absolute;
	inset: 0;
	border-radius: 999px;
	background: var(--ph-line);
}

.ph-range-fill {
	position: absolute;
	top: 0;
	bottom: 0;
	border-radius: 999px;
	background: var(--ph-sage);
	left: 0%;
	right: 0%;
}

.ph-range-input {
	position: absolute;
	top: 50%;
	left: 0;
	width: 100%;
	height: 4px;
	transform: translateY(-50%);
	appearance: none;
	-webkit-appearance: none;
	background: transparent;
	pointer-events: none;
	outline: none;
	margin: 0;
}

.ph-range-input::-webkit-slider-thumb {
	appearance: none;
	-webkit-appearance: none;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: #fff;
	border: 2px solid var(--ph-sage);
	box-shadow: 0 2px 8px rgba(23,35,29,.18);
	cursor: pointer;
	pointer-events: all;
	transition: transform .15s ease, box-shadow .15s ease;
}

.ph-range-input::-webkit-slider-thumb:hover,
.ph-range-input:focus::-webkit-slider-thumb {
	transform: scale(1.2);
	box-shadow: 0 0 0 4px rgba(62,111,91,.18);
}

.ph-range-input::-moz-range-thumb {
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: #fff;
	border: 2px solid var(--ph-sage);
	cursor: pointer;
	pointer-events: all;
}

.ph-range-labels {
	display: flex;
	justify-content: space-between;
	font-size: .75rem;
	color: var(--ph-muted);
	margin-top: 14px;
}

.ph-range-labels strong {
	color: var(--ph-ink);
	font-weight: 700;
}

.ph-range-apply {
	display: block;
	width: 100%;
	margin-top: 12px;
	padding: 9px;
	border: none;
	border-radius: 6px;
	background: var(--ph-sage);
	color: #fff;
	font-size: .78rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .04em;
	cursor: pointer;
	transition: background .18s ease;
}

.ph-range-apply:hover {
	background: #294d3f;
}

/* ── Toolbar right ── */
.ph-toolbar-right {
	display: flex;
	align-items: center;
	gap: 14px;
	margin-left: auto;
}

.ph-toolbar-right .woocommerce-result-count {
	margin: 0;
	font-size: .78rem;
	color: var(--ph-muted);
	white-space: nowrap;
}

.ph-toolbar-right .woocommerce-ordering {
	margin: 0;
}

.ph-toolbar-right .woocommerce-ordering select {
	height: 38px;
	padding: 0 12px;
	border: 1px solid var(--ph-line);
	border-radius: var(--ph-radius-sm);
	background: #fff;
	font-size: .78rem;
	color: var(--ph-ink);
	cursor: pointer;
}

/* ── Skeleton Loader ── */
@keyframes ph-shimmer {
	0%   { background-position: -400px 0; }
	100% { background-position:  400px 0; }
}

.ph-shop-skeleton {
	display: none;
	grid-template-columns: repeat(3, 1fr);
	gap: 18px;
	width: 100%;
}

.ph-shop-skeleton[aria-hidden="false"] {
	display: grid;
}

.ph-sk-card {
	border: 1px solid var(--ph-line);
	border-radius: var(--ph-radius);
	overflow: hidden;
	background: #fff;
	padding: 0 0 14px;
}

.ph-sk {
	background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
	background-size: 400px 100%;
	animation: ph-shimmer 1.4s ease-in-out infinite;
	border-radius: 4px;
}

.ph-sk--img   { height: 180px; border-radius: 0; margin-bottom: 12px; }
.ph-sk--title { height: 14px;  width: 85%; margin: 0 14px 8px; }
.ph-sk--text  { height: 11px;  width: 60%; margin: 0 14px 8px; }
.ph-sk--price { height: 13px;  width: 45%; margin: 0 14px 12px; }
.ph-sk--btn   { height: 36px;  margin: 0 14px; border-radius: 6px; }

/* ── Pagination ── */
.ph-pagination {
	margin-top: 40px;
}

.ph-pagination ul {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	list-style: none;
	padding: 0;
	margin: 0;
	justify-content: center;
}

.ph-pagination ul li { border: none; }

.ph-page-number {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 38px;
	height: 38px;
	padding: 0 10px;
	border: 1px solid var(--ph-line);
	border-radius: var(--ph-radius-sm);
	background: #fff;
	color: var(--ph-ink);
	font-size: .78rem;
	font-weight: 700;
	transition: all .18s ease;
}

.ph-page-number:hover {
	border-color: var(--ph-sage);
	color: var(--ph-sage);
	transform: translateY(-2px);
}

.ph-page-number.current {
	background: var(--ph-sage);
	border-color: var(--ph-sage);
	color: #fff;
}

.ph-page-number svg { vertical-align: middle; }

/* ── Shop products transition ── */
.ph-shop-products {
	transition: opacity .25s ease;
}

/* ── Responsive: sidebar as drawer on tablet/mobile ── */
@media (max-width: 1024px) {
	.ph-sidebar-close { display: grid; }

	.ph-shop-skeleton {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (min-width: 769px) and (max-width: 1024px) {
	#ph-shop-layout,
	.ph-shop-layout {
		display: grid !important;
		grid-template-columns: 1fr !important;
		gap: 24px !important;
		width: min(100% - 48px, 980px) !important;
		padding-top: 34px !important;
	}

	.ph-shop-main {
		width: 100% !important;
		min-width: 0 !important;
	}

	.ph-shop-toolbar {
		position: relative;
		z-index: 5;
		display: grid !important;
		grid-template-columns: auto minmax(0, 1fr);
		align-items: center;
		gap: 14px;
		margin-bottom: 24px;
		padding-bottom: 14px;
		border-bottom: 1px solid var(--ph-line);
	}

	.ph-filter-toggle {
		display: inline-flex !important;
		width: max-content;
	}

	.ph-toolbar-right {
		display: flex;
		align-items: center;
		justify-content: flex-end;
		gap: 14px;
		min-width: 0;
	}

	.ph-toolbar-right .woocommerce-result-count {
		white-space: nowrap;
	}

	.ph-toolbar-right .woocommerce-ordering select {
		width: min(220px, 100%);
	}

	#ph-shop-products,
	.ph-shop-products {
		padding-top: 8px;
		overflow: visible;
	}

	#ph-shop-products > .woocommerce-result-count,
	#ph-shop-products > .woocommerce-ordering,
	.ph-shop-products > .woocommerce-result-count,
	.ph-shop-products > .woocommerce-ordering {
		display: none !important;
	}

	#ph-shop-products .ph-product-grid,
	#ph-shop-products .woocommerce ul.products,
	.ph-shop-products .ph-product-grid,
	.ph-shop-products .woocommerce ul.products {
		grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
		gap: 18px !important;
		width: 100% !important;
		margin: 0 !important;
		padding: 0 !important;
		overflow: visible !important;
	}

	.ph-product-card__img-wrap {
		overflow: visible;
	}

	.ph-product-card__image,
	.woocommerce ul.products li.product a img {
		object-fit: contain;
		object-position: center;
	}
}

@media (max-width: 600px) {
	.ph-shop-skeleton {
		grid-template-columns: 1fr;
	}

	.ph-toolbar-right {
		flex-wrap: wrap;
		gap: 8px;
	}
}

/* ── My Account: Login + Register two-column layout ── */
.woocommerce-account #customer_login.col2-set {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 40px;
	align-items: start;
}

.woocommerce-account #customer_login .col-1,
.woocommerce-account #customer_login .col-2 {
	background: #fff;
	border: 1px solid #eee;
	border-radius: 12px;
	padding: 32px;
	box-shadow: 0 2px 12px rgba(0,0,0,.06);
}

.woocommerce-account #customer_login h2 {
	font-size: 1.25rem;
	font-weight: 700;
	margin-bottom: 20px;
	color: #1a1a1a;
}

@media (max-width: 768px) {
	.woocommerce-account #customer_login.col2-set {
		grid-template-columns: 1fr;
	}
}
