/**
 * Alibarbar — main theme stylesheet.
 *
 * A lightweight base layer: design tokens, reset, layout shell, typography,
 * navigation, forms and minimal WooCommerce polish. The full shop design is
 * built in phase 2; this keeps every page readable out of the box.
 */

/* -------------------------------------------------------------------------
 * 1. Design tokens
 * ---------------------------------------------------------------------- */
:root {
	--ab-color-bg: #ffffff;
	--ab-color-fg: #1a1a1a;
	--ab-color-muted: #6b7280;
	--ab-color-border: #e5e7eb;
	--ab-color-surface: #f5f5f7;
	--ab-color-accent: #7c3aed;
	--ab-color-accent-dark: #6028c4;

	--ab-container: 1200px;
	--ab-container-wide: 1400px;
	--ab-gap: 1.5rem;
	--ab-radius: 10px;

	--ab-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
	--ab-line: 1.6;
}

/* -------------------------------------------------------------------------
 * 2. Reset / base
 * ---------------------------------------------------------------------- */
*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
}

body {
	margin: 0;
	font-family: var(--ab-font);
	line-height: var(--ab-line);
	color: var(--ab-color-fg);
	background: var(--ab-color-bg);
	-webkit-font-smoothing: antialiased;
}

img,
svg,
video {
	max-width: 100%;
	height: auto;
}

a {
	color: var(--ab-color-accent);
	text-decoration: none;
}

a:hover,
a:focus {
	text-decoration: underline;
}

h1,
h2,
h3,
h4,
h5,
h6 {
	line-height: 1.25;
	margin: 0 0 0.5em;
}

p,
ul,
ol {
	margin: 0 0 1em;
}

/* -------------------------------------------------------------------------
 * 3. Layout shell
 * ---------------------------------------------------------------------- */
.container {
	width: 100%;
	max-width: var(--ab-container);
	margin-inline: auto;
	padding-inline: 1.25rem;
}

.site-content > .container {
	display: flex;
	gap: 2.5rem;
	align-items: flex-start;
	padding-block: 2.5rem;
}

.site-main {
	flex: 1 1 auto;
	min-width: 0;
}

.widget-area {
	flex: 0 0 300px;
	max-width: 300px;
}

.no-sidebar .widget-area {
	display: none;
}

/* -------------------------------------------------------------------------
 * 4. Header
 * ---------------------------------------------------------------------- */
.site-header {
	border-bottom: 1px solid var(--ab-color-border);
	background: var(--ab-color-bg);
}

.site-header__inner {
	display: flex;
	align-items: center;
	gap: var(--ab-gap);
	padding-block: 1rem;
}

.site-branding {
	display: flex;
	flex-direction: column;
	margin-right: auto;
}

.site-title {
	font-size: 1.5rem;
	margin: 0;
}

.site-title a {
	color: var(--ab-color-fg);
	text-decoration: none;
}

.site-description {
	margin: 0;
	font-size: 0.85rem;
	color: var(--ab-color-muted);
}

.custom-logo {
	max-height: 60px;
	width: auto;
}

/* -------------------------------------------------------------------------
 * 5. Navigation
 * ---------------------------------------------------------------------- */
.main-navigation ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	gap: 1.5rem;
}

.main-navigation a {
	color: var(--ab-color-fg);
	font-weight: 500;
}

.menu-toggle {
	display: none;
	border: 0;
	background: transparent;
	cursor: pointer;
	padding: 0.5rem;
}

.menu-toggle__bar,
.menu-toggle__bar::before,
.menu-toggle__bar::after {
	display: block;
	width: 24px;
	height: 2px;
	background: var(--ab-color-fg);
	position: relative;
	transition: transform 0.2s ease;
}

.menu-toggle__bar::before,
.menu-toggle__bar::after {
	content: "";
	position: absolute;
	left: 0;
}

.menu-toggle__bar::before {
	top: -7px;
}

.menu-toggle__bar::after {
	top: 7px;
}

/* -------------------------------------------------------------------------
 * 6. Header cart (WooCommerce)
 * ---------------------------------------------------------------------- */
.header-cart-link {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	color: var(--ab-color-fg);
	font-weight: 600;
}

.header-cart-count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 1.4rem;
	height: 1.4rem;
	padding: 0 0.35rem;
	border-radius: 999px;
	background: var(--ab-color-accent);
	color: #fff;
	font-size: 0.75rem;
}

/* -------------------------------------------------------------------------
 * 7. Posts grid & entries
 * ---------------------------------------------------------------------- */
.posts-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 2rem;
}

.entry-card {
	display: flex;
	flex-direction: column;
	border: 1px solid var(--ab-color-border);
	border-radius: var(--ab-radius);
	overflow: hidden;
	background: var(--ab-color-bg);
}

.entry-card .post-thumbnail img {
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	display: block;
}

.entry-card__body {
	padding: 1.25rem;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.entry-title {
	font-size: 1.2rem;
}

.entry-title a {
	color: var(--ab-color-fg);
}

.entry-meta {
	font-size: 0.85rem;
	color: var(--ab-color-muted);
	display: flex;
	gap: 0.75rem;
	flex-wrap: wrap;
}

.entry-single .entry-content,
.entry-page .entry-content {
	max-width: 75ch;
}

.entry-single .post-thumbnail,
.entry-page .post-thumbnail {
	margin: 0 0 1.5rem;
}

.page-header {
	margin-bottom: 2rem;
}

.more-link {
	align-self: flex-start;
	font-weight: 600;
}

/* -------------------------------------------------------------------------
 * 8. Forms, buttons & widgets
 * ---------------------------------------------------------------------- */
input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
input[type="search"],
input[type="number"],
input[type="tel"],
textarea,
select {
	width: 100%;
	max-width: 100%;
	padding: 0.6rem 0.75rem;
	border: 1px solid var(--ab-color-border);
	border-radius: 8px;
	font: inherit;
	background: #fff;
}

button,
.button,
input[type="submit"],
.wp-block-button__link {
	display: inline-block;
	padding: 0.65rem 1.25rem;
	border: 0;
	border-radius: 8px;
	background: var(--ab-color-accent);
	color: #fff;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
	text-decoration: none;
	transition: background 0.15s ease;
}

button:hover,
.button:hover,
input[type="submit"]:hover {
	background: var(--ab-color-accent-dark);
}

.search-form {
	display: flex;
	gap: 0.5rem;
}

.widget {
	margin-bottom: 2rem;
}

.widget-title {
	font-size: 1.05rem;
	margin-bottom: 0.75rem;
}

/* -------------------------------------------------------------------------
 * 9. Footer
 * ---------------------------------------------------------------------- */
.site-footer {
	margin-top: 3rem;
	border-top: 1px solid var(--ab-color-border);
	background: var(--ab-color-surface);
}

.site-footer__widgets {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 2rem;
	padding-block: 2.5rem;
}

.site-footer__bottom {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding-block: 1.5rem;
	border-top: 1px solid var(--ab-color-border);
}

.footer-menu {
	list-style: none;
	display: flex;
	gap: 1.25rem;
	margin: 0;
	padding: 0;
}

.site-info {
	margin: 0;
	color: var(--ab-color-muted);
	font-size: 0.9rem;
}

/* -------------------------------------------------------------------------
 * 10. WooCommerce minimal polish
 * ---------------------------------------------------------------------- */
.woocommerce-main ul.products {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 2rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

.woocommerce ul.products li.product {
	float: none;
	width: auto !important;
	margin: 0 !important;
}

.woocommerce ul.products li.product img {
	border-radius: var(--ab-radius);
}

/* -------------------------------------------------------------------------
 * 11. Accessibility helpers
 * ---------------------------------------------------------------------- */
.screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	width: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute !important;
	word-wrap: normal !important;
}

.skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	z-index: 100000;
	padding: 0.75rem 1.25rem;
	background: #fff;
	color: var(--ab-color-accent);
}

.skip-link:focus {
	left: 0;
}

/* -------------------------------------------------------------------------
 * 12. Responsive
 * ---------------------------------------------------------------------- */
@media (max-width: 782px) {
	.menu-toggle {
		display: block;
	}

	.main-navigation .primary-menu {
		display: none;
		position: absolute;
		left: 0;
		right: 0;
		flex-direction: column;
		gap: 0;
		background: #fff;
		border-bottom: 1px solid var(--ab-color-border);
		padding: 1rem 1.25rem;
		z-index: 50;
	}

	.main-navigation.is-open .primary-menu {
		display: flex;
	}

	.site-content > .container {
		flex-direction: column;
	}

	.widget-area {
		flex-basis: auto;
		max-width: none;
		width: 100%;
	}
}
