/* ==========================================================================
   Khati Ghi Theme — Main Stylesheet
   Ported from the original React/Tailwind design.
   ========================================================================== */

/* ---- Fonts -------------------------------------------------------------- */

/*
 * Taj Nagar (Bengali font) — replaces the original Tiro Bangla / Hind Siliguri pair.
 * Font files are NOT bundled in this package (see assets/fonts/README.txt for why
 * and how to add them in under a minute). Until the files are added, the site
 * falls back to Hind Siliguri from Google Fonts so it never looks broken.
 */
@font-face {
	font-family: 'Taj Nagar';
	src: url('../fonts/TajNagar.woff2') format('woff2'),
		 url('../fonts/TajNagar.woff') format('woff'),
		 url('../fonts/TajNagar.ttf') format('truetype');
	font-weight: normal;
	font-style: normal;
	font-display: swap;
}

:root {
	--font-serif: 'Taj Nagar', 'Tiro Bangla', 'Hind Siliguri', serif;
	--font-sans: 'Taj Nagar', 'Hind Siliguri', sans-serif;

	--color-brand-50: #fdf8f6;
	--color-brand-100: #f2e8e5;
	--color-brand-200: #e0d0c8;
	--color-brand-500: #8c5b3f;
	--color-brand-600: #7a4f35;
	--color-brand-800: #523523;
	--color-brand-900: #3f2a1b;
	--color-accent-400: #e3a936;
	--color-accent-500: #d49826;
}

/* ---- Reset / base -------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
	font-family: var(--font-sans);
	background: var(--color-brand-50);
	color: var(--color-brand-900);
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	line-height: 1.5;
}

h1, h2, h3, h4, h5, h6 { font-family: var(--font-serif); margin: 0; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea { font-family: inherit; }

.container {
	max-width: 80rem;
	margin: 0 auto;
	padding: 0 1rem;
}
@media (min-width: 640px) { .container { padding: 0 1.5rem; } }
@media (min-width: 1024px) { .container { padding: 0 2rem; } }

.site-main { flex-grow: 1; }

/* ---- Header / Nav --------------------------------------------------------- */

.site-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background: rgba(253, 248, 246, 0.9);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	border-bottom: 1px solid var(--color-brand-200);
}

.site-header__row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	height: 5rem;
}

.site-branding {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	min-width: 0;
}

.site-branding img,
.site-branding .custom-logo {
	height: 3rem;
	width: 3rem;
	border-radius: 9999px;
	object-fit: cover;
	box-shadow: 0 1px 2px rgba(0,0,0,0.05);
	border: 1px solid var(--color-brand-200);
}

.site-branding__title {
	font-family: var(--font-serif);
	font-size: 1.5rem;
	font-weight: 700;
	letter-spacing: 0.02em;
	color: var(--color-brand-800);
	white-space: nowrap;
}

.primary-nav {
	display: none;
	align-items: center;
	gap: 2rem;
}
@media (min-width: 768px) { .primary-nav { display: flex; } }

.primary-nav a {
	color: var(--color-brand-800);
	font-weight: 500;
	transition: color 0.2s ease;
}
.primary-nav a:hover { color: var(--color-brand-500); }

.header-actions {
	display: flex;
	align-items: center;
	gap: 1rem;
}

.cart-button--mobile { display: inline-flex; }
@media (min-width: 768px) { .cart-button--mobile { display: none; } }

.cart-button {
	position: relative;
	padding: 0.5rem;
	color: var(--color-brand-800);
	display: inline-flex;
	transition: color 0.2s ease;
}
.cart-button:hover { color: var(--color-brand-500); }
.cart-button svg { width: 1.5rem; height: 1.5rem; }

.cart-count {
	position: absolute;
	top: 0;
	right: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 1.25rem;
	height: 1.25rem;
	padding: 0 0.35rem;
	font-size: 0.7rem;
	font-weight: 700;
	line-height: 1;
	color: #fff;
	transform: translate(45%, -45%);
	background: var(--color-accent-500);
	border-radius: 9999px;
}

.menu-toggle {
	display: inline-flex;
	color: var(--color-brand-800);
	padding: 0.5rem;
}
.menu-toggle svg { width: 1.5rem; height: 1.5rem; }
@media (min-width: 768px) { .menu-toggle { display: none; } }

.mobile-nav {
	display: none;
	border-top: 1px solid var(--color-brand-200);
	background: var(--color-brand-50);
}
.mobile-nav.is-open { display: block; }
@media (min-width: 768px) { .mobile-nav { display: none !important; } }

.mobile-nav__list {
	padding: 0.5rem 1rem 1.5rem;
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
}
.mobile-nav__list a {
	display: block;
	padding: 0.5rem 0.75rem;
	border-radius: 0.375rem;
	font-weight: 500;
	color: var(--color-brand-800);
}
.mobile-nav__list a:hover { background: var(--color-brand-100); }

/* ---- Hero ------------------------------------------------------------- */

.hero {
	position: relative;
}

.hero__bg {
	position: absolute;
	inset: 0;
	z-index: 0;
	overflow: hidden;
}
.hero__bg img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
	opacity: 0.9;
}
.hero__overlay-dark {
	position: absolute;
	inset: 0;
	background: rgba(63, 42, 27, 0.4);
	mix-blend-mode: multiply;
}
.hero__overlay-fade {
	position: absolute;
	inset: 0;
	background: linear-gradient(to top, var(--color-brand-50), transparent 60%);
}

.hero__inner {
	position: relative;
	z-index: 10;
	padding: 8rem 0 10rem;
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
}
@media (min-width: 1024px) {
	.hero__inner {
		padding: 12rem 0 14rem;
		align-items: flex-start;
		text-align: left;
	}
}

.hero__content { max-width: 42rem; }

.hero__badge {
	display: inline-block;
	padding: 0.25rem 0.75rem;
	border-radius: 9999px;
	background: rgba(242, 232, 229, 0.8);
	backdrop-filter: blur(4px);
	color: var(--color-brand-800);
	font-size: 0.875rem;
	font-weight: 600;
	margin-bottom: 1.5rem;
	border: 1px solid var(--color-brand-200);
}

.hero__title {
	font-size: 2.25rem;
	font-weight: 700;
	color: #fff;
	margin-bottom: 1.5rem;
	text-shadow: 0 2px 4px rgba(0,0,0,0.25);
	line-height: 1.2;
}
.hero__title .accent { color: var(--color-accent-400); }
@media (min-width: 640px) { .hero__title { font-size: 3rem; } }
@media (min-width: 1024px) { .hero__title { font-size: 3.75rem; } }

.hero__subtitle {
	font-size: 1.125rem;
	color: var(--color-brand-50);
	margin-bottom: 2.5rem;
	max-width: 32rem;
	text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
@media (min-width: 640px) { .hero__subtitle { font-size: 1.25rem; } }

.hero__actions {
	display: flex;
	flex-direction: column;
	gap: 1rem;
	justify-content: center;
}
@media (min-width: 640px) { .hero__actions { flex-direction: row; } }
@media (min-width: 1024px) { .hero__actions { justify-content: flex-start; } }

/* ---- Buttons ------------------------------------------------------------ */

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	border-radius: 0.5rem;
	transition: background-color 0.2s ease, transform 0.15s ease;
}
.btn svg { width: 1.25rem; height: 1.25rem; }

.btn--accent {
	padding: 1rem 2rem;
	background: var(--color-accent-500);
	color: var(--color-brand-900);
	font-size: 1.125rem;
	box-shadow: 0 10px 25px -5px rgba(212, 152, 38, 0.3);
}
.btn--accent:hover { background: var(--color-accent-400); }

.btn--dark {
	padding: 0.875rem 2.5rem;
	background: var(--color-brand-800);
	color: #fff;
	font-size: 1.125rem;
	box-shadow: 0 4px 6px rgba(0,0,0,0.1);
	width: 100%;
}
.btn--dark:hover { background: var(--color-brand-900); }
@media (min-width: 640px) { .btn--dark { width: auto; } }

.btn--block {
	width: 100%;
	padding: 0.9rem 1rem;
}

/* ---- Features ------------------------------------------------------------ */

.features {
	position: relative;
	z-index: 20;
	margin-top: -2.5rem;
	background: var(--color-brand-50);
	border-radius: 2.5rem 2.5rem 0 0;
	padding: 5rem 0;
}

.section-heading {
	text-align: center;
	margin-bottom: 4rem;
}
.section-heading h2 {
	font-size: 1.875rem;
	font-weight: 700;
	color: var(--color-brand-800);
	margin-bottom: 1rem;
}
.section-heading__rule {
	width: 6rem;
	height: 0.25rem;
	background: var(--color-accent-500);
	margin: 0 auto;
	border-radius: 9999px;
}

.features__grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 2.5rem;
}
@media (min-width: 768px) { .features__grid { grid-template-columns: repeat(3, 1fr); } }

.feature-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	padding: 1.5rem;
	border-radius: 1rem;
	transition: background-color 0.3s ease;
}
.feature-card:hover { background: var(--color-brand-100); }

.feature-card__icon {
	width: 4rem;
	height: 4rem;
	border-radius: 9999px;
	background: var(--color-brand-200);
	color: var(--color-brand-600);
	display: flex;
	align-items: center;
	justify-content: center;
	margin-bottom: 1.5rem;
}
.feature-card__icon svg { width: 2rem; height: 2rem; }

.feature-card h3 {
	font-size: 1.25rem;
	font-weight: 700;
	color: var(--color-brand-800);
	margin-bottom: 0.75rem;
}
.feature-card p { color: var(--color-brand-600); }

/* ---- Product / Shop ------------------------------------------------------ */

.product-section {
	padding: 6rem 0;
	background: #fff;
	border-top: 1px solid var(--color-brand-100);
	border-bottom: 1px solid var(--color-brand-100);
}

.product__layout {
	display: flex;
	flex-direction: column;
	gap: 4rem;
	align-items: center;
}
@media (min-width: 1024px) { .product__layout { flex-direction: row; } }

.product__media,
.product__details {
	width: 100%;
}
@media (min-width: 1024px) {
	.product__media,
	.product__details { width: 50%; }
}

.product__image-wrap {
	position: relative;
	border-radius: 1rem;
	overflow: hidden;
	box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
}
.product__image-wrap img {
	width: 100%;
	height: auto;
	object-fit: cover;
	transition: transform 0.7s ease;
}
.product__image-wrap:hover img { transform: scale(1.05); }

.product__badge {
	position: absolute;
	top: 1.5rem;
	right: 1.5rem;
	z-index: 20;
	background: var(--color-accent-500);
	color: var(--color-brand-900);
	font-weight: 700;
	padding: 0.5rem 1rem;
	border-radius: 9999px;
	box-shadow: 0 4px 6px rgba(0,0,0,0.1);
	transform: rotate(3deg);
}

.product__details {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
}
.product__details h2 {
	font-size: 1.875rem;
	font-weight: 700;
	color: var(--color-brand-900);
	margin-bottom: 1rem;
}
@media (min-width: 640px) { .product__details h2 { font-size: 2.25rem; } }

.product__rating {
	display: flex;
	align-items: center;
	gap: 1rem;
	margin-bottom: 1.5rem;
}
.product__stars { display: flex; color: var(--color-accent-500); gap: 0.125rem; }
.product__stars svg { width: 1.25rem; height: 1.25rem; fill: currentColor; }
.product__review-count { color: var(--color-brand-600); font-weight: 500; }

.product__description {
	font-size: 1.125rem;
	color: var(--color-brand-600);
	margin-bottom: 2rem;
	line-height: 1.7;
}

.product__list {
	display: flex;
	flex-direction: column;
	gap: 1rem;
	margin-bottom: 2.5rem;
	width: 100%;
}
.product__list li {
	display: flex;
	align-items: center;
	color: var(--color-brand-800);
}
.product__list svg {
	width: 1.25rem;
	height: 1.25rem;
	color: var(--color-accent-500);
	margin-right: 0.75rem;
	flex-shrink: 0;
}

.product__price-box {
	display: flex;
	align-items: flex-end;
	gap: 1.5rem;
	margin-bottom: 2.5rem;
	width: 100%;
	padding: 1.5rem;
	background: var(--color-brand-50);
	border-radius: 0.75rem;
	border: 1px solid var(--color-brand-200);
}
.product__price-label {
	font-size: 0.875rem;
	color: var(--color-brand-600);
	margin-bottom: 0.25rem;
}
.product__price-value {
	font-size: 2.25rem;
	font-weight: 700;
	color: var(--color-brand-900);
}

.product__note {
	margin-top: 1rem;
	font-size: 0.875rem;
	color: var(--color-brand-500);
	display: flex;
	align-items: center;
}
.product__note svg {
	width: 1rem;
	height: 1rem;
	margin-right: 0.35rem;
	color: #16a34a;
}

/* ---- Footer --------------------------------------------------------- */

.site-footer {
	background: var(--color-brand-900);
	color: var(--color-brand-200);
	padding: 3rem 0;
	border-top: 1px solid var(--color-brand-800);
}

.footer__grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 2rem;
	margin-bottom: 2rem;
}
@media (min-width: 768px) { .footer__grid { grid-template-columns: repeat(3, 1fr); } }

.footer__brand { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1.5rem; }
.footer__brand img { height: 2.5rem; width: 2.5rem; border-radius: 9999px; object-fit: cover; }
.footer__brand span { font-family: var(--font-serif); font-size: 1.5rem; font-weight: 700; color: var(--color-brand-50); }
.footer__about { color: var(--color-brand-400); max-width: 24rem; }

.site-footer h4 {
	font-size: 1.125rem;
	font-weight: 700;
	color: var(--color-brand-50);
	margin-bottom: 1.5rem;
}

.footer__list { display: flex; flex-direction: column; gap: 0.75rem; }
.footer__list li { display: flex; align-items: center; gap: 0.75rem; }
.footer__list svg { width: 1.25rem; height: 1.25rem; color: var(--color-accent-500); flex-shrink: 0; }
.footer__list a:hover { color: var(--color-brand-50); }

.site-footer__bottom {
	padding-top: 2rem;
	border-top: 1px solid var(--color-brand-800);
	text-align: center;
	color: var(--color-brand-500);
	font-size: 0.875rem;
}

/* ---- Checkout Modal --------------------------------------------------- */

.checkout-overlay {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 999;
	align-items: center;
	justify-content: center;
	padding: 1rem;
	background: rgba(63, 42, 27, 0.6);
	backdrop-filter: blur(4px);
}
.checkout-overlay.is-open { display: flex; }

.checkout-modal {
	background: #fff;
	border-radius: 1rem;
	box-shadow: 0 25px 50px -12px rgba(0,0,0,0.4);
	width: 100%;
	max-width: 32rem;
	max-height: 90vh;
	overflow: hidden;
	display: flex;
	flex-direction: column;
}

.checkout-modal__header {
	padding: 1rem 1.5rem;
	border-bottom: 1px solid var(--color-brand-100);
	display: flex;
	justify-content: space-between;
	align-items: center;
	background: var(--color-brand-50);
}
.checkout-modal__header h2 {
	font-size: 1.25rem;
	font-weight: 700;
	color: var(--color-brand-800);
}
.checkout-modal__close {
	color: var(--color-brand-500);
	padding: 0.25rem;
	border-radius: 9999px;
}
.checkout-modal__close:hover { color: var(--color-brand-800); background: var(--color-brand-200); }
.checkout-modal__close svg { width: 1.25rem; height: 1.25rem; }

.checkout-modal__body {
	overflow-y: auto;
	padding: 1.5rem;
	flex-grow: 1;
}

.checkout-summary {
	display: flex;
	justify-content: space-between;
	align-items: center;
	background: var(--color-brand-50);
	padding: 1rem;
	border-radius: 0.5rem;
	border: 1px solid var(--color-brand-100);
	margin-bottom: 1.5rem;
}
.checkout-summary__info { display: flex; align-items: center; gap: 1rem; }
.checkout-summary__info img { width: 3rem; height: 3rem; object-fit: cover; border-radius: 0.375rem; }
.checkout-summary__name { font-weight: 700; color: var(--color-brand-800); }
.checkout-summary__qty { font-size: 0.875rem; color: var(--color-brand-600); }
.checkout-summary__price { font-weight: 700; color: var(--color-brand-900); }

.form-field { margin-bottom: 1.25rem; }
.form-field label {
	display: block;
	font-size: 0.875rem;
	font-weight: 500;
	color: var(--color-brand-800);
	margin-bottom: 0.25rem;
}
.form-field .required { color: #ef4444; }
.form-field input,
.form-field textarea {
	width: 100%;
	padding: 0.6rem 1rem;
	border-radius: 0.5rem;
	border: 1px solid var(--color-brand-200);
	outline: none;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
	font-size: 1rem;
}
.form-field input:focus,
.form-field textarea:focus {
	border-color: var(--color-accent-500);
	box-shadow: 0 0 0 3px rgba(212, 152, 38, 0.3);
}
.form-field textarea { resize: none; }

.checkout-total {
	padding-top: 1rem;
	border-top: 1px solid var(--color-brand-100);
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 1.5rem;
}
.checkout-total__label { color: var(--color-brand-600); }
.checkout-total__value { font-size: 1.25rem; font-weight: 700; color: var(--color-brand-900); }

.checkout-success { text-align: center; padding: 2.5rem 0; }
.checkout-success__icon {
	width: 5rem;
	height: 5rem;
	background: #dcfce7;
	color: #16a34a;
	border-radius: 9999px;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0 auto 1.5rem;
}
.checkout-success__icon svg { width: 2.5rem; height: 2.5rem; }
.checkout-success h3 {
	font-size: 1.5rem;
	font-weight: 700;
	color: var(--color-brand-900);
	margin-bottom: 0.5rem;
}
.checkout-success p { color: var(--color-brand-600); }

.form-error {
	color: #ef4444;
	font-size: 0.875rem;
	margin-top: -0.75rem;
	margin-bottom: 1rem;
	display: none;
}
.form-error.is-visible { display: block; }

/* Utility */
.screen-reader-text {
	position: absolute;
	width: 1px; height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}
