/*
 * NPH Hub Home — homepage-only styles. Every selector is scoped under
 * .nph-app-home so nothing here can affect any other page (Section 19).
 * Colors, radii, shadows, and the store-slider mechanics follow the exact
 * spec provided in the brief.
 */

.nph-app-home {
	--nphhh-primary: #159447;
	--nphhh-primary-dark: #0F6B36;
	--nphhh-black: #111827;
	--nphhh-dark-gray: #374151;
	--nphhh-gray: #6B7280;
	--nphhh-light-gray: #F3F4F6;
	--nphhh-border: #E5E7EB;
	--nphhh-white: #FFFFFF;

	background: var(--nphhh-white);
	color: var(--nphhh-black);
	max-width: 100vw;
	overflow-x: hidden;
	box-sizing: border-box;
}
.nph-app-home *,
.nph-app-home *::before,
.nph-app-home *::after {
	box-sizing: border-box;
}
.nph-app-home a {
	text-decoration: none;
	color: inherit;
}
.nph-app-home button {
	font-family: inherit;
	cursor: pointer;
}
.nph-app-home img {
	max-width: 100%;
}

/* ===================== App bar ===================== */
.nph-app-home .nph-app-bar {
	position: sticky;
	top: 0;
	z-index: 40;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	height: 72px;
	max-height: 72px;
	padding: 0 20px;
	background: var(--nphhh-white);
	border-bottom: 1px solid var(--nphhh-border);
}
.nph-app-home .nph-app-bar-location {
	display: flex;
	align-items: center;
	gap: 8px;
	min-width: 0;
}
.nph-app-home .nph-app-bar-pin {
	width: 24px;
	height: 24px;
	color: var(--nphhh-primary);
	flex-shrink: 0;
}
.nph-app-home .nph-app-bar-location-text {
	display: flex;
	flex-direction: column;
	line-height: 1.25;
	min-width: 0;
}
.nph-app-home .nph-app-bar-location-text strong {
	font-size: 15px;
	color: var(--nphhh-black);
}
.nph-app-home .nph-app-bar-district {
	border: none;
	background: transparent;
	color: var(--nphhh-gray);
	font-size: 13px;
	padding: 0;
	max-width: 40vw;
}
.nph-app-home .nph-app-bar-actions {
	display: flex;
	align-items: center;
	gap: 6px;
	flex-shrink: 0;
}
.nph-app-home .nph-app-bar-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	color: var(--nphhh-black);
	transition: background 0.2s ease;
}
.nph-app-home .nph-app-bar-btn:hover {
	background: var(--nphhh-light-gray);
}
.nph-app-home .nph-app-bar-btn .nph-icon,
.nph-app-home .nph-app-bar-btn svg {
	width: 22px;
	height: 22px;
}

/* ===================== Hero ===================== */
.nph-app-home .nph-hero {
	position: relative;
	background: var(--nphhh-white);
	overflow: hidden;
	padding: 36px 20px 28px;
}
.nph-app-home .nph-hero-watermark {
	position: absolute;
	top: 50%;
	right: -10%;
	transform: translateY(-50%);
	width: 60%;
	max-width: 420px;
	color: var(--nphhh-gray);
	opacity: 0.1;
	pointer-events: none;
	z-index: 0;
}
.nph-app-home .nph-hero-watermark svg {
	width: 100%;
	height: auto;
	display: block;
}
.nph-app-home .nph-hero-inner {
	position: relative;
	z-index: 1;
	max-width: 720px;
}
.nph-app-home .nph-hero-title {
	margin: 0 0 10px;
	font-size: clamp(30px, 6vw, 44px);
	line-height: 1.15;
	font-weight: 800;
}
.nph-app-home .nph-hero-title-green {
	color: var(--nphhh-primary);
}
.nph-app-home .nph-hero-title-black {
	color: var(--nphhh-black);
}
.nph-app-home .nph-hero-lead {
	margin: 0 0 6px;
	font-size: 16px;
	font-weight: 600;
	color: var(--nphhh-dark-gray);
}
.nph-app-home .nph-hero-sub {
	margin: 0 0 22px;
	font-size: 14px;
	color: var(--nphhh-gray);
	line-height: 1.6;
}

/* ===================== Search box ===================== */
.nph-app-home .nph-search-box {
	background: var(--nphhh-white);
	border: 1px solid var(--nphhh-border);
	border-radius: 20px;
	box-shadow: 0 10px 28px rgba(17, 24, 39, 0.08);
	padding: 14px;
	display: flex;
	flex-direction: column;
	gap: 10px;
}
.nph-app-home .nph-search-input-wrap {
	display: flex;
	align-items: center;
	gap: 10px;
	background: var(--nphhh-light-gray);
	border-radius: 14px;
	padding: 0 14px;
	height: 48px;
}
.nph-app-home .nph-search-icon {
	width: 20px;
	height: 20px;
	color: var(--nphhh-gray);
	flex-shrink: 0;
}
.nph-app-home .nph-search-input-wrap input {
	border: none;
	background: transparent;
	outline: none;
	width: 100%;
	font-size: 14px;
	color: var(--nphhh-black);
}
.nph-app-home .nph-search-filters {
	display: flex;
	flex-direction: column;
	gap: 10px;
}
.nph-app-home .nph-search-filters select {
	height: 48px;
	border: 1px solid var(--nphhh-border);
	border-radius: 14px;
	padding: 0 14px;
	background: var(--nphhh-white);
	color: var(--nphhh-dark-gray);
	font-size: 14px;
	width: 100%;
}
.nph-app-home .nph-search-submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	height: 52px;
	min-height: 52px;
	border: none;
	border-radius: 16px;
	background: var(--nphhh-primary);
	color: var(--nphhh-white);
	font-weight: 700;
	font-size: 15px;
	width: 100%;
	transition: background 0.2s ease;
}
.nph-app-home .nph-search-submit:hover {
	background: var(--nphhh-primary-dark);
}
.nph-app-home .nph-search-submit .nph-icon {
	width: 18px;
	height: 18px;
}

/* ===================== Quick actions ===================== */
.nph-app-home .nph-quick-actions {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 10px;
	padding: 20px 20px 4px;
}
.nph-app-home .nph-quick-action {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	background: var(--nphhh-white);
	border: 1px solid var(--nphhh-border);
	border-radius: 20px;
	padding: 14px 6px;
	text-align: center;
	box-shadow: 0 6px 18px rgba(17, 24, 39, 0.05);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
	min-width: 0;
}
.nph-app-home .nph-quick-action:hover {
	transform: translateY(-3px);
	box-shadow: 0 12px 24px rgba(17, 24, 39, 0.1);
}
.nph-app-home .nph-quick-action-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	background: #EAF7EF;
	color: var(--nphhh-primary);
}
.nph-app-home .nph-quick-action-icon .nph-icon {
	width: 24px;
	height: 24px;
}
.nph-app-home .nph-quick-action-label {
	font-size: 13px;
	font-weight: 700;
	color: var(--nphhh-black);
	overflow-wrap: break-word;
}
.nph-app-home .nph-quick-action-count {
	font-size: 11px;
	color: var(--nphhh-gray);
}

/* ===================== Section header (shared) ===================== */
.nph-app-home .nph-section-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 0 20px;
	margin-bottom: 14px;
}
.nph-app-home .nph-section-header h2 {
	margin: 0;
	font-size: 19px;
	font-weight: 800;
	color: var(--nphhh-black);
}
.nph-app-home .nph-section-header p {
	margin: 2px 0 0;
	font-size: 13px;
	color: var(--nphhh-gray);
}
.nph-app-home .nph-see-all {
	flex-shrink: 0;
	font-size: 13px;
	font-weight: 700;
	color: var(--nphhh-primary);
	white-space: nowrap;
}

/* ===================== Popular categories ===================== */
.nph-app-home .nph-popular-categories {
	margin-top: 26px;
}
.nph-app-home .nph-popular-categories-scroll {
	display: flex;
	gap: 12px;
	overflow-x: auto;
	scroll-snap-type: x proximity;
	-webkit-overflow-scrolling: touch;
	padding: 2px 20px 14px;
	scrollbar-width: none;
}
.nph-app-home .nph-popular-categories-scroll::-webkit-scrollbar {
	display: none;
}
.nph-app-home .nph-popular-category-card {
	flex: 0 0 auto;
	scroll-snap-align: start;
	width: 108px;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	text-align: center;
	background: var(--nphhh-white);
	border: 1px solid var(--nphhh-border);
	border-radius: 18px;
	padding: 14px 8px;
	box-shadow: 0 6px 16px rgba(17, 24, 39, 0.05);
}
.nph-app-home .nph-popular-category-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	border-radius: 50%;
	background: var(--nphhh-light-gray);
	color: var(--nphhh-primary);
}
.nph-app-home .nph-popular-category-icon .nph-icon {
	width: 22px;
	height: 22px;
}
.nph-app-home .nph-popular-category-label {
	font-size: 12.5px;
	font-weight: 700;
	color: var(--nphhh-black);
}
.nph-app-home .nph-popular-category-count {
	font-size: 11px;
	color: var(--nphhh-gray);
}

/* ===================== All categories ("เลือกดูตามหมวดหมู่") ===================== */
.nph-app-home .nph-all-categories {
	margin-top: 30px;
	padding: 0 20px;
}

.nph-app-home .nph-all-category-grid {
	display: grid;
	grid-template-columns: repeat(8, minmax(0, 1fr));
	gap: 14px;
}

.nph-app-home .nph-all-category-card {
	min-width: 0;
	padding: 14px 8px;
	text-align: center;
	background: var(--nphhh-white);
	border: 1px solid var(--nphhh-border);
	border-radius: 18px;
	color: var(--nphhh-black);
	transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.nph-app-home .nph-all-category-card:hover {
	transform: translateY(-3px);
	box-shadow: 0 10px 26px rgba(17, 24, 39, 0.08);
}

.nph-app-home .nph-all-category-icon {
	width: 54px;
	height: 54px;
	margin: 0 auto 8px;
	border-radius: 16px;
	display: grid;
	place-items: center;
	background: #EAF7EF;
	color: var(--nphhh-primary);
}
.nph-app-home .nph-all-category-icon .nph-icon {
	width: 26px;
	height: 26px;
}

.nph-app-home .nph-all-category-name {
	display: -webkit-box;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.35;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.nph-app-home .nph-all-category-count {
	display: block;
	margin-top: 4px;
	color: var(--nphhh-gray);
	font-size: 12px;
}

.nph-app-home .nph-category-toggle {
	display: none;
	width: 100%;
	margin-top: 16px;
	padding: 12px 20px;
	border: 1px solid var(--nphhh-border);
	border-radius: 14px;
	background: var(--nphhh-white);
	color: var(--nphhh-primary);
	font-weight: 700;
	font-size: 14px;
}
.nph-app-home .nph-category-toggle:hover {
	background: var(--nphhh-light-gray);
}

@media (max-width: 1199px) {
	.nph-app-home .nph-all-category-grid {
		grid-template-columns: repeat(5, minmax(0, 1fr));
	}
}

@media (max-width: 767px) {
	.nph-app-home .nph-all-categories {
		padding: 0 14px;
	}

	.nph-app-home .nph-all-category-grid {
		grid-template-columns: repeat(4, minmax(0, 1fr));
		gap: 10px;
	}

	.nph-app-home .nph-all-category-card {
		padding: 11px 5px;
		border-radius: 14px;
	}

	.nph-app-home .nph-all-category-icon {
		width: 46px;
		height: 46px;
		border-radius: 14px;
	}

	.nph-app-home .nph-all-category-icon .nph-icon {
		width: 22px;
		height: 22px;
	}

	.nph-app-home .nph-all-category-name {
		font-size: 12px;
	}

	.nph-app-home .nph-all-category-count {
		font-size: 10px;
	}

	.nph-app-home .nph-category-toggle {
		display: block;
	}
}

@media (max-width: 360px) {
	.nph-app-home .nph-all-category-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

/* ===================== Banner slider ===================== */
.nph-app-home .nph-banner-section {
	padding: 26px 20px 4px;
}
.nph-app-home .nph-banner-slider {
	position: relative;
	border-radius: 22px;
	overflow: hidden;
	background: var(--nphhh-light-gray);
	aspect-ratio: 16 / 8;
}
.nph-app-home .nph-banner-track {
	position: relative;
	width: 100%;
	height: 100%;
}
.nph-app-home .nph-banner-slide {
	position: absolute;
	inset: 0;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.4s ease;
}
.nph-app-home .nph-banner-slide.is-active {
	opacity: 1;
	pointer-events: auto;
}
.nph-app-home .nph-banner-slide img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
.nph-app-home .nph-banner-overlay {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	padding: 16px 18px;
	background: linear-gradient(to top, rgba(17,24,39,0.6), rgba(17,24,39,0));
	display: flex;
	flex-direction: column;
	gap: 3px;
	color: var(--nphhh-white);
}
.nph-app-home .nph-banner-eyebrow {
	font-size: 12px;
	font-weight: 700;
	opacity: 0.9;
}
.nph-app-home .nph-banner-title {
	font-size: 18px;
	font-weight: 800;
}
.nph-app-home .nph-banner-dots {
	position: absolute;
	bottom: 10px;
	right: 14px;
	display: flex;
	gap: 6px;
	z-index: 2;
}
.nph-app-home .nph-banner-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	border: none;
	background: rgba(255,255,255,0.55);
	padding: 0;
}
.nph-app-home .nph-banner-dot.is-active {
	background: var(--nphhh-white);
}

/* ===================== Recommended stores (per Section 11 spec) ===================== */
.nph-app-home .nph-recommended-section {
	width: 100%;
	max-width: 1280px;
	margin: 40px auto;
	padding: 0 20px;
}

.nph-app-home .nph-store-row {
	margin-top: 24px;
}

.nph-app-home .nph-store-row-title {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 14px;
}
.nph-app-home .nph-store-row-title h3 {
	margin: 0;
	font-size: 16px;
	font-weight: 700;
	color: var(--nphhh-black);
}

.nph-app-home .nph-store-slider {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: minmax(220px, 1fr);
	gap: 16px;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	overscroll-behavior-inline: contain;
	padding: 4px 2px 16px;
}

.nph-app-home .nph-store-slider::-webkit-scrollbar {
	height: 6px;
}

.nph-app-home .nph-store-slider::-webkit-scrollbar-thumb {
	background: #D1D5DB;
	border-radius: 999px;
}

.nph-app-home .nph-store-card {
	min-width: 0;
	scroll-snap-align: start;
	background: var(--nphhh-white);
	border: 1px solid var(--nphhh-border);
	border-radius: 18px;
	overflow: hidden;
	color: var(--nphhh-black);
	box-shadow: 0 8px 24px rgba(17, 24, 39, 0.06);
	transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.nph-app-home .nph-store-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 14px 32px rgba(17, 24, 39, 0.12);
}

.nph-app-home .nph-store-image {
	position: relative;
	display: block;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	background: var(--nphhh-light-gray);
}

.nph-app-home .nph-store-image img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.nph-app-home .nph-store-favorite {
	position: absolute;
	top: 10px;
	right: 10px;
	width: 36px;
	height: 36px;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.94);
	color: var(--nphhh-black);
	display: flex;
	align-items: center;
	justify-content: center;
}
.nph-app-home .nph-store-favorite .nph-icon {
	width: 18px;
	height: 18px;
}
.nph-app-home .nph-store-favorite.is-active {
	color: #DC2626;
}
.nph-app-home .nph-store-favorite.is-active .nph-icon {
	fill: currentColor;
}

.nph-app-home .nph-store-content {
	padding: 14px;
}

.nph-app-home .nph-store-title {
	margin: 0 0 7px;
	color: var(--nphhh-black);
	font-size: 17px;
	line-height: 1.4;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.nph-app-home .nph-store-rating {
	display: flex;
	align-items: center;
	gap: 5px;
	color: var(--nphhh-primary);
	font-size: 14px;
	font-weight: 700;
	margin: 0;
}

.nph-app-home .nph-store-reviews {
	color: var(--nphhh-gray);
	font-weight: 400;
}

.nph-app-home .nph-store-location {
	margin: 6px 0 0;
	color: var(--nphhh-gray);
	font-size: 14px;
}

.nph-app-home .nph-store-status {
	display: inline-flex;
	margin-top: 9px;
	padding: 5px 9px;
	border-radius: 999px;
	background: #EAF7EF;
	color: var(--nphhh-primary-dark);
	font-size: 12px;
	font-weight: 700;
}
.nph-app-home .nph-store-status--closed {
	background: var(--nphhh-light-gray);
	color: var(--nphhh-gray);
}

.nph-app-home .nph-slider-controls {
	display: flex;
	gap: 8px;
}

.nph-app-home .nph-slider-controls button {
	width: 40px;
	height: 40px;
	border: 1px solid var(--nphhh-border);
	border-radius: 50%;
	background: var(--nphhh-white);
	color: var(--nphhh-black);
	font-size: 18px;
	line-height: 1;
}

.nph-app-home .nph-slider-controls button:hover {
	border-color: var(--nphhh-primary);
	color: var(--nphhh-primary);
}

@media (min-width: 1200px) {
	.nph-app-home .nph-store-slider {
		grid-auto-columns: calc((100% - 64px) / 5);
	}
}

@media (min-width: 768px) and (max-width: 1199px) {
	.nph-app-home .nph-store-slider {
		grid-auto-columns: calc((100% - 32px) / 3);
	}
}

/* ===================== Tablet / desktop refinements ===================== */
@media (min-width: 768px) {
	.nph-app-home .nph-search-box {
		flex-direction: row;
		align-items: center;
		padding: 10px;
		border-radius: 20px;
	}
	.nph-app-home .nph-search-input-wrap {
		flex: 1 1 auto;
	}
	.nph-app-home .nph-search-filters {
		flex-direction: row;
		flex: 0 0 auto;
	}
	.nph-app-home .nph-search-filters select {
		width: 160px;
	}
	.nph-app-home .nph-search-submit {
		width: auto;
		padding: 0 24px;
	}
}

@media (min-width: 1024px) {
	.nph-app-home .nph-hero,
	.nph-app-home .nph-app-bar,
	.nph-app-home .nph-quick-actions,
	.nph-app-home .nph-section-header,
	.nph-app-home .nph-popular-categories-scroll,
	.nph-app-home .nph-all-categories,
	.nph-app-home .nph-banner-section {
		padding-left: max(20px, calc((100% - 1280px) / 2 + 20px));
		padding-right: max(20px, calc((100% - 1280px) / 2 + 20px));
	}
}

/* ===================== Mobile ===================== */
@media (max-width: 767px) {
	.nph-app-home .nph-recommended-section {
		margin: 28px auto;
		padding: 0 14px;
	}

	.nph-app-home .nph-store-slider {
		grid-auto-columns: minmax(160px, 44vw);
		gap: 12px;
	}

	.nph-app-home .nph-slider-controls {
		display: none;
	}

	.nph-app-home .nph-store-content {
		padding: 11px;
	}

	.nph-app-home .nph-store-title {
		font-size: 14px;
	}

	.nph-app-home .nph-store-rating,
	.nph-app-home .nph-store-location {
		font-size: 12px;
	}

	.nph-app-home .nph-quick-actions {
		grid-template-columns: repeat(4, minmax(0, 1fr));
		gap: 8px;
		padding: 16px 14px 4px;
	}
	.nph-app-home .nph-quick-action {
		padding: 10px 4px;
		border-radius: 16px;
	}
	.nph-app-home .nph-quick-action-icon {
		width: 40px;
		height: 40px;
	}
	.nph-app-home .nph-quick-action-icon .nph-icon {
		width: 20px;
		height: 20px;
	}
	.nph-app-home .nph-quick-action-label {
		font-size: 11.5px;
	}
	.nph-app-home .nph-quick-action-count {
		display: none;
	}

	.nph-app-home .nph-app-bar {
		padding: 0 14px;
	}
	.nph-app-home .nph-hero {
		padding: 24px 14px 20px;
	}
	.nph-app-home .nph-section-header,
	.nph-app-home .nph-popular-categories-scroll,
	.nph-app-home .nph-banner-section {
		padding-left: 14px;
		padding-right: 14px;
	}
}

@media (max-width: 359px) {
	.nph-app-home .nph-quick-action-label {
		font-size: 10.5px;
	}
	.nph-app-home .nph-hero-title {
		font-size: 28px;
	}
}
