/*
Theme Name: Emaux Child
Description: Child of Hello Elementor. Store-matching header, home sections and product cards for emaux-co.ir.
Template: hello-elementor
Version: 1.0.0
Text Domain: emaux-child
*/

@font-face {
  font-family: "Vazirmatn";
  src: url("assets/fonts/Vazirmatn-wght.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --e-900: #0a2e52;
  --e-700: #0b5391;
  --e-600: #0e68b3;
  --e-500: #1a7fd1;
  --e-100: #dbeefe;
  --e-50: #eff8ff;
}

body {
  font-family: Vazirmatn, Tahoma, sans-serif;
  background: #f8fafc;
  color: #1e293b;
}

.emaux-wrap { max-width: 1280px; margin: 0 auto; padding: 0 16px; }

/* Header */
.emaux-header { position: sticky; top: 0; z-index: 40; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.emaux-topbar { background: var(--e-900); color: #fff; font-size: 12px; }
.emaux-topbar .emaux-wrap { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-top: 8px; padding-bottom: 8px; }
.emaux-address { display: none; }
@media (min-width: 640px) { .emaux-address { display: inline; } }
.emaux-phone { color: #fff; font-weight: 700; text-decoration: none; }
.emaux-main { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 12px; padding-bottom: 12px; }
.emaux-logo { display: inline-flex; align-items: center; text-decoration: none; }
.emaux-logo img { display: block; height: 56px; width: auto; max-width: 220px; }
.emaux-logo span { font-size: 14px; font-weight: 500; color: #64748b; }
.emaux-nav { display: none; align-items: center; gap: 24px; font-size: 14px; font-weight: 500; }
@media (min-width: 1024px) { .emaux-nav { display: flex; } }
.emaux-nav > a, .emaux-dd-toggle { color: #1e293b; text-decoration: none; }
.emaux-nav a:hover { color: var(--e-600); }
.emaux-dd { position: relative; }
.emaux-dd-menu { display: none; position: absolute; right: 0; top: 100%; width: 256px; background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; padding: 8px; box-shadow: 0 10px 15px rgba(0,0,0,.1); z-index: 50; }
.emaux-dd:hover .emaux-dd-menu, .emaux-dd:focus-within .emaux-dd-menu { display: block; }
.emaux-dd-menu a { display: block; padding: 8px 12px; border-radius: 6px; color: #1e293b; text-decoration: none; }
.emaux-dd-menu a:hover { background: var(--e-50); }
.emaux-dd-menu { width: 280px; max-height: 70vh; overflow-y: auto; }
.emaux-dd-item { position: relative; }
.emaux-dd-row { display: flex; justify-content: space-between; align-items: center; }
.emaux-caret { color: #94a3b8; font-size: 12px; }
.emaux-dd-sub { display: none; position: absolute; right: 100%; top: 0; width: 280px; max-height: 70vh; overflow-y: auto; background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; padding: 8px; box-shadow: 0 10px 15px rgba(0,0,0,.1); }
.emaux-dd-item:hover > .emaux-dd-sub, .emaux-dd-item:focus-within > .emaux-dd-sub, .emaux-dd-item.is-open > .emaux-dd-sub { display: block; }
.emaux-dd.is-open .emaux-dd-menu { display: block; }
.emaux-dd-sub a { display: block; padding: 8px 12px; border-radius: 6px; color: #1e293b; text-decoration: none; }
.emaux-dd-sub a:hover { background: var(--e-50); }
.emaux-mnav-sub { padding-right: 12px; color: #475569; font-size: 13px; }

/* Footer (original store footer) */
.emaux-footer { margin-top: 64px; background: var(--e-900); color: #e2e8f0; }
.emaux-footer-grid { display: grid; gap: 32px; padding-top: 40px; padding-bottom: 40px; grid-template-columns: 1fr; }
@media (min-width: 768px) { .emaux-footer-grid { grid-template-columns: repeat(3, 1fr); } }
.emaux-footer-title { color: #fff; font-size: 18px; font-weight: 700; margin: 0 0 12px; }
.emaux-footer-text { font-size: 14px; line-height: 2; margin: 0 0 8px; }
.emaux-footer-text a, .emaux-footer-list a { color: #e2e8f0; text-decoration: none; }
.emaux-footer-text a:hover, .emaux-footer-list a:hover { color: #fff; }
.emaux-footer-list { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.emaux-footer-list li { margin-bottom: 8px; }
.emaux-footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding: 16px; text-align: center; font-size: 12px; }

/* Visible categories bar (desktop) */
.emaux-catbar { display: none; background: var(--e-50); border-top: 1px solid #e2e8f0; }
@media (min-width: 1024px) { .emaux-catbar { display: block; } }
.emaux-catbar-inner { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; padding-top: 4px; padding-bottom: 4px; }
.emaux-cb-item { position: relative; }
.emaux-cb-link { display: block; padding: 8px 12px; border-radius: 6px; color: #0b5391; font-size: 14px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.emaux-cb-link:hover { background: #fff; color: var(--e-600); }
.emaux-cb-sub { display: none; position: absolute; right: 0; top: 100%; min-width: 230px; background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; padding: 6px; box-shadow: 0 10px 15px rgba(0,0,0,.12); z-index: 60; }
.emaux-cb-item:hover > .emaux-cb-sub { display: block; }
.emaux-cb-sub a { display: block; padding: 8px 12px; border-radius: 6px; color: #1e293b; font-size: 14px; text-decoration: none; white-space: nowrap; }
.emaux-cb-sub a:hover { background: var(--e-50); color: var(--e-600); }
.emaux-tools { display: flex; align-items: center; gap: 8px; }
.emaux-search { display: none; }
@media (min-width: 1024px) { .emaux-search { display: flex; } }
.emaux-search input { width: 256px; border: 1px solid #e2e8f0; border-radius: 8px; padding: 8px 12px; font: inherit; font-size: 14px; }
.emaux-tel-btn { background: var(--e-600); color: #fff; border-radius: 8px; padding: 8px 16px; font-weight: 700; font-size: 14px; text-decoration: none; white-space: nowrap; }
.emaux-tel-btn:hover { background: var(--e-700); }
.emaux-cart { color: #1e293b; text-decoration: none; padding: 6px; font-size: 18px; }
.emaux-mnav { display: flex; gap: 16px; overflow-x: auto; border-top: 1px solid #f1f5f9; padding: 8px 16px; font-size: 14px; }
.emaux-mnav a { white-space: nowrap; color: #1e293b; text-decoration: none; }
@media (min-width: 1024px) { .emaux-mnav { display: none; } }

/* Hero */
.emaux-hero { background: linear-gradient(to left, var(--e-900), var(--e-600)); color: #fff; text-align: center; padding: 64px 16px; }
@media (min-width: 768px) { .emaux-hero { padding: 96px 16px; } }
.emaux-hero h1 { font-size: 30px; font-weight: 800; line-height: 1.5; margin: 0; color: #fff; }
@media (min-width: 768px) { .emaux-hero h1 { font-size: 48px; } }
.emaux-hero p { max-width: 672px; margin: 16px auto 0; line-height: 2; color: var(--e-100); }
.emaux-hero-actions { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.emaux-btn-light { background: #fff; color: var(--e-700); border-radius: 8px; padding: 12px 24px; font-weight: 700; text-decoration: none; }
.emaux-btn-light:hover { background: var(--e-50); }
.emaux-btn-outline { border: 1px solid #fff; color: #fff; border-radius: 8px; padding: 12px 24px; font-weight: 700; text-decoration: none; }
.emaux-btn-outline:hover { background: rgba(255,255,255,.1); }

/* Sections */
.emaux-section { padding: 48px 0; }
.emaux-h2 { font-size: 24px; font-weight: 700; margin: 0 0 24px; color: #1e293b; }
.emaux-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.emaux-head .emaux-h2 { margin: 0; }
.emaux-more { color: var(--e-600); font-size: 14px; text-decoration: none; }

/* Categories */
.emaux-cats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
@media (min-width: 768px) { .emaux-cats { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1024px) { .emaux-cats { grid-template-columns: repeat(6, 1fr); } }
.emaux-cat { display: flex; flex-direction: column; align-items: center; gap: 8px; background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 20px; text-align: center; text-decoration: none; color: #1e293b; }
.emaux-cat:hover { border-color: var(--e-500); box-shadow: 0 4px 6px rgba(0,0,0,.08); }
.emaux-cat-icon { font-size: 30px; }
.emaux-cat-name { font-size: 14px; font-weight: 700; }
.emaux-cat-count { font-size: 12px; color: #64748b; }

/* Product cards */
.emaux-grid { display: grid; gap: 16px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 768px) { .emaux-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1024px) { .emaux-grid { grid-template-columns: repeat(4, 1fr); } }

/* Articles: list (index.php) and single article (single.php) */
.emaux-archive-title { max-width: 1280px; margin: 24px auto 0; padding: 0 16px; font-size: 26px; font-weight: 800; }
.emaux-article-grid { display: grid; grid-template-columns: 1fr; gap: 16px; max-width: 1280px; margin: 0 auto; padding: 24px 16px; }
@media (min-width: 768px) { .emaux-article-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .emaux-article-grid { grid-template-columns: repeat(3, 1fr); } }
.emaux-article-card { display: flex; flex-direction: column; background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; overflow: hidden; }
.emaux-article-img { display: block; aspect-ratio: 16 / 9; background: #e2e8f0; overflow: hidden; }
.emaux-article-img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.emaux-article-body { display: flex; flex: 1; flex-direction: column; gap: 12px; padding: 14px; }
.emaux-article-title { font-size: 16px; font-weight: 700; line-height: 1.8; margin: 0; }
.emaux-article-title a { color: #1e293b; text-decoration: none; }
.emaux-article-body .emaux-btn-sm { margin-top: auto; }
.emaux-article-pagination { max-width: 1280px; margin: 0 auto; padding: 0 16px 32px; }
.emaux-single { max-width: 900px; margin: 0 auto; padding: 24px 16px 48px; }
.emaux-single-title { font-size: 28px; font-weight: 800; line-height: 1.6; margin: 0 0 16px; }
.emaux-single-img img { display: block; width: 100%; height: auto; border-radius: 12px; margin-bottom: 20px; }
.emaux-single-content { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 24px; font-size: 16px; line-height: 2.1; color: #334155; }
.emaux-single-content img { max-width: 100%; height: auto; border-radius: 8px; }
.emaux-single-back { display: inline-block; width: auto; margin-top: 20px; padding: 10px 20px; }

/* Articles list page (posts index): 3 columns on desktop (legacy) */
body.blog .site-main { max-width: 1280px; margin: 0 auto; padding: 24px 16px; }
body.blog .page-content { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 768px) { body.blog .page-content { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { body.blog .page-content { grid-template-columns: repeat(3, 1fr); } }
body.blog .page-content > :not(article) { grid-column: 1 / -1; }
body.blog article.post { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; overflow: hidden; padding-bottom: 12px; }
body.blog article.post img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; height: auto; }
body.blog article.post .entry-title { font-size: 16px; line-height: 1.8; margin: 8px 12px; }
body.blog article.post .entry-content, body.blog article.post .post-content { margin: 0 12px; font-size: 14px; line-height: 2; }
.emaux-card { display: flex; flex-direction: column; background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; overflow: hidden; transition: box-shadow .2s; }
.emaux-card:hover { box-shadow: 0 10px 15px rgba(0,0,0,.1); }
.emaux-card-link { display: flex; flex: 1; flex-direction: column; text-decoration: none; color: inherit; }
.emaux-card-img { position: relative; aspect-ratio: 1 / 1; background: #fff; display: flex; align-items: center; justify-content: center; padding: 16px; }
.emaux-img { max-width: 100%; max-height: 100%; object-fit: contain; height: auto; }
.emaux-card-body { display: flex; flex: 1; flex-direction: column; gap: 4px; border-top: 1px solid #e2e8f0; padding: 12px; }
.emaux-card-cat { font-size: 12px; color: var(--e-600); }
.emaux-card-title { font-size: 14px; font-weight: 700; line-height: 1.6; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.emaux-sku { font-size: 12px; color: #64748b; }
.emaux-price { margin-top: auto; padding-top: 8px; font-size: 14px; font-weight: 700; color: var(--e-700); }
.emaux-card-cta { padding: 0 12px 12px; }
.emaux-btn-sm { display: block; text-align: center; background: var(--e-600); color: #fff; border-radius: 8px; padding: 8px; font-size: 13px; font-weight: 700; text-decoration: none; }
.emaux-btn-sm:hover { background: var(--e-700); color: #fff; }

/* Why Emaux */
.emaux-feats { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 768px) { .emaux-feats { grid-template-columns: repeat(4, 1fr); } }
.emaux-feat { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 20px; }
.emaux-feat h3 { margin: 0 0 4px; color: var(--e-700); font-size: 18px; font-weight: 700; }
.emaux-feat p { margin: 0; font-size: 14px; line-height: 2; color: #475569; }

/* Articles */
.emaux-posts { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 768px) { .emaux-posts { grid-template-columns: repeat(3, 1fr); } }
.emaux-post { display: block; background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; overflow: hidden; text-decoration: none; color: inherit; }
.emaux-post:hover { box-shadow: 0 10px 15px rgba(0,0,0,.1); }
.emaux-post-img { aspect-ratio: 16 / 9; position: relative; overflow: hidden; background: #e2e8f0; }
.emaux-post-img img { width: 100%; height: 100%; object-fit: cover; }
.emaux-post-body { padding: 16px; }
.emaux-post-date { font-size: 12px; color: #64748b; }
.emaux-post-title { font-size: 16px; font-weight: 700; line-height: 1.8; margin: 4px 0; color: #1e293b; }
.emaux-post-ex { font-size: 14px; line-height: 2; color: #475569; margin: 4px 0 0; }

/* About text blocks (home page) */
.emaux-about { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 28px; }
.emaux-about p { font-size: 16px; line-height: 2.2; color: #334155; margin: 0 0 14px; }
.emaux-about p:last-child { margin-bottom: 0; }
