/*
Theme Name: SmartMerch
Theme URI: https://www.smartmerch.ae
Author: SmartMerch
Author URI: https://www.smartmerch.ae
Description: Block theme for SmartMerch.ae — factory-direct uniforms, workwear, sportswear and promotional merch, made in the UAE. Built around a design-and-preview configurator as the site's flagship feature. Full Site Editing, with a gold-on-deep-green identity, Platypi/Manrope typography, and Arabic-ready Beiruti bundled.
Requires at least: 6.7
Tested up to: 6.8
Requires PHP: 7.4
Version: 1.0.7
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: smartmerch
Tags: full-site-editing, block-patterns, block-styles, custom-colors, custom-logo, custom-menu, editor-style, wide-blocks, translation-ready, rtl-language-support, business, one-column
*/

/*
 * Most styling lives in theme.json (palette, type scale, spacing, block styles).
 * This file carries only what blocks and theme.json cannot express on their own:
 * the configurator UI, the sticky header, and a few layout utilities.
 */

/* --------------------------------------------------------------------------
   Accessibility
   -------------------------------------------------------------------------- */
.skip-link:focus {
	background: var(--wp--preset--color--gold);
	color: #1a1206;
	font-weight: 700;
	z-index: 999999;
}

/* Visually hidden, still announced by screen readers. */
.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

:where(a, button, input, select, textarea, summary):focus-visible {
	outline: 2px solid var(--wp--preset--color--gold);
	outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.001ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.001ms !important;
		scroll-behavior: auto !important;
	}
}

/* --------------------------------------------------------------------------
   Site shell
   -------------------------------------------------------------------------- */

/*
 * WordPress applies the root block gap between the header, main and footer.
 * That leaves a strip of page background showing between the dark header and a
 * dark first section, so remove it — each section supplies its own padding.
 */
.wp-site-blocks > * + * {
	margin-block-start: 0;
}

/* --------------------------------------------------------------------------
   Sticky header
   -------------------------------------------------------------------------- */
.smartmerch-header {
	position: sticky;
	top: 0;
	z-index: 100;
	border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-bar .smartmerch-header {
	top: 32px;
}

@media screen and (max-width: 782px) {
	.admin-bar .smartmerch-header {
		top: 46px;
	}
}

/* Header logo sizing */
.smartmerch-header .wp-block-site-logo img {
	height: 40px;
	width: auto;
}

/* Bundled-logo fallback, used until a Site Logo is uploaded */
.smartmerch-logo-fallback {
	display: block;
	flex: none;
	line-height: 0;
}

.smartmerch-header .smartmerch-logo-fallback img {
	height: 40px;
	width: auto;
}

.smartmerch-footer .smartmerch-logo-fallback img {
	height: auto;
	max-width: 200px;
}

/* Default nav, used until a menu is configured in the editor */
.smartmerch-nav-fallback ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 1.5rem;
}

.smartmerch-nav-fallback a {
	color: #cfd8d2;
	text-decoration: none;
	font-size: 0.9rem;
	font-weight: 500;
	white-space: nowrap;
}

.smartmerch-nav-fallback a:hover,
.smartmerch-nav-fallback a:focus-visible {
	color: #fff;
}

/* Below the header's breakpoint the fallback list would crowd the button. */
@media (max-width: 900px) {
	.smartmerch-nav-fallback {
		display: none;
	}
}

/*
 * Small screens: the logo, hamburger and CTA share one non-wrapping row.
 * The logo and button sizes are set inline in the pattern (deliberately, so a
 * stale stylesheet can never break them), which is why these overrides need
 * !important — they must beat the inline values, but only at this width.
 */
@media (max-width: 640px) {
	.smartmerch-header a[rel="home"] img {
		height: 36px !important;
	}

	.smartmerch-header .wp-block-button__link {
		white-space: nowrap;
		font-size: 0.78rem !important;
		padding: 0.5rem 0.85rem !important;
	}

	.smartmerch-header .wp-block-group.alignwide {
		gap: 0.75rem;
	}
}

/* --------------------------------------------------------------------------
   Eyebrow label (h6 element styles come from theme.json; this adds the colour)
   -------------------------------------------------------------------------- */
.smartmerch-eyebrow {
	text-transform: uppercase;
	letter-spacing: 0.16em;
	font-size: 0.75rem;
	font-weight: 700;
	margin-bottom: 0.6rem;
}

/* --------------------------------------------------------------------------
   Configurator — visual placeholder for the design & preview tool
   -------------------------------------------------------------------------- */
.smartmerch-app {
	background: var(--wp--preset--color--canvas-raised);
	border: 1px solid #24473C;
	border-radius: 14px;
	padding: 1.1rem;
	box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.6);
}

.smartmerch-app__bar {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 1rem;
	padding: 0.2rem 0.3rem 0.9rem;
	font-family: var(--wp--preset--font-family--fira-code);
	font-size: 0.72rem;
	color: #8FA79B;
	border-bottom: 1px solid #24473C;
	margin-bottom: 1rem;
}

.smartmerch-app__dots {
	display: flex;
	gap: 0.3rem;
	flex: none;
}

.smartmerch-app__dots i {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #2C5347;
	display: block;
}

.smartmerch-app__stage {
	background: #0A241E;
	border-radius: 10px;
	min-height: 240px;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	padding: 1rem;
}

.smartmerch-app__stage svg {
	width: 130px;
	height: auto;
	max-height: 220px;
}

/* The garment body colour is driven by this custom property so the swatches
   can repaint it without touching the SVG markup. */
.smartmerch-garment {
	--garment-fill: #F2EFE6;
}

.smartmerch-garment .garment-body {
	fill: var(--garment-fill);
	transition: fill 0.25s ease;
}

.smartmerch-app__controls {
	display: flex;
	gap: 0.6rem;
	margin-top: 1rem;
	flex-wrap: wrap;
	align-items: center;
}

.smartmerch-swatch {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	border: 2px solid transparent;
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
	cursor: pointer;
	padding: 0;
	transition: border-color 0.15s ease, transform 0.15s ease;
}

.smartmerch-swatch:hover {
	transform: scale(1.08);
}

.smartmerch-swatch[aria-pressed="true"] {
	border-color: var(--wp--preset--color--gold);
}

.smartmerch-app__meta {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	flex-wrap: wrap;
	margin-top: 0.9rem;
	font-family: var(--wp--preset--font-family--fira-code);
	font-size: 0.74rem;
	color: #8FA79B;
}

.smartmerch-app__meta strong {
	color: #EEF3F0;
	font-weight: 500;
}

/* Placeholder notice shown inside the stage until the real tool is wired up */
.smartmerch-app__note {
	font-family: var(--wp--preset--font-family--fira-code);
	font-size: 0.68rem;
	color: #7C9086;
	text-align: center;
	margin-top: 0.85rem;
	letter-spacing: 0.02em;
}

/* --------------------------------------------------------------------------
   Cards (steps, product tiles, feature panels)
   -------------------------------------------------------------------------- */
.smartmerch-card {
	background: var(--wp--preset--color--white);
	border: 1px solid var(--wp--preset--color--hairline);
	border-radius: 12px;
	height: 100%;
}

.smartmerch-card--pad {
	padding: 1.6rem;
}

a.smartmerch-card,
.smartmerch-card a {
	text-decoration: none;
}

a.smartmerch-card:hover {
	border-color: var(--wp--preset--color--gold);
}

/* Numbered step marker — the homepage steps are a genuine sequence */
.smartmerch-step-num {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	background: var(--wp--preset--color--contrast);
	color: #fff;
	font-family: var(--wp--preset--font-family--fira-code);
	font-size: 0.78rem;
	font-weight: 600;
	margin-bottom: 0.9rem;
	flex: none;
}

/* Product tile thumbnail area */
.smartmerch-tile__thumb {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1.6rem 1rem;
	min-height: 140px;
}

.smartmerch-tile__thumb svg {
	width: 62px;
	height: auto;
}

.smartmerch-tile__cap {
	padding: 0.9rem 1.1rem 1.2rem;
	border-top: 1px solid #f1ede1;
}

/* --------------------------------------------------------------------------
   Capability list — the in-house branding methods
   -------------------------------------------------------------------------- */
.smartmerch-caps {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	gap: 1px;
	background: rgba(255, 255, 255, 0.1);
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 10px;
	overflow: hidden;
}

.smartmerch-caps li {
	background: var(--wp--preset--color--canvas);
	padding: 1.1rem 1.2rem;
	font-size: 0.92rem;
	display: flex;
	align-items: baseline;
	gap: 0.6rem;
}

.smartmerch-caps li::before {
	content: "—";
	color: var(--wp--preset--color--gold);
	flex: none;
}

/* --------------------------------------------------------------------------
   WooCommerce — shop archive, single product, cart & checkout
   Targets WooCommerce's own stable class hooks (unchanged across versions)
   so the plain markup rendered by woocommerce/legacy-template picks up the
   theme's palette and type instead of WooCommerce's unstyled defaults.
   -------------------------------------------------------------------------- */
.woocommerce-breadcrumb {
	font-size: 0.85rem;
	color: var(--wp--preset--color--muted);
	margin: 0 0 2rem;
}

.woocommerce-breadcrumb a {
	color: var(--wp--preset--color--muted);
}

.woocommerce-result-count,
.woocommerce-ordering {
	font-size: 0.85rem;
	color: var(--wp--preset--color--muted);
}

.woocommerce-ordering select {
	border: 1px solid var(--wp--preset--color--hairline);
	border-radius: 8px;
	padding: 0.5rem 0.8rem;
	font-family: inherit;
}

/* Shop grid */
ul.products {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 1.6rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

ul.products li.product {
	background: var(--wp--preset--color--white);
	border: 1px solid var(--wp--preset--color--hairline);
	border-radius: 12px;
	overflow: hidden;
	text-align: left;
	transition: border-color 0.15s ease;
}

ul.products li.product:hover {
	border-color: var(--wp--preset--color--gold);
}

ul.products li.product a.woocommerce-loop-product__link {
	display: block;
	color: inherit;
	text-decoration: none;
}

ul.products li.product img {
	width: 100%;
	height: 240px;
	object-fit: cover;
}

ul.products li.product .woocommerce-loop-product__title {
	font-family: var(--wp--preset--font-family--platypi);
	font-size: 1.05rem;
	font-weight: 600;
	margin: 1rem 1.1rem 0.3rem;
}

ul.products li.product .price {
	display: block;
	margin: 0 1.1rem 1.2rem;
	font-size: 0.95rem;
	color: var(--wp--preset--color--gold-deep);
	font-weight: 600;
}

ul.products li.product .price del {
	color: var(--wp--preset--color--muted);
	font-weight: 400;
	opacity: 0.7;
}

ul.products li.product .button {
	margin: 0 1.1rem 1.1rem;
	width: calc(100% - 2.2rem);
	text-align: center;
}

ul.products li.product .star-rating {
	margin: 0.4rem 1.1rem 0;
}

.woocommerce-pagination {
	margin-top: 3rem;
}

.woocommerce-pagination ul.page-numbers {
	display: flex;
	gap: 0.4rem;
	list-style: none;
	padding: 0;
	margin: 0;
}

.woocommerce-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.2rem;
	height: 2.2rem;
	padding: 0 0.6rem;
	border: 1px solid var(--wp--preset--color--hairline);
	border-radius: 6px;
	text-decoration: none;
	color: var(--wp--preset--color--contrast);
}

.woocommerce-pagination .page-numbers.current {
	background: var(--wp--preset--color--gold);
	border-color: var(--wp--preset--color--gold);
	color: #1a1206;
}

/* Single product */
.woocommerce div.product div.images img {
	border-radius: 12px;
}

.woocommerce div.product .price {
	color: var(--wp--preset--color--gold-deep);
	font-size: 1.4rem;
	font-weight: 700;
}

.woocommerce div.product p.price del {
	color: var(--wp--preset--color--muted);
	font-weight: 400;
	opacity: 0.7;
	margin-inline-end: 0.5rem;
}

.woocommerce div.product .woocommerce-product-details__short-description {
	color: var(--wp--preset--color--muted);
	line-height: 1.65;
	margin: 1rem 0 1.5rem;
}

.woocommerce div.product form.cart {
	margin-top: 1.5rem;
}

.woocommerce div.product form.cart .variations select,
.woocommerce div.product form.cart .quantity .qty {
	border: 1px solid var(--wp--preset--color--hairline);
	border-radius: 8px;
	padding: 0.6rem 0.9rem;
	font-family: inherit;
}

.woocommerce div.product form.cart .variations {
	margin-bottom: 1.2rem;
}

.woocommerce div.product form.cart .variations td.label {
	font-weight: 600;
	padding-right: 1rem;
}

/* Notices */
.woocommerce-message,
.woocommerce-error,
.woocommerce-info,
.woocommerce-noreviews {
	list-style: none;
	margin: 0 0 1.6rem;
	padding: 1rem 1.3rem;
	border-radius: 10px;
	background: var(--wp--preset--color--base-alt);
	border: 1px solid var(--wp--preset--color--hairline);
	color: var(--wp--preset--color--contrast);
}

.woocommerce-error {
	background: #fbeceb;
	border-color: #e3b8b4;
}

.woocommerce-message .button,
.woocommerce-error .button {
	float: none;
	display: inline-block;
	margin-inline-start: 0.75rem;
}

/* Cart & checkout tables */
.woocommerce table.shop_table {
	border-collapse: collapse;
	width: 100%;
	border: 1px solid var(--wp--preset--color--hairline);
	border-radius: 10px;
	overflow: hidden;
}

.woocommerce table.shop_table th,
.woocommerce table.shop_table td {
	padding: 0.9rem 1rem;
	border-bottom: 1px solid var(--wp--preset--color--hairline);
	text-align: left;
}

.woocommerce table.shop_table th {
	font-size: 0.78rem;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--wp--preset--color--muted);
	background: var(--wp--preset--color--base-alt);
}

.woocommerce #payment,
.woocommerce-checkout-review-order {
	background: var(--wp--preset--color--base-alt);
	border: 1px solid var(--wp--preset--color--hairline);
	border-radius: 10px;
	padding: 1.4rem;
}

.woocommerce form .form-row input.input-text,
.woocommerce form .form-row select,
.woocommerce form .form-row textarea {
	border: 1px solid var(--wp--preset--color--hairline);
	border-radius: 8px;
	padding: 0.65rem 0.9rem;
	font-family: inherit;
	width: 100%;
}

/* --------------------------------------------------------------------------
   "What We Make" carousel (homepage)
   -------------------------------------------------------------------------- */
.smartmerch-tile__thumb--photo {
	padding: 0;
	min-height: 0;
	height: 180px;
	overflow: hidden;
}

.smartmerch-tile__thumb--photo img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.smartmerch-carousel__viewport {
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	-ms-overflow-style: none;
}

.smartmerch-carousel__viewport::-webkit-scrollbar {
	display: none;
}

.smartmerch-carousel__track {
	display: flex;
	gap: var(--wp--preset--spacing--30, 1rem);
}

.smartmerch-carousel__slide {
	flex: 0 0 calc(25% - 0.75rem);
	scroll-snap-align: start;
	min-width: 220px;
}

.smartmerch-carousel--static .smartmerch-carousel__viewport {
	overflow: visible;
}

.smartmerch-carousel--static .smartmerch-carousel__track {
	flex-wrap: wrap;
}

.smartmerch-carousel--static .smartmerch-carousel__slide {
	flex: 1 1 calc(25% - 0.75rem);
}

.smartmerch-carousel__controls {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 0.7rem;
	margin-top: 1.6rem;
}

.smartmerch-carousel__controls button {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	border: 1px solid var(--wp--preset--color--hairline);
	background: var(--wp--preset--color--white);
	color: var(--wp--preset--color--contrast);
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 0.85rem;
	line-height: 1;
	transition: border-color 0.15s ease, background 0.15s ease;
}

.smartmerch-carousel__controls button:hover {
	border-color: var(--wp--preset--color--gold);
}

.smartmerch-carousel__toggle::before {
	font-size: 0.8rem;
}

.smartmerch-carousel__toggle[data-playing="false"]::before {
	content: "\25B6";
}

.smartmerch-carousel__toggle[data-playing="true"]::before {
	content: "\23F8";
}

@media (max-width: 900px) {
	.smartmerch-carousel__slide,
	.smartmerch-carousel--static .smartmerch-carousel__slide {
		flex-basis: calc(50% - 0.5rem);
	}
}

@media (max-width: 560px) {
	.smartmerch-carousel__slide,
	.smartmerch-carousel--static .smartmerch-carousel__slide {
		flex-basis: 82%;
	}
}

/* --------------------------------------------------------------------------
   Portfolio gallery (single portfolio item, additional images)
   -------------------------------------------------------------------------- */
.smartmerch-portfolio-gallery-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 1rem;
}

.smartmerch-portfolio-gallery-grid img {
	width: 100%;
	height: 220px;
	object-fit: cover;
	border-radius: 10px;
}

/* --------------------------------------------------------------------------
   Utilities
   -------------------------------------------------------------------------- */
.smartmerch-tabular {
	font-variant-numeric: tabular-nums;
}

/* Keep wide content from pushing the page sideways */
.wp-block-table,
.wp-block-code,
.wp-block-preformatted {
	overflow-x: auto;
}

/* Footer nav should not carry underlines */
.smartmerch-footer .wp-block-navigation a {
	text-decoration: none;
}

.smartmerch-footer .wp-block-navigation a:hover {
	text-decoration: underline;
}
