/**
 * Zaviyah main stylesheet.
 *
 * Architecture: every color/spacing/radius value below reads from the
 * --zv-* custom properties defined in zaviyah-tokens.css (fallback)
 * and overridden inline by Zaviyah_Customizer::output_css_variables()
 * on real page loads. Never hardcode a hex color or px radius in this
 * file — that's the one rule that keeps the whole Customizer color
 * system working.
 *
 * Breakpoints used throughout (mobile-first):
 *   base   : 0–479px   (phones, portrait)
 *   sm     : 480px+    (large phones)
 *   md     : 768px+    (tablets)
 *   lg     : 1024px+   (small laptops)
 *   xl     : 1280px+   (desktop)
 *   xxl    : 1440px+   (large desktop)
 * These intentionally collapse the brief's 9 test widths (320/375/390/
 * 414/768/1024/1280/1440/1920) into 6 CSS breakpoints — 320–414 all
 * share the same mobile layout rules by design (single column,
 * stacked nav), so testing each of those four individually against
 * this stylesheet should show identical behavior; 1920 uses the same
 * rules as 1440+ since --zv-container-width caps content well below
 * that regardless.
 */

/* ---------------------------------------------------------------
   Reset & base
------------------------------------------------------------------ */

*,
*::before,
*::after {
	box-sizing: border-box;
}

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

body {
	margin: 0;
	font-family: var(--zv-font-body);
	color: var(--zv-color-text);
	background: var(--zv-color-background);
	line-height: 1.6;
	font-size: 16px;
}

img {
	max-width: 100%;
	height: auto;
	display: block;
}

a {
	color: inherit;
	text-decoration: none;
}

h1, h2, h3, h4, h5, h6 {
	font-family: var(--zv-font-heading);
	line-height: 1.2;
	margin: 0 0 0.6em;
	color: var(--zv-color-secondary);
}

h1 { font-size: clamp(1.8rem, 1.4rem + 2vw, 3rem); }
h2 { font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2.25rem); }
h3 { font-size: clamp(1.2rem, 1.05rem + 0.8vw, 1.5rem); }

p { margin: 0 0 1em; }

.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}

.zv-skip-link {
	position: absolute;
	top: -100px;
	left: 0;
	background: var(--zv-color-primary);
	color: #fff;
	padding: 0.75em 1.25em;
	z-index: 10000;
	transition: top 0.2s ease;
}
.zv-skip-link:focus {
	top: 0;
	position: fixed;
}

*:focus-visible {
	outline: 2px solid var(--zv-color-accent);
	outline-offset: 2px;
}

/* ---------------------------------------------------------------
   Layout primitives
------------------------------------------------------------------ */

.zv-container {
	max-width: var(--zv-container-width);
	margin-inline: auto;
	padding-inline: 20px;
}

@media (min-width: 768px) {
	.zv-container { padding-inline: 32px; }
}

.zv-content {
	padding-block: 48px;
}

.zv-button,
button.zv-button,
.wp-block-button__link,
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5em;
	background: var(--zv-color-primary);
	color: #fff;
	border: 1px solid var(--zv-color-primary);
	border-radius: var(--zv-radius);
	padding: 0.75em 1.5em;
	font-weight: 600;
	font-size: 0.95rem;
	cursor: pointer;
	transition: background-color 0.15s ease, transform 0.1s ease;
}
.zv-button:hover,
.wp-block-button__link:hover,
.woocommerce a.button:hover,
.woocommerce button.button:hover {
	background: var(--zv-color-accent);
	border-color: var(--zv-color-accent);
	color: #fff;
}
.zv-button:active { transform: translateY(1px); }

/* ---------------------------------------------------------------
   Header
------------------------------------------------------------------ */

.zv-header {
	background: var(--zv-color-background);
	border-bottom: 1px solid var(--zv-color-border);
	position: relative;
	z-index: 100;
}

.zv-header--sticky .zv-header__main {
	position: sticky;
	top: 0;
	z-index: 100;
	background: var(--zv-color-background);
}

.zv-announcement-bar {
	background: var(--zv-color-primary);
	color: #fff;
	text-align: center;
	font-size: 0.85rem;
	padding: 8px 16px;
}
.zv-announcement-bar p { margin: 0; }

.zv-header__row {
	display: flex;
	align-items: center;
	gap: 24px;
	padding-block: 16px;
}

.zv-header__logo-text {
	font-family: var(--zv-font-heading);
	font-weight: 700;
	font-size: 1.4rem;
	color: var(--zv-color-primary);
	letter-spacing: 0.02em;
}

.zv-header__nav {
	flex: 1;
	display: none;
}

.zv-header__menu {
	display: flex;
	gap: 28px;
	list-style: none;
	margin: 0;
	padding: 0;
	position: relative;
}
.zv-header__menu > li {
	position: relative;
}
.zv-header__menu > li > a {
	font-weight: 500;
	font-size: 0.95rem;
	padding: 8px 0;
	display: inline-block;
}
.zv-header__menu > li > a:hover {
	color: var(--zv-color-accent);
}

/* Sub-menu fallback for wp_nav_menu's default <ul class="sub-menu"> when
   the primary menu location is rendered outside the Mega Menu Elementor
   widget (i.e. Elementor Pro / mega menu widget not in use). */
.zv-header__menu .sub-menu {
	position: absolute;
	top: 100%;
	left: 0;
	background: var(--zv-color-background);
	border: 1px solid var(--zv-color-border);
	border-radius: var(--zv-radius);
	box-shadow: var(--zv-shadow);
	list-style: none;
	margin: 0;
	padding: 8px 0;
	min-width: 220px;
	display: none;
}
.zv-header__menu li:hover > .sub-menu,
.zv-header__menu li:focus-within > .sub-menu {
	display: block;
}
.zv-header__menu .sub-menu a {
	display: block;
	padding: 8px 18px;
}

.zv-header__actions {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-left: auto;
}

.zv-header__icon-btn {
	background: none;
	border: none;
	cursor: pointer;
	color: var(--zv-color-text);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: var(--zv-radius);
	position: relative;
}
.zv-header__icon-btn:hover {
	background: var(--zv-color-surface);
}

.zv-header__cart-count {
	position: absolute;
	top: 2px;
	right: 2px;
	background: var(--zv-color-accent);
	color: #fff;
	font-size: 0.65rem;
	line-height: 1;
	border-radius: 999px;
	min-width: 16px;
	height: 16px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0 3px;
}

.zv-header__search-panel {
	border-top: 1px solid var(--zv-color-border);
	padding-block: 16px;
}
.zv-header__search-panel[hidden] { display: none; }

.zv-header__mobile-toggle { display: inline-flex; }

@media (min-width: 1024px) {
	.zv-header__nav { display: block; }
	.zv-header__mobile-toggle { display: none; }
}

/* ---------------------------------------------------------------
   Mobile menu
------------------------------------------------------------------ */

.zv-mobile-menu {
	background: var(--zv-color-background);
	border-top: 1px solid var(--zv-color-border);
}
.zv-mobile-menu[hidden] { display: none; }

.zv-mobile-menu__list {
	list-style: none;
	margin: 0;
	padding: 8px 20px 20px;
}
.zv-mobile-menu__list a {
	display: block;
	padding: 12px 0;
	border-bottom: 1px solid var(--zv-color-border);
	font-weight: 500;
}
.zv-mobile-menu__list .sub-menu {
	list-style: none;
	padding-left: 16px;
	margin: 0;
}
.zv-mobile-menu__list .sub-menu a {
	border-bottom: none;
	padding: 8px 0;
	font-weight: 400;
	color: var(--zv-color-text-muted);
}

@media (min-width: 1024px) {
	.zv-mobile-menu { display: none !important; }
}

/* ---------------------------------------------------------------
   Mega menu (Elementor widget output)
------------------------------------------------------------------ */

.zv-mega-menu__top {
	display: flex;
	gap: 28px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.zv-mega-menu__item { position: relative; }
.zv-mega-menu__item > a {
	display: inline-block;
	padding: 8px 0;
	font-weight: 500;
}

.zv-mega-menu__panel {
	display: none;
	position: absolute;
	top: 100%;
	left: 50%;
	transform: translateX(-50%);
	background: var(--zv-color-background);
	border: 1px solid var(--zv-color-border);
	border-radius: var(--zv-radius);
	box-shadow: var(--zv-shadow);
	padding: 24px;
	gap: 32px;
	grid-template-columns: repeat(var(--zv-panel-cols, 4), minmax(160px, 1fr));
	min-width: 640px;
	z-index: 200;
}

.zv-mega-menu__item:hover > .zv-mega-menu__panel,
.zv-mega-menu__item:focus-within > .zv-mega-menu__panel {
	display: grid;
}

.zv-mega-menu__column-title {
	font-weight: 700;
	display: block;
	margin-bottom: 10px;
	color: var(--zv-color-secondary);
}
.zv-mega-menu__column ul {
	list-style: none;
	margin: 0;
	padding: 0;
}
.zv-mega-menu__column li a {
	display: block;
	padding: 5px 0;
	color: var(--zv-color-text-muted);
	font-size: 0.9rem;
}
.zv-mega-menu__column li a:hover {
	color: var(--zv-color-accent);
}

/* ---------------------------------------------------------------
   Hero (used by demo content / Elementor sections referencing these classes)
------------------------------------------------------------------ */

.zv-demo-hero {
	background: linear-gradient(180deg, var(--zv-color-secondary), var(--zv-color-primary));
	color: #fff;
}
.zv-demo-hero h1,
.zv-demo-hero p {
	color: #fff;
}

/* ---------------------------------------------------------------
   Category grid
------------------------------------------------------------------ */

.zv-category-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 20px;
	margin-block: 32px;
}
@media (min-width: 768px) {
	.zv-category-grid--cols-4 { grid-template-columns: repeat(4, 1fr); }
	.zv-category-grid--cols-3 { grid-template-columns: repeat(3, 1fr); }
}

.zv-category-card {
	display: block;
	text-align: center;
	border: 1px solid var(--zv-color-border);
	border-radius: var(--zv-radius);
	overflow: hidden;
	background: var(--zv-color-surface);
	box-shadow: var(--zv-shadow);
	transition: transform 0.15s ease;
}
.zv-category-card:hover { transform: translateY(-3px); }
.zv-category-card img { aspect-ratio: 1 / 1; object-fit: cover; }
.zv-category-card__placeholder {
	display: block;
	aspect-ratio: 1 / 1;
	background: var(--zv-color-border);
}
.zv-category-card__title {
	display: block;
	font-weight: 600;
	padding-top: 12px;
}
.zv-category-card__count {
	display: block;
	font-size: 0.8rem;
	color: var(--zv-color-text-muted);
	padding-bottom: 14px;
}

/* ---------------------------------------------------------------
   Product grid & card (works with both native WooCommerce loop and
   the Zaviyah Product Grid Elementor widget, since both render
   woocommerce/content-product.php)
------------------------------------------------------------------ */

ul.products,
.zv-product-grid {
	display: grid !important;
	grid-template-columns: repeat(2, 1fr);
	gap: 20px;
	list-style: none;
	margin: 0 0 32px;
	padding: 0;
}

@media (min-width: 768px) {
	ul.products,
	.zv-product-grid--cols-3 { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1024px) {
	ul.products.columns-4,
	.zv-product-grid--cols-4 { grid-template-columns: repeat(4, 1fr); }
	.zv-product-grid--cols-5 { grid-template-columns: repeat(5, 1fr); }
	.zv-product-grid--cols-6 { grid-template-columns: repeat(6, 1fr); }
}

.zv-product-card,
li.product.zv-product-card {
	list-style: none;
	background: var(--zv-color-background);
	border: 1px solid var(--zv-color-border);
	border-radius: var(--zv-radius);
	overflow: hidden;
	box-shadow: var(--zv-shadow);
	transition: box-shadow 0.15s ease, transform 0.15s ease;
	display: flex;
	flex-direction: column;
}
.zv-product-card:hover {
	transform: translateY(-3px);
	box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.zv-product-card__media {
	position: relative;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	background: var(--zv-color-surface);
}
.zv-product-card__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.3s ease;
}
.zv-product-card:hover .zv-product-card__media img {
	transform: scale(1.04);
}

.zv-product-badges {
	position: absolute;
	top: 10px;
	left: 10px;
	display: flex;
	flex-direction: column;
	gap: 6px;
	z-index: 2;
}
.zv-badge {
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	padding: 4px 8px;
	border-radius: 3px;
	color: #fff;
}
.zv-badge--sale { background: var(--zv-color-sale); }
.zv-badge--new { background: var(--zv-color-accent); }
.zv-badge--featured { background: var(--zv-color-secondary); }

.zv-product-card__quick-view {
	position: absolute;
	bottom: 10px;
	left: 50%;
	transform: translate(-50%, 8px);
	background: rgba(255, 255, 255, 0.95);
	border: none;
	border-radius: var(--zv-radius);
	padding: 8px 16px;
	font-size: 0.8rem;
	font-weight: 600;
	opacity: 0;
	transition: opacity 0.15s ease, transform 0.15s ease;
	cursor: pointer;
	white-space: nowrap;
}
.zv-product-card:hover .zv-product-card__quick-view {
	opacity: 1;
	transform: translate(-50%, 0);
}

.zv-product-card__body {
	padding: 14px 16px 4px;
	flex: 1;
}
.zv-product-card__body .woocommerce-loop-product__title {
	font-size: 0.95rem;
	font-weight: 600;
	margin-bottom: 6px;
	color: var(--zv-color-text);
}
.zv-product-card__body .price {
	font-weight: 700;
	color: var(--zv-color-primary);
}
.zv-product-card__body .price del {
	color: var(--zv-color-text-muted);
	font-weight: 400;
	opacity: 0.7;
}
.zv-product-card__body .price ins {
	text-decoration: none;
	color: var(--zv-color-sale);
}

.zv-product-card__footer {
	padding: 10px 16px 16px;
}
.zv-product-card__footer .button {
	width: 100%;
}

/* Quick view modal */
.zv-quick-view-modal {
	position: fixed;
	inset: 0;
	background: rgba(10, 10, 10, 0.6);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 1000;
	padding: 20px;
}
.zv-quick-view-modal[hidden] { display: none; }
.zv-quick-view-modal__inner {
	background: var(--zv-color-background);
	border-radius: var(--zv-radius);
	max-width: 900px;
	width: 100%;
	max-height: 90vh;
	overflow-y: auto;
	padding: 32px;
	position: relative;
}
.zv-quick-view-modal__close {
	position: absolute;
	top: 12px;
	right: 12px;
	background: none;
	border: none;
	font-size: 1.4rem;
	cursor: pointer;
	line-height: 1;
}
.zv-quick-view {
	display: grid;
	gap: 24px;
}
@media (min-width: 768px) {
	.zv-quick-view { grid-template-columns: 1fr 1fr; }
}

/* ---------------------------------------------------------------
   Vehicle fitment box (single product page)
------------------------------------------------------------------ */

.zv-fitment {
	margin-top: 20px;
	padding: 16px;
	border: 1px solid var(--zv-color-border);
	border-radius: var(--zv-radius);
	background: var(--zv-color-surface);
}
.zv-fitment h4 { margin-bottom: 8px; }
.zv-fitment ul {
	list-style: none;
	margin: 0 0 8px;
	padding: 0;
	font-size: 0.9rem;
}
.zv-fitment__notes {
	font-size: 0.85rem;
	color: var(--zv-color-text-muted);
	margin: 0;
}

/* ---------------------------------------------------------------
   Blog
------------------------------------------------------------------ */

.zv-blog-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 28px;
}
@media (min-width: 768px) {
	.zv-blog-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
	.zv-blog-grid { grid-template-columns: repeat(3, 1fr); }
}

.zv-blog-card {
	border: 1px solid var(--zv-color-border);
	border-radius: var(--zv-radius);
	overflow: hidden;
	box-shadow: var(--zv-shadow);
}
.zv-blog-card__thumbnail img { aspect-ratio: 16 / 10; object-fit: cover; }
.zv-blog-card__body { padding: 16px 18px 20px; }
.zv-blog-card__date {
	font-size: 0.78rem;
	color: var(--zv-color-text-muted);
	text-transform: uppercase;
	letter-spacing: 0.03em;
}
.zv-blog-card__title { font-size: 1.1rem; margin: 6px 0 8px; }
.zv-blog-card__excerpt {
	font-size: 0.9rem;
	color: var(--zv-color-text-muted);
	margin: 0;
}

/* ---------------------------------------------------------------
   Trust / newsletter (demo sections)
------------------------------------------------------------------ */

.zv-trust-section {
	background: var(--zv-color-surface);
	padding: 48px 0;
	text-align: center;
}

.zv-newsletter-form {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	max-width: 480px;
	margin: 24px auto;
}
.zv-newsletter-form input[type='email'] {
	flex: 1;
	min-width: 200px;
	padding: 0.75em 1em;
	border: 1px solid var(--zv-color-border);
	border-radius: var(--zv-radius);
	font-size: 0.95rem;
}
.zv-newsletter-form__status {
	width: 100%;
	font-size: 0.85rem;
	margin: 0;
}

/* ---------------------------------------------------------------
   Footer
------------------------------------------------------------------ */

.zv-footer {
	background: var(--zv-color-secondary);
	color: #fff;
	margin-top: 48px;
}
.zv-footer__grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 32px;
	padding-block: 48px;
}
@media (min-width: 768px) {
	.zv-footer__grid { grid-template-columns: 2fr repeat(3, 1fr); }
}
.zv-footer__col p { color: rgba(255, 255, 255, 0.7); font-size: 0.9rem; }
.zv-footer__menu {
	list-style: none;
	margin: 0;
	padding: 0;
}
.zv-footer__menu a {
	display: block;
	padding: 6px 0;
	color: rgba(255, 255, 255, 0.75);
	font-size: 0.9rem;
}
.zv-footer__menu a:hover { color: #fff; }

.zv-footer__bottom {
	border-top: 1px solid rgba(255, 255, 255, 0.12);
	padding-block: 20px;
	font-size: 0.8rem;
	color: rgba(255, 255, 255, 0.6);
}

/* ---------------------------------------------------------------
   Comments (core WordPress comment_form() output)
------------------------------------------------------------------ */

.comment-form input[type='text'],
.comment-form input[type='email'],
.comment-form input[type='url'],
.comment-form textarea {
	width: 100%;
	padding: 0.7em 1em;
	border: 1px solid var(--zv-color-border);
	border-radius: var(--zv-radius);
	font-family: inherit;
	margin-bottom: 12px;
}

/* ---------------------------------------------------------------
   404 / no-results
------------------------------------------------------------------ */

.zv-content--404,
.zv-no-results {
	text-align: center;
	padding-block: 64px;
}
