/* =========================================================
   Astra Storefront Child – storefront.css
   Component-based, variable-driven, RTL-native (logical properties).
   Order: tokens → base/shell → announcement → header → pills →
          hero → product sections/grid → footer → tablet → mobile
   ========================================================= */

/* ---------- Tokens ---------- */
:root {
	--sf-page-bg: #f2f2f2;
	--sf-surface: #fff;
	--sf-text: #151515;
	--sf-muted: #737373;
	--sf-border: #e6e6e6;
	--sf-accent: #f4b400;

	--sf-shell-max: 1440px;
	--sf-shell-radius: 28px;
	--sf-page-pad: clamp(16px, 2.6vw, 40px);
	--sf-section-gap: clamp(36px, 5vw, 76px);

	--sf-header-h: 74px;
	--sf-pills-h: 72px;

	--sf-radius-lg: 22px;
	--sf-radius-pill: 999px;
	--sf-shadow: 0 8px 30px rgba(0, 0, 0, .06);

	/* Hero desktop column ratios (copy / visual / floating) */
	--sf-hero-cols: 29% 43% 28%;
	--sf-hero-min-h: clamp(420px, 31vw, 560px);

	--sf-grid-cols: 4;
	--sf-grid-gap: clamp(12px, 1.5vw, 24px);

	--sf-font: "Vazirmatn", "IRANSans", Tahoma, "Noto Sans Arabic", Arial, sans-serif;
}

/* ---------- Base / shell ---------- */
body.sf-storefront {
	background: var(--sf-page-bg);
	color: var(--sf-text);
	font-family: var(--sf-font);
}

.sf-storefront #page {
	width: min(calc(100% - 40px), var(--sf-shell-max));
	margin: 40px auto;
	background: var(--sf-surface);
	border: 1px solid var(--sf-border);
	border-radius: var(--sf-shell-radius);
	box-shadow: var(--sf-shadow);
	overflow: clip;
}

/* Front page manages its own widths: neutralise Astra's container. */
.sf-storefront.home .site-content > .ast-container {
	display: block;
	max-width: none;
	padding: 0;
}
.sf-storefront.home .site-main { margin: 0; }

/* ---------- Announcement ---------- */
.sf-announcement {
	display: grid;
	place-items: center;
	min-height: 38px;
	padding: 8px 20px;
	border-block-end: 1px solid var(--sf-border);
	color: var(--sf-muted);
	font-size: 12px;
	text-align: center;
}

/* ---------- Header ---------- */
.sf-header {
	display: grid;
	grid-template-columns: 16% 1fr 31%;
	align-items: stretch;
	min-height: var(--sf-header-h);
	border-block-end: 1px solid var(--sf-border);
	background: var(--sf-surface);
}

.sf-brand {
	display: grid;
	place-items: center;
	padding: 0 20px;
	border-inline-end: 1px solid var(--sf-border);
	font-size: clamp(22px, 1.8vw, 32px);
	font-weight: 800;
	color: var(--sf-text);
	text-decoration: none;
}
.sf-brand .custom-logo { max-height: 44px; width: auto; }

.sf-header__search { display: flex; align-items: center; margin: 14px 24px; min-width: 0; }

.sf-search {
	display: flex;
	align-items: center;
	width: 100%;
	border: 1px solid #ededed;
	background: #f7f7f7;
	border-radius: var(--sf-radius-pill);
	overflow: hidden;
}
.sf-search input[type="search"] {
	flex: 1;
	min-width: 0;
	border: 0;
	outline: 0;
	background: transparent;
	padding: 10px 18px;
	box-shadow: none;
	font: inherit;
}
.sf-search button {
	display: grid;
	place-items: center;
	padding: 0 18px;
	border: 0;
	background: transparent;
	color: var(--sf-accent);
	cursor: pointer;
}

.sf-nav { display: flex; }
.sf-nav .sf-nav__list {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: 1fr;
	width: 100%;
	margin: 0;
	padding: 0;
	list-style: none;
}
.sf-nav .sf-nav__list > li { display: flex; margin: 0; }
.sf-nav .sf-nav__list a {
	flex: 1;
	display: grid;
	place-items: center;
	min-width: 90px;
	border-inline-start: 1px solid var(--sf-border);
	font-size: 14px;
	font-weight: 700;
	color: var(--sf-text);
	text-decoration: none;
}
.sf-nav .sf-nav__list .current-menu-item > a,
.sf-nav .sf-nav__list .current_page_item > a {
	box-shadow: inset 0 -4px 0 var(--sf-text);
}

.sf-menu-toggle { display: none; }
.sf-mobile-panel { padding: 12px var(--sf-page-pad) 16px; border-block-end: 1px solid var(--sf-border); }
.sf-mobile-panel__list { margin: 12px 0 0; padding: 0; list-style: none; }
.sf-mobile-panel__list a { display: block; padding: 12px 4px; border-block-end: 1px solid var(--sf-border); font-weight: 700; color: var(--sf-text); text-decoration: none; }

/* ---------- Category pills ---------- */
.sf-pills {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	min-height: var(--sf-pills-h);
	padding: 12px var(--sf-page-pad);
	overflow-x: auto;
	scrollbar-width: none;
	border-block-end: 1px solid var(--sf-border);
}
.sf-pills::-webkit-scrollbar { display: none; }
.sf-pill {
	flex: 0 0 auto;
	padding: 11px 24px;
	border: 1px solid var(--sf-border);
	border-radius: var(--sf-radius-pill);
	font-size: 14px;
	font-weight: 700;
	white-space: nowrap;
	color: var(--sf-text);
	text-decoration: none;
}
.sf-pill.is-selected { background: var(--sf-accent); border-color: var(--sf-accent); }

/* ---------- Hero ---------- */
.sf-hero {
	position: relative;
	padding: clamp(20px, 2.5vw, 40px) var(--sf-page-pad) 48px;
	overflow: hidden;
}

.sf-hero__slide {
	position: relative;
	display: none;
	min-height: var(--sf-hero-min-h);
	grid-template-columns: var(--sf-hero-cols);
	align-items: center;
	gap: 1.5%;
}
.sf-hero__slide.is-active { display: grid; animation: sf-fade .5s ease; }
@keyframes sf-fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .sf-hero__slide.is-active { animation: none; } }

.sf-hero__copy { max-width: 440px; z-index: 2; }
.sf-hero__eyebrow { display: inline-block; margin-block-end: 12px; color: var(--sf-muted); font-size: 13px; font-weight: 700; }
.sf-hero__title { margin: 0 0 18px; font-size: clamp(34px, 3.2vw, 56px); line-height: 1.15; letter-spacing: -.02em; }
.sf-hero__text { margin: 0 0 24px; max-width: 410px; color: var(--sf-muted); font-size: clamp(13px, 1vw, 16px); line-height: 1.8; }
.sf-hero__cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 46px;
	padding: 0 25px;
	border-radius: var(--sf-radius-pill);
	background: var(--sf-accent);
	color: var(--sf-text);
	font-weight: 800;
	text-decoration: none;
}

.sf-hero__visual {
	position: relative;
	display: grid;
	place-items: center;
	width: min(100%, 520px);
	aspect-ratio: 1;
	margin-inline: auto;
	min-width: 0;
}
.sf-hero__visual::before {
	content: "";
	position: absolute;
	inset: 12%;
	border-radius: 50%;
	background: var(--sf-accent);
}
.sf-hero__image {
	position: relative;
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.sf-hero__floating { position: relative; min-height: 360px; margin: 0; padding: 0; list-style: none; }
.sf-float {
	position: absolute;
	width: clamp(54px, 6vw, 94px);
	aspect-ratio: 1;
	margin: 0;
	border-radius: 50%;
	background: var(--sf-accent);
	overflow: hidden;
}
.sf-float a { display: block; width: 100%; height: 100%; }
.sf-float img { width: 100%; height: 100%; object-fit: cover; }
.sf-float--1 { top: 7%;  inset-inline-start: 16%; }
.sf-float--2 { top: 27%; inset-inline-start: 54%; }
.sf-float--3 { top: 51%; inset-inline-start: 8%; }
.sf-float--4 { bottom: 8%; inset-inline-start: 37%; }

.sf-hero__controls {
	position: absolute;
	inset-block-end: 16px;
	inset-inline-start: 50%;
	translate: -50% 0;
	display: flex;
	align-items: center;
	gap: 12px;
	z-index: 4;
}
[dir="rtl"] .sf-hero__controls { translate: 50% 0; }
.sf-hero__arrow {
	width: 30px;
	height: 30px;
	padding: 0;
	border: 1px solid var(--sf-border);
	border-radius: 50%;
	background: var(--sf-surface);
	color: var(--sf-text);
	line-height: 1;
	cursor: pointer;
}
[dir="ltr"] .sf-hero__arrow { transform: scaleX(-1); }
.sf-hero__dots { display: flex; gap: 6px; }
.sf-hero__dot { width: 7px; height: 7px; padding: 0; border: 0; border-radius: 50%; background: #d4d4d4; cursor: pointer; }
.sf-hero__dot.is-active { background: var(--sf-text); }

/* ---------- Product sections ---------- */
.sf-products { padding: 0 var(--sf-page-pad) var(--sf-section-gap); }
.sf-section { margin-block-start: var(--sf-section-gap); }
.sf-section__heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-block-end: 22px; }
.sf-section__kicker { display: block; margin-block-end: 5px; color: var(--sf-muted); font-size: 12px; font-weight: 800; }
.sf-section__title { margin: 0; font-size: clamp(24px, 2vw, 34px); }
.sf-section__more { font-size: 13px; font-weight: 800; white-space: nowrap; color: var(--sf-text); text-decoration: none; }

/* Real WooCommerce loop, re-laid as a grid (beats Astra float/width rules). */
.sf-storefront .sf-grid.products {
	display: grid;
	grid-template-columns: repeat(var(--sf-grid-cols), minmax(0, 1fr));
	gap: var(--sf-grid-gap);
	margin: 0;
	padding: 0;
	list-style: none;
}
.sf-storefront .sf-grid.products::before,
.sf-storefront .sf-grid.products::after { content: none; display: none; }

.sf-storefront .sf-grid.products li.product {
	float: none;
	width: auto;
	min-width: 0;
	margin: 0;
	padding: 0;
	border: 1px solid var(--sf-border);
	border-radius: var(--sf-radius-lg);
	background: var(--sf-surface);
	overflow: hidden;
}
.sf-storefront .sf-grid.products li.product img { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; margin: 0; }
.sf-storefront .sf-grid.products li.product .astra-shop-summary-wrap { padding: 14px; }
.sf-storefront .sf-grid.products li.product .woocommerce-loop-product__title { font-size: 16px; }
.sf-storefront .sf-grid.products li.product .price { font-size: 14px; font-weight: 800; }

/* ---------- Footer ---------- */
.sf-footer { border-block-start: 1px solid var(--sf-border); }
.sf-footer__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; padding: 42px var(--sf-page-pad); }
.sf-footer__title { margin: 0 0 12px; font-size: 15px; }
.sf-footer__brand { font-size: 20px; }
.sf-footer__bottom { padding: 16px var(--sf-page-pad); border-block-start: 1px solid var(--sf-border); color: var(--sf-muted); font-size: 12px; text-align: center; }

/* =========================================================
   TABLET (≤1024px): vertical, full-height hero; 2-col grids
   ========================================================= */
@media (max-width: 1024px) {
	:root { --sf-grid-cols: 2; }

	.sf-storefront #page { width: 100%; margin: 0; border-radius: 0; border-inline: 0; }
	.sf-header { grid-template-columns: 18% 1fr 42%; }

	.sf-hero { min-height: 100svh; display: flex; align-items: stretch; padding: 0; }

	.sf-hero__slide { width: 100%; }
	.sf-hero__slide.is-active {
		min-height: 100svh;
		grid-template-columns: 1fr;
		grid-template-rows: auto minmax(0, 1fr) auto;
		gap: 0;
		padding: 7vh 7vw 9vh;
		text-align: center;
	}
	.sf-hero__copy { width: min(720px, 100%); max-width: none; margin-inline: auto; }
	.sf-hero__title { font-size: clamp(38px, 6vw, 64px); }
	.sf-hero__text { margin-inline: auto; }
	.sf-hero__visual { width: min(58vw, 480px); min-height: 0; margin-block: 20px; }

	.sf-hero__floating { position: absolute; inset: 0; min-height: 0; pointer-events: none; }
	.sf-float { width: clamp(52px, 8vw, 78px); pointer-events: auto; }
	.sf-float--1 { top: 28%; inset-inline-start: 7%; }
	.sf-float--2 { top: 43%; inset-inline-start: 80%; }
	.sf-float--3 { top: 63%; inset-inline-start: 7%; }
	.sf-float--4 { top: auto; bottom: 17%; inset-inline-start: 78%; }
}

/* =========================================================
   MOBILE (≤767px)
   ========================================================= */
@media (max-width: 767px) {
	:root { --sf-page-pad: 16px; --sf-grid-gap: 10px; }

	.sf-announcement { min-height: 34px; font-size: 10px; }

	.sf-header { min-height: 64px; grid-template-columns: 1fr auto; }
	.sf-brand { justify-items: start; place-items: center start; padding-inline: 16px; border-inline-end: 0; }
	.sf-header__search, .sf-nav { display: none; }
	.sf-menu-toggle { display: grid; place-items: center; width: 58px; border: 0; background: transparent; color: var(--sf-text); cursor: pointer; }

	.sf-pills { justify-content: flex-start; min-height: 58px; padding-block: 8px; }
	.sf-pill { padding: 9px 17px; font-size: 12px; }

	.sf-hero__slide.is-active { padding: 7svh 20px 9svh; }
	.sf-hero__eyebrow { font-size: 11px; }
	.sf-hero__title { font-size: clamp(34px, 10vw, 48px); line-height: 1.2; }
	.sf-hero__text { max-width: 340px; font-size: 13px; line-height: 1.8; }
	.sf-hero__visual { width: min(70vw, 330px); }
	.sf-hero__controls { inset-block-end: 14px; }

	.sf-section { margin-block-start: 42px; }
	.sf-section__heading { margin-block-end: 14px; }
	.sf-section__title { font-size: 22px; }
	.sf-storefront .sf-grid.products li.product { border-radius: 15px; }
	.sf-storefront .sf-grid.products li.product .astra-shop-summary-wrap { padding: 10px; }
	.sf-storefront .sf-grid.products li.product .woocommerce-loop-product__title { font-size: 13px; }

	.sf-footer__grid { grid-template-columns: repeat(2, 1fr); padding: 32px 16px; }
}

/* Panel is mobile-only */
@media (min-width: 768px) { .sf-mobile-panel { display: none !important; } }
