/*
Theme Name: NIOS
Theme URI: https://nios.co.il
Author: GalyamStudio
Description: Custom NIOS theme (personalized engraved gifts). Built from approved Figma designs (Mobile + Desktop), not a template.
Version: 0.1.0
Requires at least: 6.4
Requires PHP: 8.0
Text Domain: nios
*/

/* ==========================================================================
   Design tokens
   ========================================================================== */
:root {
	--color-bg-tan: #E8D8C2;
	--color-bg-cream: #F5EEE4;
	--color-bg-cream-light: #FBF8F2;
	--color-surface: #FFFFFF;
	--color-surface-muted: #F3F0EC;

	--color-ink: #151515;
	--color-ink-soft: #5E5A54;
	--color-muted: #6A6762;
	--color-price: #181818;
	--color-border: rgba(21, 21, 21, 0.08);
	--color-logo: #111111;
	--color-card-border: #E3DED8;
	--color-benefits-border: #F3F0EC;

	--hero-gradient: linear-gradient(135deg, #FBF8F2 0%, #F5EEE4 58%, #E8D8C2 100%);

	--font-heading: "Heebo", "Segoe UI", sans-serif;
	--font-body: "Assistant", "Segoe UI", sans-serif;

	--radius-lg: 22px;
	--radius-md: 16px;
	--radius-sm: 10px;
	--radius-pill: 999px;

	--container-max: 1720px;
	--container-pad: 20px;

	--breakpoint-desktop: 1024px;
}

/* ==========================================================================
   Reset & base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	font-family: var(--font-body);
	color: var(--color-ink);
	background: linear-gradient(180deg, var(--color-bg-cream-light) 0%, var(--color-bg-cream) 45%, var(--color-bg-tan) 100%);
	background-attachment: fixed;
	direction: rtl;
	line-height: 1.5;
}
img { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { font-family: var(--font-heading); margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

.nios-container {
	max-width: var(--container-max);
	margin-inline: auto;
	padding-inline: var(--container-pad);
}

@media (min-width: 1024px) {
	:root { --container-pad: 96px; }
}

.visually-hidden {
	position: absolute !important;
	width: 1px; height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

/* ==========================================================================
   Site header
   ========================================================================== */
.site-header {
	position: sticky;
	top: 0;
	z-index: 50;
	padding: 16px var(--container-pad) 0;
}

.site-header__bar {
	max-width: var(--container-max);
	margin-inline: auto;
	background: var(--color-surface);
	border-radius: var(--radius-lg);
	box-shadow: 0 4px 16px rgba(21, 21, 21, 0.06);
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 12px 20px;
	gap: 16px;
	/* Figma places menu-toggle/cart at fixed physical left/right regardless of
	   reading direction — force LTR flex ordering for this row only. */
	direction: ltr;
}
.site-header__bar > * { direction: rtl; }

.site-header__menu-toggle {
	background: none;
	border: none;
	padding: 8px;
	display: flex;
}
.site-header__menu-toggle img { width: 20px; height: 16px; }

.site-header__logo {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2px;
	text-align: center;
}
.site-header__logo-mark { display: flex; align-items: center; gap: 6px; }
.site-header__logo-mark img { width: 20px; height: 20px; }
.site-header__logo-name {
	font-family: var(--font-heading);
	font-weight: 700;
	font-size: 22px;
	color: var(--color-logo);
	letter-spacing: 0.5px;
}
.site-header__logo-tagline {
	font-size: 10px;
	color: #333333;
}

.site-header__cart {
	position: relative;
	display: flex;
	align-items: center;
	padding: 8px;
}
.site-header__cart img { width: 28px; height: 28px; }
.site-header__cart-count {
	position: absolute;
	top: 2px;
	inset-inline-end: 2px;
	background: var(--color-ink);
	color: #fff;
	font-size: 10px;
	line-height: 1;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
}

.site-header__nav {
	display: none;
}

.site-header__mobile-nav {
	max-width: var(--container-max);
	margin: 8px auto 0;
	background: var(--color-surface);
	border-radius: var(--radius-md);
	box-shadow: 0 4px 16px rgba(21, 21, 21, 0.06);
	padding: 8px;
}
.site-header__mobile-nav ul { display: flex; flex-direction: column; }
.site-header__mobile-nav a {
	display: block;
	padding: 12px 16px;
	font-family: var(--font-heading);
	font-weight: 600;
	font-size: 15px;
	border-radius: var(--radius-sm);
}
.site-header__mobile-nav a:hover { background: var(--color-surface-muted); }

@media (min-width: 1024px) {
	.site-header__mobile-nav { display: none !important; }

	/* Figma's desktop header is a flush, square-cornered, full-bleed white
	   bar (0,0,1920,96) — unlike the mobile floating rounded card. */
	.site-header { padding: 0; }
	.site-header__bar {
		max-width: none;
		border-radius: 0;
		box-shadow: none;
		padding: 14px 96px;
	}
	.site-header__menu-toggle { display: none; }
	/* Undo the mobile-only LTR physical-ordering trick — Figma's desktop
	   header wants natural RTL order (logo at the far right, cart at the
	   far left), the opposite of the mobile hamburger/cart placement. */
	.site-header__bar { direction: rtl; }
	.site-header__logo { align-items: flex-end; text-align: right; }
	.site-header__logo-name { font-size: 44px; color: var(--color-logo); }
	.site-header__logo-tagline { font-size: 11px; color: var(--color-logo); }
	.site-header__nav {
		display: flex;
		align-items: center;
		font-family: var(--font-heading);
		font-weight: 700;
		font-size: 17px;
		color: var(--color-ink);
	}
	.site-header__nav ul {
		display: flex;
		align-items: center;
		gap: 28px;
		list-style: none;
		margin: 0;
		padding: 0;
	}
	.site-header__nav a:hover { color: var(--color-ink-soft); }
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
	/* Figma's hero background is a flush, square-cornered gradient rectangle
	   spanning the full section — no card/radius treatment. */
	background: var(--hero-gradient);
}
.hero__inner {
	/* Figma's hero is genuinely edge-to-edge — no container/gutter, unlike
	   Header/Benefits/Products which sit inside the page container. */
	display: flex;
	flex-direction: column;
}
.hero__media {
	aspect-ratio: 408 / 342;
	overflow: hidden;
	position: relative;
}
.hero__media img { width: 100%; height: 100%; object-fit: cover; }

.hero__copy {
	padding: 24px 20px 8px;
	text-align: center;
}
.hero__title {
	font-size: 22px;
	font-weight: 700;
	line-height: 1.3;
	color: #171717;
	margin: 0 0 12px;
}
.hero__subtitle {
	font-family: var(--font-heading);
	font-weight: 700;
	font-size: 10.5px;
	color: #232323;
	margin: 0 0 6px;
}
.hero__tagline {
	font-size: 9.2px;
	color: #5C5A57;
	margin: 0 0 4px;
}

.hero__actions {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
	padding: 16px 20px 24px;
}
.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	border-radius: var(--radius-pill);
	font-family: var(--font-heading);
	font-weight: 700;
	font-size: 14px;
	padding: 12px 24px;
	border: 1px solid transparent;
	white-space: nowrap;
}
.btn img { width: 14px; height: 14px; }
.btn--primary { background: var(--color-ink); color: #fff; }
.btn--secondary { background: transparent; color: var(--color-ink); border-color: var(--color-border); }
.hero__actions .btn { width: 100%; max-width: 280px; }

@media (min-width: 1024px) {
	/* Figma's desktop hero puts the photo on the RIGHT and the copy on the
	   LEFT — the mirror image of the mobile layout. First DOM child
	   (hero__media) must land at the inline-end (right) side, so this needs
	   plain "row" here, not "row-reverse" (which would put it at the left). */
	.hero__inner { flex-direction: row; align-items: stretch; min-height: 500px; }
	.hero__media { flex: 0 0 48.9%; aspect-ratio: auto; }
	.hero__media::before {
		/* Figma overlays a translucent left-to-right cream gradient across the
		   ~480px seam between copy and photo, softening the hard cut. */
		content: "";
		position: absolute;
		top: 0;
		bottom: 0;
		left: -250px;
		width: 480px;
		background: linear-gradient(to right, #FBF7EF, #F8F3EA 62%, #EEE5D7);
		opacity: 0.55;
		pointer-events: none;
		z-index: 1;
	}
	.hero__copy {
		flex: 1;
		text-align: right;
		padding: 64px 72px 0;
		display: flex;
		flex-direction: column;
		justify-content: center;
	}
	.hero__title { font-size: 58px; line-height: 1.15; margin-bottom: 20px; color: #151515; }
	.hero__subtitle { font-size: 22px; margin-bottom: 12px; color: #151515; }
	.hero__tagline { font-size: 18px; margin-bottom: 0; color: #6D685F; }
	.hero__actions { flex-direction: row; justify-content: flex-start; padding: 40px 72px 64px; }
	.hero__actions .btn { width: auto; max-width: none; padding: 18px 32px; font-size: 17px; }
}

/* ==========================================================================
   Benefits
   ========================================================================== */
.benefits {
	padding: 32px var(--container-pad) 0;
}
.benefits__inner {
	max-width: var(--container-max);
	margin-inline: auto;
	background: var(--color-surface);
	border: 0.5px solid var(--color-benefits-border);
	border-radius: 18px;
	box-shadow: 0 8px 20px rgba(21, 21, 21, 0.045);
	display: flex;
	justify-content: space-between;
	padding: 24px 8px;
}
.benefit {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	gap: 6px;
	padding-inline: 8px;
	position: relative;
}
.benefit + .benefit::before {
	content: "";
	position: absolute;
	inset-inline-start: 0;
	top: 8px;
	bottom: 8px;
	width: 1px;
	background: var(--color-border);
}
.benefit__icon { width: 30px; height: 30px; margin-bottom: 4px; }
.benefit__icon img { width: 100%; height: 100%; object-fit: contain; }
.benefit__title { font-family: var(--font-heading); font-weight: 700; font-size: 9.8px; color: #181818; }
.benefit__subtitle { font-size: 7.8px; color: var(--color-ink-soft); }

@media (min-width: 1024px) {
	.benefits { padding-top: 56px; }
	.benefits__inner { padding: 40px 60px; border: none; border-radius: 22px; box-shadow: none; }
	.benefit { flex-direction: row-reverse; text-align: right; gap: 16px; }
	.benefit + .benefit::before { inset-inline-start: -20px; top: 4px; bottom: 4px; }
	.benefit__icon { width: 44px; height: 44px; margin-bottom: 0; }
	.benefit__title { font-size: 18px; }
	.benefit__subtitle { font-size: 14px; }
}

/* ==========================================================================
   Products
   ========================================================================== */
.products {
	padding: 48px var(--container-pad);
}
.products__heading {
	text-align: center;
	margin-bottom: 24px;
}
.products__title { font-size: 22px; font-weight: 700; color: var(--color-ink); margin-bottom: 6px; }
.products__subtitle { font-size: 9.8px; color: var(--color-muted); }

.products__scroller {
	display: flex;
	gap: 16px;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	padding-bottom: 4px;
	margin: 0 calc(var(--container-pad) * -1);
	padding-inline: var(--container-pad);
	-webkit-overflow-scrolling: touch;
}
.products__scroller::-webkit-scrollbar { display: none; }

.product-card {
	scroll-snap-align: start;
	flex: 0 0 auto;
	width: 158px;
	background: var(--color-surface);
	border: 1px solid var(--color-card-border);
	border-radius: 18px;
	overflow: hidden;
}
.product-card__media { aspect-ratio: 158 / 90; overflow: hidden; }
.product-card__media img { width: 100%; height: 100%; object-fit: cover; }
.product-card__body { padding: 14px 16px 16px; text-align: center; }
.product-card__title { font-family: var(--font-heading); font-weight: 700; font-size: 12.5px; margin-bottom: 4px; }
.product-card__desc { font-size: 8.8px; color: var(--color-muted); margin-bottom: 12px; }
.product-card__footer { display: flex; align-items: center; justify-content: space-between; }
.product-card__price-label { font-size: 9px; color: #555; }
.product-card__price { font-family: var(--font-heading); font-weight: 700; font-size: 14px; color: var(--color-price); }
.product-card__cart-btn { position: relative; width: 26px; height: 26px; }
.product-card__cart-btn img:first-child { width: 100%; height: 100%; }
.product-card__cart-btn img:last-child { position: absolute; inset: 0; margin: auto; width: 5px; height: 10px; }

.products__cta { text-align: center; margin-top: 24px; }
.products__empty { text-align: center; color: var(--color-ink-soft); padding: 32px 0; }

@media (min-width: 1024px) {
	.products { padding: 88px 96px; }
	.products__title { font-size: 34px; }
	.products__subtitle { font-size: 14px; }
	.products__scroller {
		overflow: visible;
		margin: 0;
		padding-inline: 0;
		display: grid;
		grid-template-columns: repeat(4, 1fr);
		gap: 24px;
	}
	.product-card { width: auto; }
	.product-card__media { aspect-ratio: 348 / 152; }
	.product-card__body { padding: 20px 24px 24px; text-align: right; }
	.product-card__title { font-size: 17px; }
	.product-card__desc { font-size: 13px; }
	.product-card__price { font-size: 21px; }
	.product-card__price-label { font-size: 15px; }
	.product-card__cart-btn { width: 40px; height: 40px; }
	.product-card__cart-btn img:last-child { width: 6px; height: 12px; }
	.products__cta .btn--cta { font-size: 16px; }
}

/* ==========================================================================
   CTA button (shared)
   ========================================================================== */
.btn--cta {
	background: var(--color-surface);
	border: 1px solid var(--color-border);
	color: var(--color-ink);
}

/* ==========================================================================
   Site footer (minimal placeholder — full footer design pending)
   ========================================================================== */
.site-footer {
	padding: 40px var(--container-pad);
	text-align: center;
	color: var(--color-ink-soft);
	font-size: 12px;
}
