/**
 * Sadaat Traders — shared base components.
 *
 * Loaded after the child stylesheet (tokens) and before page-specific
 * component files. Keep page-only rules out of this file.
 */

/* Scoped sizing reset: only the child-theme components below, never the
   Blocksy layout wrappers themselves. */
.st-container,
.st-container *,
.st-topbar,
.st-topbar *,
.st-header-search,
.st-header-search *,
.st-hero,
.st-hero *,
.st-section,
.st-section *,
.st-wholesale,
.st-wholesale *,
.st-footer,
.st-footer * {
	box-sizing: border-box;
}

/* --------------------------------------------------------------------------
   Layout and section rhythm
   -------------------------------------------------------------------------- */

.st-container {
	width: calc(100% - (2 * var(--st-gutter)));
	max-width: var(--st-container);
	margin-inline: auto;
}

.st-container--wide {
	max-width: var(--st-container-wide);
}

.st-container--narrow {
	max-width: var(--st-container-narrow);
}

.st-section {
	margin-block: var(--st-section-spacing) 0;
}

.st-section--tight {
	margin-top: var(--st-space-8);
}

.st-section__head {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: var(--st-space-4) var(--st-space-7);
	margin-bottom: clamp(1.25rem, 2.5vw, 2rem);
}

.st-section__intro {
	max-width: 680px;
}

.st-section__title {
	margin: 0 0 var(--st-space-2);
	color: var(--st-ink);
	font-family: var(--st-font-display);
	font-size: var(--st-fs-2xl);
	font-weight: var(--st-fw-semibold);
	line-height: var(--st-lh-heading);
	letter-spacing: -0.015em;
}

.st-section__lead {
	margin: 0;
	color: var(--st-muted);
	font-family: var(--st-font-body);
	font-size: var(--st-fs-base);
	line-height: var(--st-lh-body);
}

.st-section__link {
	flex: 0 0 auto;
	margin: 0;
	font-family: var(--st-font-body);
	font-size: var(--st-fs-sm);
	font-weight: var(--st-fw-semibold);
}

.st-section__link a {
	display: inline-flex;
	align-items: center;
	gap: var(--st-space-2);
	color: var(--st-green-700);
	text-decoration: none;
}

.st-section__link a:hover,
.st-section__link a:focus-visible {
	color: var(--st-green-600);
	text-decoration: underline;
	text-underline-offset: 0.2em;
}

.st-section > :last-child {
	margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   Typography helpers
   -------------------------------------------------------------------------- */

.is-style-st-eyebrow,
.st-eyebrow {
	margin: 0 0 var(--st-space-3);
	color: var(--st-green-700);
	font-family: var(--st-font-body);
	font-size: var(--st-fs-xs);
	font-weight: var(--st-fw-bold);
	letter-spacing: var(--st-letter-eyebrow);
	line-height: 1.4;
	text-transform: uppercase;
}

.is-style-st-display {
	font-family: var(--st-font-display);
	font-weight: var(--st-fw-semibold);
	line-height: var(--st-lh-tight);
	letter-spacing: -0.02em;
}

.st-accent {
	color: var(--st-green-600);
}

.st-lead {
	color: var(--st-muted);
	font-size: var(--st-fs-md);
	line-height: var(--st-lh-body);
}

.st-text-small {
	font-size: var(--st-fs-sm);
	line-height: 1.6;
}

/* Responsive section heading. */
@media (max-width: 781px) {
	.st-section__head {
		align-items: flex-start;
		flex-direction: column;
		gap: var(--st-space-3);
	}

	.st-section__link {
		width: 100%;
	}
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.wp-block-button.is-style-st-primary .wp-block-button__link,
.wp-block-button.is-style-st-outline .wp-block-button__link,
.wp-block-button.is-style-st-light .wp-block-button__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--st-space-2);
	height: auto;
	min-height: 46px;
	padding: 0.8rem 1.25rem;
	border: 1px solid transparent;
	border-radius: var(--st-radius-sm);
	font-family: var(--st-font-body);
	font-size: var(--st-fs-sm);
	font-weight: var(--st-fw-semibold);
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	transition:
		background-color var(--st-transition),
		border-color var(--st-transition),
		color var(--st-transition),
		box-shadow var(--st-transition),
		transform var(--st-transition);
}

.wp-block-button.is-style-st-primary .wp-block-button__link {
	background-color: var(--st-green-700);
	border-color: var(--st-green-700);
	color: var(--st-white);
}

.wp-block-button.is-style-st-primary .wp-block-button__link:hover {
	background-color: var(--st-green-600);
	border-color: var(--st-green-600);
	color: var(--st-white);
	transform: translateY(-1px);
}

.wp-block-button.is-style-st-outline .wp-block-button__link {
	background-color: var(--st-white);
	border-color: var(--st-border-strong);
	color: var(--st-ink);
}

.wp-block-button.is-style-st-outline .wp-block-button__link:hover {
	background-color: var(--st-sage-100);
	border-color: var(--st-green-600);
	color: var(--st-green-800);
	transform: translateY(-1px);
}

.wp-block-button.is-style-st-light .wp-block-button__link {
	background-color: var(--st-white);
	border-color: var(--st-white);
	color: var(--st-green-800);
}

.wp-block-button.is-style-st-light .wp-block-button__link:hover {
	background-color: var(--st-cream-100);
	border-color: var(--st-cream-100);
	color: var(--st-green-950);
	transform: translateY(-1px);
}

.wp-block-button.is-style-st-primary .wp-block-button__link:focus-visible,
.wp-block-button.is-style-st-outline .wp-block-button__link:focus-visible,
.wp-block-button.is-style-st-light .wp-block-button__link:focus-visible {
	box-shadow: var(--st-focus-ring);
	outline: 2px solid var(--st-focus-color);
	outline-offset: 3px;
}

.wp-block-button.st-arrow .wp-block-button__link::after {
	content: "\2192";
	font-size: 1.1em;
	line-height: 1;
	transition: transform var(--st-transition);
}

.wp-block-button.st-arrow .wp-block-button__link:hover::after {
	transform: translateX(3px);
}

/* Lightweight utility for HTML-based components. */
.st-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--st-space-2);
	min-height: 44px;
	padding: 0.7rem 1.15rem;
	border: 1px solid transparent;
	border-radius: var(--st-radius-sm);
	font-family: var(--st-font-body);
	font-size: var(--st-fs-sm);
	font-weight: var(--st-fw-semibold);
	line-height: 1.2;
	text-decoration: none;
	transition:
		background-color var(--st-transition),
		border-color var(--st-transition),
		color var(--st-transition),
		transform var(--st-transition);
}

.st-btn--primary {
	background-color: var(--st-green-700);
	border-color: var(--st-green-700);
	color: var(--st-white);
}

.st-btn--primary:hover {
	background-color: var(--st-green-600);
	border-color: var(--st-green-600);
	color: var(--st-white);
	transform: translateY(-1px);
}

.st-btn--outline {
	background-color: var(--st-white);
	border-color: var(--st-border-strong);
	color: var(--st-ink);
}

.st-btn--outline:hover {
	background-color: var(--st-sage-100);
	border-color: var(--st-green-600);
	color: var(--st-green-800);
}

/* --------------------------------------------------------------------------
   Cards and media
   -------------------------------------------------------------------------- */

.wp-block-group.is-style-st-card {
	padding: clamp(1.25rem, 2.5vw, 2rem);
	border: 1px solid var(--st-border);
	border-radius: var(--st-radius-md);
	background-color: var(--st-white);
	box-shadow: var(--st-shadow-sm);
}

.wp-block-image.is-style-st-frame img {
	border: 1px solid var(--st-border);
	border-radius: var(--st-radius-md);
	background-color: var(--st-white);
}

.st-card {
	border: 1px solid var(--st-border);
	border-radius: var(--st-radius-md);
	background-color: var(--st-white);
	box-shadow: var(--st-shadow-sm);
}

.st-media,
.st-media img {
	display: block;
	width: 100%;
}

.st-media img {
	height: auto;
	border-radius: var(--st-radius-md);
	object-fit: cover;
}


/* --------------------------------------------------------------------------
   Forms and search
   -------------------------------------------------------------------------- */

.st-form input[type="text"],
.st-form input[type="email"],
.st-form input[type="tel"],
.st-form input[type="search"],
.st-form input[type="number"],
.st-form input[type="password"],
.st-form select,
.st-form textarea,
.wp-block-search__input {
	width: 100%;
	min-height: 46px;
	padding: 0.7rem 0.9rem;
	border: 1px solid var(--st-border-strong);
	border-radius: var(--st-radius-sm);
	background-color: var(--st-white);
	color: var(--st-ink);
	font-family: var(--st-font-body);
	font-size: var(--st-fs-base);
	line-height: 1.45;
}

.st-form textarea {
	min-height: 130px;
	resize: vertical;
}

.st-form input::placeholder,
.st-form textarea::placeholder,
.wp-block-search__input::placeholder {
	color: #69736e;
	opacity: 1;
}

.st-form input[type="text"]:focus,
.st-form input[type="email"]:focus,
.st-form input[type="tel"]:focus,
.st-form input[type="search"]:focus,
.st-form input[type="number"]:focus,
.st-form input[type="password"]:focus,
.st-form select:focus,
.st-form textarea:focus,
.wp-block-search__input:focus {
	border-color: var(--st-green-600);
	box-shadow: var(--st-focus-ring);
	outline: none;
}

.st-form input[type="checkbox"],
.st-form input[type="radio"] {
	accent-color: var(--st-green-700);
}

.wp-block-search__inside-wrapper {
	overflow: hidden;
	border: 1px solid var(--st-border-strong);
	border-radius: var(--st-radius-sm);
	background-color: var(--st-white);
}

.wp-block-search__button {
	min-height: 46px;
	padding-inline: var(--st-space-4);
	border: 0;
	background-color: var(--st-green-700);
	color: var(--st-white);
	font-family: var(--st-font-body);
	font-weight: var(--st-fw-semibold);
}

.wp-block-search__button:hover {
	background-color: var(--st-green-600);
}

/* --------------------------------------------------------------------------
   Accessible focus and motion
   -------------------------------------------------------------------------- */

body :focus-visible {
	outline: 2px solid var(--st-focus-color);
	outline-offset: 3px;
}

#header [data-row="top"] :focus-visible,
#footer :focus-visible,
.st-wholesale :focus-visible {
	outline-color: var(--st-focus-light);
}

::selection {
	background-color: var(--st-green-600);
	color: var(--st-white);
}

@media (prefers-reduced-motion: no-preference) {
	html {
		scroll-behavior: smooth;
	}
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		scroll-behavior: auto !important;
		transition-duration: 0.01ms !important;
	}
}

