/*
Theme Name: Matjar
Theme URI: https://example.com/matjar
Description: قالب متجر ملابس عربي لـ WooCommerce — تصميم ثابت، والمنتجات تُدار من لوحة WooCommerce.
Version: 1.0.0
Requires at least: 6.4
Requires PHP: 7.4
Author: Abdulmuhaymin Okok
Text Domain: matjar
License: Proprietary
*/

/* ---------- Tokens ---------- */
:root {
	--st-ground: #F4F2EE;
	--st-surface: #FFFFFF;
	--st-soft: #ECE8E0;
	--st-line: #DDD8CF;
	--st-line-strong: #CFC9BE;
	--st-ink: #161513;
	--st-ink-2: #4A463F;
	--st-muted: #5E5A53;
	--st-faint: #A39D93;
	--st-disabled: #77736B;
	--st-alert: #9A3B1E;
	--st-accent: #3F4A2E;
	--st-font-body: 'IBM Plex Sans Arabic', 'Segoe UI', Tahoma, sans-serif;
	--st-font-display: 'Readex Pro', 'IBM Plex Sans Arabic', sans-serif;
	--st-radius: 12px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	background: var(--st-ground);
	color: var(--st-ink);
	font-family: var(--st-font-body);
	font-size: 15px;
	line-height: 1.6;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--st-ink); }
a:hover { color: var(--st-accent); }
button, input, select, textarea { font-family: inherit; font-size: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--st-accent); outline-offset: 2px; }
.screen-reader-text {
	position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.st-container { max-width: 1280px; margin: 0 auto; padding: 20px 24px 64px; }

/* ---------- Announcement + header ---------- */
.st-announce {
	background: var(--st-ink); color: var(--st-ground);
	text-align: center; font-size: 13px; padding: 9px 16px;
}
.st-header {
	background: var(--st-ground);
	border-bottom: 1px solid var(--st-line);
	position: sticky; top: 0; z-index: 50;
}
.admin-bar .st-header { top: 32px; }
.st-header__inner {
	max-width: 1280px; margin: 0 auto; padding: 18px 24px;
	display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
}
.st-header__start, .st-header__end { display: flex; align-items: center; gap: 6px; }
.st-logo {
	font-family: var(--st-font-display); font-weight: 700; font-size: 26px;
	letter-spacing: -0.5px; text-decoration: none; color: var(--st-ink);
}
.st-logo img { max-height: 48px; width: auto; }
.st-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 28px; }
.st-nav a { text-decoration: none; font-size: 15px; font-weight: 500; }
.st-icon-btn {
	position: relative; width: 44px; height: 44px; border: none; background: transparent;
	display: inline-flex; align-items: center; justify-content: center; color: var(--st-ink);
	text-decoration: none; padding: 0;
}
.st-icon-btn svg { width: 22px; height: 22px; }
.st-cart-count {
	position: absolute; top: 4px; left: 4px; min-width: 18px; height: 18px; border-radius: 9px;
	background: var(--st-accent); color: #fff; font-size: 11px; font-weight: 600;
	display: flex; align-items: center; justify-content: center; padding: 0 4px; line-height: 1;
}
.st-menu-toggle, .st-header__start { display: none; }

.st-drawer[hidden] { display: none; }
.st-drawer {
	position: fixed; inset: 0; z-index: 100; background: rgba(22, 21, 19, 0.45);
}
.st-drawer__panel {
	position: absolute; top: 0; right: 0; bottom: 0; width: min(320px, 85vw);
	background: var(--st-ground); padding: 16px 20px; display: flex; flex-direction: column; gap: 8px;
}
.st-drawer__panel ul { list-style: none; margin: 0; padding: 0; }
.st-drawer__panel li a {
	display: block; padding: 14px 0; border-bottom: 1px solid var(--st-line);
	text-decoration: none; font-size: 16px; font-weight: 500;
}
.st-drawer__close { align-self: flex-start; }

/* ---------- Notices ---------- */
.st-notices .woocommerce-message,
.st-notices .woocommerce-error,
.st-notices .woocommerce-info {
	list-style: none; margin: 0 0 20px; padding: 14px 18px; border-radius: var(--st-radius);
	background: var(--st-soft); border: 1px solid var(--st-line); font-size: 14px;
	display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between;
}
.st-notices .woocommerce-error { background: #F6E4DE; border-color: #E6C2B5; }
.st-notices .button {
	background: var(--st-ink); color: #fff; text-decoration: none; padding: 8px 16px; border-radius: 10px; font-weight: 600;
}

/* ---------- Breadcrumb ---------- */
.st-breadcrumb {
	font-size: 13px; color: var(--st-muted); display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px;
}
.st-breadcrumb a { color: var(--st-muted); text-decoration: none; }
.st-breadcrumb--mobile { display: none; }

/* ---------- Product layout ---------- */
.st-product { display: flex; flex-wrap: wrap; gap: 48px; align-items: flex-start; }

.st-gallery { flex: 1 1 520px; min-width: 0; display: flex; gap: 14px; }
.st-thumbs { display: flex; flex-direction: column; gap: 10px; flex: 0 0 76px; }
.st-thumb {
	width: 76px; height: 96px; border-radius: 10px; border: 2px solid transparent;
	background: var(--st-soft); padding: 0; overflow: hidden;
}
.st-thumb img { width: 100%; height: 100%; object-fit: cover; }
.st-thumb.is-active { border-color: var(--st-ink); }
.st-main {
	flex: 1 1 auto; min-width: 0; aspect-ratio: 4 / 5; border-radius: 16px;
	background: var(--st-soft); position: relative; overflow: hidden;
}
.st-main img { width: 100%; height: 100%; object-fit: cover; }
.st-main__placeholder {
	width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
	color: var(--st-muted); font-family: var(--st-font-display);
}
.st-badge {
	position: absolute; top: 16px; right: 16px; background: var(--st-ink); color: var(--st-ground);
	font-size: 12px; font-weight: 600; padding: 6px 12px; border-radius: 999px;
}
.st-badge--sale { background: var(--st-alert); }
.st-counter {
	display: none; position: absolute; bottom: 14px; left: 14px;
	background: rgba(22, 21, 19, 0.72); color: var(--st-ground);
	font-size: 12px; padding: 4px 10px; border-radius: 999px;
}

.st-info { flex: 1 1 380px; min-width: 0; display: flex; flex-direction: column; gap: 26px; }
.st-head { display: flex; flex-direction: column; gap: 10px; }
.st-title {
	margin: 0; font-family: var(--st-font-display); font-weight: 600; font-size: 34px; line-height: 1.25;
}
.st-price {
	font-family: var(--st-font-display); font-size: 26px; font-weight: 600;
	display: flex; flex-wrap: wrap; align-items: baseline; gap: 12px;
}
.st-price del { order: 2; font-family: var(--st-font-body); font-size: 16px; font-weight: 400; color: var(--st-muted); }
.st-price ins { order: 1; text-decoration: none; }
.st-short { margin: 0; font-size: 15px; line-height: 1.8; color: var(--st-ink-2); }
.st-short p { margin: 0 0 8px; }
.st-short p:last-child { margin: 0; }

.st-form { display: flex; flex-direction: column; gap: 26px; margin: 0; }

/* Attributes */
.st-attr { display: flex; flex-direction: column; gap: 12px; }
.st-attr__row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.st-attr__label { font-size: 14px; font-weight: 600; }
.st-attr__value { font-weight: 400; color: var(--st-ink-2); }
.st-attr__link { font-size: 13px; }
.st-swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.st-swatch {
	width: 44px; height: 44px; border-radius: 50%; border: 2px solid transparent;
	background: var(--st-ground); padding: 3px;
}
.st-swatch span {
	display: block; width: 100%; height: 100%; border-radius: 50%;
	border: 1px solid rgba(0, 0, 0, 0.12);
}
.st-swatch.is-selected { border-color: var(--st-ink); }
.st-swatch.is-out { opacity: 0.35; }
.st-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.st-pill {
	min-width: 60px; height: 46px; padding: 0 14px; border-radius: 10px;
	border: 1.5px solid var(--st-line-strong); background: var(--st-surface); color: var(--st-ink);
	font-size: 15px; font-weight: 500;
}
.st-pill.is-selected { background: var(--st-ink); border-color: var(--st-ink); color: #fff; }
.st-pill.is-out { color: var(--st-faint); text-decoration: line-through; cursor: not-allowed; }
.st-low { font-size: 13px; color: var(--st-alert); }
.st-low[hidden] { display: none; }

/* Actions */
.st-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: stretch; }
.st-qty {
	display: flex; align-items: center; border: 1.5px solid var(--st-line-strong);
	border-radius: var(--st-radius); overflow: hidden; flex: 0 0 auto;
}
.st-qty button {
	width: 44px; height: 54px; border: none; background: transparent; font-size: 20px; color: var(--st-ink);
}
.st-qty input {
	width: 36px; border: none; background: transparent; text-align: center;
	font-weight: 600; font-size: 16px; color: var(--st-ink); -moz-appearance: textfield; appearance: textfield;
}
.st-qty input::-webkit-outer-spin-button,
.st-qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.st-cta {
	flex: 1 1 auto; height: 57px; border: none; border-radius: var(--st-radius);
	background: var(--st-accent); color: #fff; font-family: var(--st-font-display);
	font-size: 17px; font-weight: 600;
}
.st-cta:disabled { background: var(--st-disabled); cursor: not-allowed; }
.st-wa {
	flex: 1 1 100%; display: flex; align-items: center; justify-content: center; gap: 10px;
	height: 52px; border: 1.5px solid var(--st-ink); border-radius: var(--st-radius);
	text-decoration: none; color: var(--st-ink); font-weight: 600; font-size: 15px;
}
.st-wa svg { width: 20px; height: 20px; }

/* Perks */
.st-perks {
	display: flex; flex-direction: column; gap: 14px; background: var(--st-soft);
	border-radius: 14px; padding: 18px 20px;
}
.st-perk { display: flex; gap: 12px; align-items: center; font-size: 14px; }
.st-perk svg { width: 22px; height: 22px; flex: 0 0 auto; color: var(--st-accent); }

/* Accordion */
.st-accordion { border-top: 1px solid var(--st-line); }
.st-accordion details { border-bottom: 1px solid var(--st-line); }
.st-accordion summary {
	list-style: none; display: flex; justify-content: space-between; align-items: center;
	padding: 18px 0; cursor: pointer; font-size: 15px; font-weight: 600;
}
.st-accordion summary::-webkit-details-marker { display: none; }
.st-accordion summary::after { content: '+'; font-size: 20px; font-weight: 400; }
.st-accordion details[open] summary::after { content: '−'; }
.st-accordion__body { padding: 0 0 18px; font-size: 14px; line-height: 1.9; color: var(--st-ink-2); }
.st-accordion__body p { margin: 0 0 8px; }

/* Related */
.st-related { margin-top: 80px; }
.st-related h2 { margin: 0 0 24px; font-family: var(--st-font-display); font-weight: 600; font-size: 24px; }
.st-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.st-card { display: flex; flex-direction: column; gap: 10px; text-decoration: none; color: var(--st-ink); }
.st-card__img { aspect-ratio: 4 / 5; border-radius: 14px; background: var(--st-soft); overflow: hidden; }
.st-card__img img { width: 100%; height: 100%; object-fit: cover; }
.st-card__name { font-size: 15px; font-weight: 500; }
.st-card__price { font-family: var(--st-font-display); font-size: 15px; font-weight: 600; }
.st-card__price del { color: var(--st-muted); font-weight: 400; font-size: 13px; margin-inline-start: 6px; }
.st-card__price ins { text-decoration: none; }

/* Sticky mobile bar */
.st-sticky { display: none; }

/* ---------- Footer ---------- */
.st-footer { background: var(--st-ink); color: var(--st-line-strong); font-size: 14px; }
.st-footer__inner {
	max-width: 1280px; margin: 0 auto; padding: 40px 24px;
	display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between; align-items: center;
}
.st-footer__name { font-family: var(--st-font-display); font-weight: 700; font-size: 20px; color: var(--st-ground); }
.st-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 24px; }
.st-footer a { color: var(--st-line-strong); text-decoration: none; }
.st-footer a:hover { color: #fff; }

/* ---------- Generic pages (cart, checkout, shop) ---------- */
.st-page-title { font-family: var(--st-font-display); font-weight: 600; font-size: 30px; margin: 0 0 24px; }

/* ---------- Phone ---------- */
@media (max-width: 767px) {
	.admin-bar .st-header { top: 0; }
	.st-announce { font-size: 12px; padding: 8px 12px; }
	.st-header__inner {
		display: grid; grid-template-columns: 1fr auto 1fr; padding: 6px 8px; gap: 0;
	}
	.st-header__start { display: flex; justify-self: start; gap: 0; }
	.st-desktop-only { display: none; }
	.st-header__end { justify-self: end; gap: 0; }
	.st-logo { font-size: 21px; justify-self: center; }
	.st-logo img { max-height: 36px; }
	.st-nav { display: none; }
	.st-menu-toggle { display: inline-flex; }
	.st-icon-btn svg { width: 21px; height: 21px; }

	.st-container { padding: 0 16px 40px; }
	.st-breadcrumb { display: none; }
	.st-breadcrumb--mobile { display: flex; font-size: 12px; gap: 6px; margin: 0; }
	.st-notices { padding-top: 16px; }

	.st-product { gap: 20px; }
	.st-gallery {
		flex: 1 1 100%; flex-direction: column; gap: 10px; margin: 0 -16px;
	}
	.st-main { order: 1; border-radius: 0; flex: none; width: 100%; }
	.st-counter { display: block; }
	.st-badge { top: 14px; right: 14px; font-size: 11px; padding: 5px 11px; }
	.st-thumbs { order: 2; flex-direction: row; flex: none; gap: 8px; padding: 0 16px; }
	.st-thumb { flex: 1 1 0; width: auto; height: 76px; border-radius: 8px; }

	.st-info { flex: 1 1 100%; gap: 22px; }
	.st-head { gap: 8px; }
	.st-form { gap: 22px; }
	.st-title { font-size: 25px; line-height: 1.3; }
	.st-price { font-size: 21px; gap: 10px; }
	.st-price del { font-size: 14px; }
	.st-short { font-size: 14px; }

	.st-pills--sizes { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
	.st-pills--sizes .st-pill { min-width: 0; padding: 0; font-size: 14px; }

	.st-actions { gap: 10px; flex-wrap: nowrap; }
	.st-qty button { height: 50px; }
	.st-qty input { width: 28px; font-size: 15px; }
	.st-actions .st-cta { display: none; }
	.st-wa { flex: 1 1 auto; height: auto; font-size: 14px; gap: 8px; }

	.st-perks { padding: 16px; gap: 12px; }
	.st-perk { font-size: 13px; gap: 10px; }
	.st-perk svg { width: 20px; height: 20px; }
	.st-accordion summary { padding: 16px 0; font-size: 14px; }
	.st-accordion__body { font-size: 13px; padding-bottom: 16px; }

	.st-related { margin-top: 16px; }
	.st-related h2 { font-size: 19px; margin-bottom: 16px; }
	.st-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
	.st-card { gap: 6px; }
	.st-card__img { border-radius: 12px; }
	.st-card__name, .st-card__price { font-size: 13px; }

	.st-sticky {
		display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
		background: var(--st-surface); border-top: 1px solid var(--st-line);
		padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); align-items: center; gap: 12px;
		box-shadow: 0 -6px 18px rgba(22, 21, 19, 0.08);
	}
	.st-sticky__meta { display: flex; flex-direction: column; flex: 0 0 auto; line-height: 1.35; }
	.st-sticky__note { font-size: 11px; color: var(--st-muted); }
	.st-sticky__price { font-family: var(--st-font-display); font-size: 16px; font-weight: 600; }
	.st-sticky__price del { display: none; }
	.st-sticky__price ins { text-decoration: none; }
	.st-sticky .st-cta { height: 52px; font-size: 16px; }
	.single-product .st-footer { padding-bottom: 80px; }

	.st-footer__inner { flex-direction: column; align-items: flex-start; gap: 16px; padding: 28px 16px; font-size: 13px; }
	.st-footer__name { font-size: 18px; }
	.st-footer ul { gap: 18px; }
}
