/*
Theme Name: BOBO
Theme URI: https://bobojo.com
Author: BOBO
Author URI: https://bobojo.com
Description: Block theme for the BOBO children's essentials store. WooCommerce + Gutenberg, RTL-first, no page builder.
Requires at least: 6.6
Tested up to: 6.8
Requires PHP: 8.2
Version: 0.1.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: bobo
Tags: e-commerce, block-theme, full-site-editing, rtl-language-support, woocommerce
*/

/* Base resets and layout helpers that are not possible in theme.json alone. */

:root {
	--bobo-radius-sm: 8px;
	--bobo-radius-md: 12px;
	--bobo-radius-lg: 20px;
	--bobo-shadow-card: 0 8px 24px rgba(27, 32, 39, 0.06);
	--bobo-transition: 180ms ease;
}

html {
	scroll-behavior: smooth;
}

body {
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

/* Keep Arabic text comfortable and numbers readable. */
body,
button,
input,
select,
textarea {
	font-family: var(--wp--preset--font-family--body);
	line-height: 1.85;
}

h1,
h2,
h3,
h4,
h5,
h6 {
	font-family: var(--wp--preset--font-family--heading);
	line-height: 1.35;
	letter-spacing: 0;
}

.wp-block-site-title a {
	text-decoration: none;
}

/* Header */
.site-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background: var(--wp--preset--color--card);
	border-bottom: 1px solid color-mix(in srgb, var(--wp--preset--color--text) 10%, transparent);
}

.site-header .wp-block-navigation a {
	text-decoration: none;
	font-weight: 500;
}

.site-header .wp-block-navigation a:hover {
	color: var(--wp--preset--color--primary);
}

.header-actions {
	display: flex;
	align-items: center;
	gap: 0.75rem;
}

.header-actions a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	min-height: 40px;
	border-radius: 999px;
	text-decoration: none;
}

.header-actions a:hover {
	background: var(--wp--preset--color--surface);
}

/* Cards */
.bobo-card {
	background: var(--wp--preset--color--card);
	border: 1px solid color-mix(in srgb, var(--wp--preset--color--text) 8%, transparent);
	border-radius: var(--bobo-radius-md);
	box-shadow: var(--bobo-shadow-card);
	transition: transform var(--bobo-transition), box-shadow var(--bobo-transition);
}

.bobo-card:hover {
	transform: translateY(-2px);
	box-shadow: 0 12px 32px rgba(27, 32, 39, 0.1);
}

.bobo-category-card {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	padding: 1.25rem;
	min-height: 140px;
	text-decoration: none;
	color: var(--wp--preset--color--text);
}

.bobo-category-card:hover {
	color: var(--wp--preset--color--primary);
}

.bobo-category-card__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	border-radius: 999px;
	background: var(--wp--preset--color--pink-soft);
	font-size: 1.4rem;
}

.bobo-eyebrow {
	display: inline-block;
	padding: 0.25rem 0.75rem;
	border-radius: 999px;
	background: var(--wp--preset--color--pink-soft);
	color: var(--wp--preset--color--primary);
	font-size: 0.8rem;
	font-weight: 600;
}

/* Buttons: keep focus visible for accessibility. */
.wp-block-button__link:focus-visible,
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
	outline: 3px solid var(--wp--preset--color--accent);
	outline-offset: 2px;
}

/* RTL/LTR helpers */
[dir="rtl"] .bobo-flip {
	transform: scaleX(-1);
}

/* FAQ */
.bobo-faq details {
	background: var(--wp--preset--color--card);
	border: 1px solid color-mix(in srgb, var(--wp--preset--color--text) 8%, transparent);
	border-radius: var(--bobo-radius-sm);
	padding: 1rem 1.25rem;
}

.bobo-faq details + details {
	margin-top: 0.75rem;
}

.bobo-faq summary {
	cursor: pointer;
	font-weight: 600;
}

/* Footer */
.site-footer {
	background: var(--wp--preset--color--primary);
	color: #fff;
}

.site-footer a {
	color: #fff;
	text-decoration: none;
}

.site-footer a:hover {
	text-decoration: underline;
}

/* WooCommerce small fixes for RTL and cards. */
.woocommerce .products ul,
.woocommerce ul.products {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 1.25rem;
}

.woocommerce ul.products li.product {
	margin: 0;
}

.woocommerce ul.products li.product a img {
	border-radius: var(--bobo-radius-md);
	aspect-ratio: 1 / 1;
	object-fit: cover;
}

.woocommerce .price {
	font-weight: 600;
	font-variant-numeric: tabular-nums;
}

/* Mobile header: keep it usable without JavaScript. */
@media (max-width: 782px) {
	.site-header {
		position: static;
	}

	.header-actions {
		width: 100%;
		justify-content: flex-end;
	}
}

/* Respect reduced motion. */
@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	.bobo-card {
		transition: none;
	}
}
