/*
Theme Name: DMHouse Theme Market
Author: DM House
Author URI: https://dmhouse.market
Description: Lightweight RTL-first theme built for the DMHouse Market store on Elementor and WooCommerce. Structural styles only; all design lives in Elementor and the market plugins.
Version: 3.9.1
Requires at least: 6.0
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: dmhouse-theme-market
Tags: elementor, woocommerce, e-commerce, translation-ready, rtl-language-support, full-width-template
*/

/* Vazirmatn ships with the theme (OFL); no CDN. Variable font, one file for every weight. */
@font-face {
	font-family: 'Vazirmatn';
	font-style: normal;
	font-weight: 100 900;
	font-display: swap;
	src: url('assets/fonts/vazirmatn-variable.woff2') format('woff2');
}

/* Structural resets only. No colours, no decoration. */
:root {
	--dmhm-content-width: 1140px;
}

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

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

body {
	margin: 0;
	padding: 0;
	/* clip (not hidden) so position:sticky headers keep working. */
	overflow-x: clip;
}

.dmhm-site {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
}

.dmhm-site__main {
	flex: 1 0 auto;
}

/* Long unbroken strings never blow out the layout. */
.dmhm-entry__content,
.dmhm-entry__title {
	overflow-wrap: break-word;
}

/* Wide code and tables scroll inside the entry content only. */
.dmhm-entry__content pre {
	max-width: 100%;
	overflow-x: auto;
}

.dmhm-entry__content table {
	display: block;
	max-width: 100%;
	overflow-x: auto;
}

img,
svg,
video,
canvas,
iframe,
embed,
object {
	max-width: 100%;
	height: auto;
}

/* Default header/footer; a Theme Builder header/footer replaces them. */
.dmhm-site__header-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 16px;
	padding-block: 16px;
}

.dmhm-branding img,
.dmhm-branding .custom-logo {
	max-height: 56px;
	width: auto;
	height: auto;
}

.dmhm-branding__title {
	font-size: 1.4rem;
	font-weight: 700;
	text-decoration: none;
}

.dmhm-branding__desc {
	margin: 2px 0 0;
	font-size: 0.85rem;
	opacity: 0.7;
}

.dmhm-nav ul,
.dmhm-nav__menu {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 18px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.dmhm-nav li {
	list-style: none;
}

.dmhm-nav a {
	text-decoration: none;
}

.dmhm-site__footer {
	margin-block-start: 40px;
}

.dmhm-site__footer-inner {
	padding-block: 24px;
	text-align: center;
	font-size: 0.85rem;
	opacity: 0.8;
}

.dmhm-entry {
	margin-block-end: 40px;
}

.dmhm-entry__thumbnail {
	margin-block-end: 16px;
}

.dmhm-archive-header {
	margin-block-end: 30px;
}

.dmhm-footer-widgets {
	display: grid;
	gap: 30px;
	margin-block-end: 24px;
	text-align: start;
}

.dmhm-footer-widgets--cols-2 {
	grid-template-columns: repeat(2, 1fr);
}

.dmhm-footer-widgets--cols-3 {
	grid-template-columns: repeat(3, 1fr);
}

.dmhm-footer-widgets--cols-4 {
	grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 782px) {
	.dmhm-footer-widgets {
		grid-template-columns: 1fr;
	}
}

.dmhm-sidebar {
	margin-block-start: 40px;
}

.widget {
	margin-block-end: 30px;
}

.widget ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

/* Boxes non-Elementor content; Canvas and Full Width templates opt out. */
.dmhm-container {
	width: 100%;
	max-width: var(--dmhm-content-width, 1140px);
	margin-inline: auto;
	padding-inline: 20px;
}

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

.screen-reader-text:focus {
	background-color: #fff;
	clip-path: none;
	display: block;
	height: auto;
	inset-inline-start: 5px;
	padding: 15px 23px 14px;
	top: 5px;
	width: auto;
	z-index: 100000;
}

/* Skip link: clipped, never parked off-canvas (breaks RTL scroll). */
.skip-link {
	position: absolute;
	inset-inline-start: 0;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	z-index: 999999;
}

.skip-link:focus {
	width: auto;
	height: auto;
	clip-path: none;
	inset-inline-start: 6px;
	top: 6px;
	padding: 12px 20px;
	background: #fff;
}

/* Alignment classes required by the editor. */
.alignleft {
	float: left;
	margin-inline-end: 1.5em;
}

.alignright {
	float: right;
	margin-inline-start: 1.5em;
}

.aligncenter {
	display: block;
	margin-inline: auto;
}

/* WooCommerce structural safeguards. */
.woocommerce form .form-row {
	display: block;
	margin: 0 0 6px;
}

.woocommerce form .form-row label {
	display: block;
}

.woocommerce form .form-row input.input-text,
.woocommerce form .form-row textarea,
.woocommerce form .form-row select {
	width: 100%;
}

.woocommerce .woocommerce-message,
.woocommerce .woocommerce-info,
.woocommerce .woocommerce-error {
	display: block;
	list-style: none;
	margin: 0 0 1em;
	padding: 0;
}

/* Shop loop grid: follows the columns-N class WooCommerce prints. */
.woocommerce ul.products {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 30px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.woocommerce ul.products.columns-1 { grid-template-columns: 1fr; }
.woocommerce ul.products.columns-2 { grid-template-columns: repeat(2, 1fr); }
.woocommerce ul.products.columns-4 { grid-template-columns: repeat(4, 1fr); }
.woocommerce ul.products.columns-5 { grid-template-columns: repeat(5, 1fr); }
.woocommerce ul.products.columns-6 { grid-template-columns: repeat(6, 1fr); }

.woocommerce ul.products::before,
.woocommerce ul.products::after {
	content: none;
	display: none;
}

@media (max-width: 900px) {
	.woocommerce ul.products,
	.woocommerce ul.products[class*="columns-"] {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 560px) {
	.woocommerce ul.products,
	.woocommerce ul.products[class*="columns-"] {
		grid-template-columns: 1fr;
	}
}

/* Extra .type-product class lifts specificity over WooCommerce's own float width. */
.woocommerce ul.products li.product.type-product {
	width: 100%;
	max-width: 100%;
	margin: 0;
	float: none;
	clear: none;
	text-align: center;
}

.woocommerce ul.products li.product img {
	display: block;
	width: 100%;
	height: auto;
	margin: 0 0 14px;
}

.woocommerce div.product .woocommerce-product-gallery {
	max-width: 100%;
}
