/* ====================================================================
   فایل CSS بازطراحی ایران مهر
   این فایل باید در مسیر: /images/iranmohr-style.css روی سرور قرار بگیرد
   (یا هر مسیر دیگری که ترجیح می‌دهید — فقط باید با مسیر لینک‌شده در
   فایل تمپلیت اصلی (template-index-redesigned.php) یکی باشد)

   ---------------------------------------------------------------
   تغییرات این نسخه:
   فیکس مشکل "زوم/کراپ‌شدگی عکس هیرو در موبایل" —
   ارتفاع ثابت پیکسلی .ihero در موبایل با aspect-ratio جایگزین شد
   و انیمیشن Ken Burns در موبایل غیرفعال شد.
   ==================================================================== */

*, *::before, *::after { box-sizing: border-box; }

@font-face {
    font-family: 'Vazirmatn';
    src: url('/images/fonts/Vazirmatn-Light.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Vazirmatn';
    src: url('/images/fonts/Vazirmatn-RD-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* ---------- Design tokens: رنگ برند واقعی (قرمز ایران‌مهر) ---------- */
:root {
    --c-primary: #d81f26;
    --c-primary-dark: #a8151b;
    --c-primary-light: #fdecec;
    --c-text: #232323;
    --c-text-light: #6b7280;
    --c-bg: #ffffff;
    --c-bg-alt: #f6f7f9;
    --c-border: #e6e6e6;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,.06);
    --shadow-md: 0 6px 20px rgba(0,0,0,.08);
    --header-h: 68px;
}

html { scroll-behavior: smooth; }

body, td, th, input, select, textarea, button, a, span, div, p, font {
    font-family: 'Vazirmatn', Tahoma, sans-serif !important;
    color: var(--c-text);
}

body {
    margin: 0;
    background: var(--c-bg-alt);
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; }
a { text-decoration: none; }

.rwd-wrap {
    width: 100%;
    max-width: 1360px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ==================== هدر جدید ==================== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 500;
    background: #fff;
    box-shadow: var(--shadow-sm);
}

.header-topbar {
    background: var(--c-primary-dark);
}
.header-topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 34px;
    font-size: 12.5px;
}
.header-topbar a { color: #fff; opacity: .92; }
.header-topbar a:hover { opacity: 1; text-decoration: underline; }
.phone-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #fff !important;
    font-weight: 700;
    direction: ltr;
}
.topbar-tagline { opacity: .85; font-size: 12px; }

.header-main-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 12px 0;
    flex-wrap: wrap;
}
.header-logo { flex: none; }
.header-logo img {
    display: block;
    height: 80px;
    width: auto;
}

.header-search {
    flex: 1 1 auto;
    max-width: 460px;
}
.header-search form {
    display: flex;
    align-items: center;
    background: var(--c-bg-alt);
    border: 1.5px solid var(--c-border);
    border-radius: 999px;
    padding: 4px 6px 4px 4px;
    transition: border-color .15s;
}
.header-search form:focus-within {
    border-color: var(--c-primary);
}
.header-search input[type="text"] {
    flex: 1;
    border: 0;
    background: transparent;
    outline: none;
    font-size: 14px;
    padding: 8px 10px;
}
.header-search button {
    border: 0;
    background: var(--c-primary);
    color: #fff;
    border-radius: 999px;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex: none;
}
.header-search button:hover { background: var(--c-primary-dark); }

.header-ad-banner {
    flex: 0 1 300px;
    text-align: center;
}
.header-ad-banner img {
    border-radius: var(--radius-md);
    max-height: 64px;
    width: auto;
    box-shadow: var(--shadow-sm);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: none;
}
.header-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 11.5px;
    color: var(--c-text) !important;
}
.header-action-btn:hover { background: var(--c-bg-alt); }
.header-action-btn svg { width: 22px; height: 22px; stroke: var(--c-text); }

/* ---------- ناوبری اصلی (تبدیل لینک‌های | جداشده به منوی pill) ---------- */
.main-nav-wrap {
    background: var(--c-primary);
}
.main-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    height: 44px;
    overflow-x: auto;
    scrollbar-width: none;
}
.main-nav::-webkit-scrollbar { display: none; }
.main-nav a {
    color: #fff !important;
    font-size: 13.5px;
    white-space: nowrap;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    opacity: .95;
}
.main-nav a:hover,
.main-nav a.is-active {
    background: rgba(255,255,255,.16);
    opacity: 1;
}
.main-nav a b { font-weight: 700; }

/* ==================== محتوای اصلی ==================== */
.page-body {
    max-width: 1360px;
    margin: 20px auto;
    padding: 0 16px;
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 20px;
    align-items: start;
}

.hero-banner {
    text-align: center;
    margin-bottom: 18px;
}
.hero-banner img {
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.content-card {
    background: #fff;
    border: 1px solid var(--c-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}
.content-inner {
    max-width: 100%;
    line-height: 1.9;
    font-size: 15px;
}

/* ---------- سایدبار ---------- */
.sidebar-col { display: flex; flex-direction: column; gap: 16px; }

.side-card {
    background: #fff;
    border: 1px solid var(--c-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.side-card-header {
    display: block;
    background: var(--c-primary-light);
    color: var(--c-primary-dark) !important;
    text-align: center;
    padding: 10px 0;
    font-weight: 700;
    font-size: 14px;
    border-bottom: 1px solid var(--c-border);
}
.side-card-header:hover { background: #fbdcdc; }
.side-card-body { padding: 16px; }

.login-form-modern label {
    display: block;
    font-size: 12.5px;
    color: var(--c-text-light);
    margin-bottom: 4px;
    font-weight: 600;
}
.login-form-modern .field { margin-bottom: 12px; }
.login-form-modern input[type="text"],
.login-form-modern input[type="password"] {
    width: 100%;
    padding: 9px 10px;
    border: 1.5px solid var(--c-border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    outline: none;
}
.login-form-modern input:focus {
    border-color: var(--c-primary);
}
.login-submit-wrap { text-align: center; margin-top: 10px; }
.login-submit-wrap input[type="image"] { height: 34px; }

.side-links {
    display: flex;
    justify-content: space-between;
    margin-top: 12px;
    font-size: 12.5px;
}
.side-links a { color: var(--c-primary-dark) !important; }
.side-links a:hover { text-decoration: underline; }

.news-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 700;
    margin: 0 0 10px;
}
.news-item {
    display: flex;
    gap: 6px;
    align-items: flex-start;
    font-size: 13px;
    line-height: 1.8;
    padding: 6px 0;
    border-bottom: 1px dashed var(--c-border);
}
.news-item:last-child { border-bottom: 0; }
.news-item img { margin-top: 4px; flex: none; }

.trust-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    padding: 14px;
}
.trust-badges img { max-height: 80px; width: auto; }

/* ==================== فوتر ==================== */
.site-footer {
    background: #fff;
    border-top: 1px solid var(--c-border);
    margin-top: 24px;
    padding: 18px 0;
    text-align: center;
    font-size: 13px;
    color: var(--c-text-light);
}
.site-footer a { color: var(--c-primary-dark) !important; }
.footer-credit { font-size: 12px; margin-top: 8px; }

/* ==================== ناوبری پایین موبایل ==================== */
.mobile-bottom-nav {
    display: none;
}

/* ==================== موبایل ==================== */
@media (max-width: 800px) {
    .page-body {
        grid-template-columns: 1fr;
        margin: 14px auto;
    }
    .header-main-inner { padding: 10px 0; }
    .header-logo img { height: 42px; }
    .header-actions .header-action-btn span { display: none; }
    .header-search { order: 3; flex: 1 1 100%; }
    .header-ad-banner { display: none; }
    .header-topbar-inner { font-size: 11px; }
    .topbar-tagline { display: none; }

    .content-card { padding: 16px; border-radius: var(--radius-md); }

    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        right: 0;
        left: 0;
        z-index: 600;
        background: #fff;
        border-top: 1px solid var(--c-border);
        box-shadow: 0 -4px 14px rgba(0,0,0,.06);
        padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    }
    .mobile-bottom-nav a {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2px;
        font-size: 10.5px;
        color: var(--c-text) !important;
        padding: 4px 0;
        border-radius: var(--radius-sm);
    }
    .mobile-bottom-nav a svg { width: 22px; height: 22px; stroke: var(--c-text-light); }
    .mobile-bottom-nav a.active,
    .mobile-bottom-nav a.active svg { color: var(--c-primary) !important; stroke: var(--c-primary); }

    .site-footer { padding-bottom: 96px; }
}
/* =========================================================
   Homepage Sections
========================================================= */

.home-intro{
    background:#fff;
    border:1px solid var(--c-border);
    border-radius:var(--radius-lg);
    padding:40px 30px;
    text-align:center;
    margin-bottom:24px;
    box-shadow:var(--shadow-sm);
}

.home-title{
    font-size:32px;
    line-height:1.5;
    margin:0 0 18px;
    color:var(--c-primary-dark);
    font-weight:700;
}

.home-lead{
    max-width:760px;
    margin:0 auto 28px;
    font-size:16px;
    line-height:2;
    color:var(--c-text-light);
}

.home-buttons{
    display:flex;
    justify-content:center;
    gap:15px;
    flex-wrap:wrap;
}

.btn-main,
.btn-second{
    display:inline-block;
    padding:13px 28px;
    border-radius:40px;
    transition:.25s;
    font-weight:700;
}

.btn-main{
    background:var(--c-primary);
    color:#fff !important;
}

.btn-main:hover{
    background:var(--c-primary-dark);
    transform:translateY(-2px);
}

.btn-second{
    background:#fff;
    border:2px solid var(--c-primary);
    color:var(--c-primary) !important;
}

.btn-second:hover{
    background:var(--c-primary-light);
}

/* ================= دسته بندی ================= */

.category-section{
    margin:35px 0;
}

.category-section h2{
    text-align:center;
    font-size:28px;
    margin-bottom:10px;
}

.category-desc{
    text-align:center;
    color:var(--c-text-light);
    margin-bottom:25px;
}

.category-grid{

    display:grid;

    grid-template-columns:
    repeat(auto-fit,minmax(240px,1fr));

    gap:22px;

}

.category-card{

    background:#fff;

    border-radius:var(--radius-lg);

    overflow:hidden;

    border:1px solid var(--c-border);

    transition:.25s;

    box-shadow:var(--shadow-sm);

}

.category-card:hover{

    transform:translateY(-6px);

    box-shadow:var(--shadow-md);

}

.category-card img{

    width:100%;

    height:220px;

    object-fit:cover;

    display:block;

}

.category-card h3{

    font-size:20px;

    margin:18px 18px 10px;

}

.category-card p{

    margin:0 18px 18px;

    line-height:1.9;

    color:var(--c-text-light);

    min-height:68px;

}

.category-link{

    display:block;

    margin:0 18px 22px;

    color:var(--c-primary);

    font-weight:700;

}

/* ================= سایر بخش ها ================= */

.about-company,
.products-overview,
.brands-section,
.agency-section,
.services-section,
.why-buy,
.contact-short{

    background:#fff;

    border:1px solid var(--c-border);

    border-radius:var(--radius-lg);

    padding:28px;

    margin-bottom:24px;

    box-shadow:var(--shadow-sm);

}

.about-company h2,
.products-overview h2,
.brands-section h2,
.agency-section h2,
.services-section h2,
.why-buy h2,
.contact-short h2{

    margin-top:0;

    color:var(--c-primary-dark);

    font-size:26px;

}

.about-company p,
.products-overview p,
.brands-section p,
.agency-section p,
.services-section p,
.contact-short p{

    line-height:2;

    color:var(--c-text);

}

.about-company ul,
.why-buy ul,
.brands-section ul{

    margin:20px 0 0;

    padding:0;

    list-style:none;

}

.about-company li,
.why-buy li,
.brands-section li{

    padding:10px 0;

    border-bottom:1px dashed var(--c-border);

}

.about-company li:last-child,
.why-buy li:last-child,
.brands-section li:last-child{

    border-bottom:none;

}

/* ================= موبایل ================= */

@media(max-width:800px){

.home-title{

font-size:24px;

}

.home-lead{

font-size:15px;

}

.category-grid{

grid-template-columns:1fr;

}

.category-card img{

height:190px;

}

.about-company,
.products-overview,
.brands-section,
.agency-section,
.services-section,
.why-buy,
.contact-short{

padding:20px;

}

}
/* ================= شروع هیرو ================= */
.ihero {
  position: relative;
  width: 100%;
  height: 450px;
  overflow: hidden;
  direction: rtl;
}

.ihero-track {
  position: relative;
  width: 100%;
  height: 100%;
}

.ihero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 1s ease;
}

.ihero-slide.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  z-index: 2;
}

.ihero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: scale(1);
  animation: ihero-kenburns 8s ease-out forwards;
  will-change: transform;
}

@keyframes ihero-kenburns {
  from { transform: scale(1); }
  to   { transform: scale(1.08); }
}

.ihero-overlay{
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    90deg,
    rgba(255,255,255,.98) 0%,
    rgba(255,255,255,.92) 32%,
    rgba(255,255,255,.40) 50%,
    rgba(255,255,255,0) 68%
  );
}

.ihero-content{
    position:absolute;
    top:50%;
    left:80px;
    right:auto;
    transform:translateY(-50%);

    width:420px;
    max-width:420px;

    height:auto;

    display:flex;
    flex-direction:column;
    justify-content:center;
    align-items:flex-start;

    padding:0;
    margin:0;

    text-align:right;

    z-index:10;
}
.ihero-title {
  font-size: 44px;
  font-weight: 800;
  color: #111;
  line-height: 1.3;
  margin: 0 0 18px;
  opacity: 0;
  transform: translateY(24px);
}

.ihero-text {
    
  font-size: 18px;
  color: #555;
  line-height: 1.8;
  margin: 0 0 28px;
  opacity: 0;
}

.ihero-list {
     list-style: none;
  margin: 0 0 28px;
   padding-right: 250px;
  opacity: 0;
}

.ihero-list li {
  position: relative;
  padding-right: 30px;
  margin-bottom: 12px;
  font-size: 17px;
  color: #555;
  line-height: 1.8;
}

.ihero-list li::before {
  content: "";
  position: absolute;
  right: 0;
  top: 6px;
  width: 18px;
  height: 18px;
  background: #d81f26;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center / contain no-repeat;
}

.ihero-actions {
  display: flex;
  gap: 16px;
  opacity: 0;
  transform: scale(0.94);
}

.ihero-btn {
  display: inline-block;
  padding: 16px 34px;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  transition: background-color .25s ease, color .25s ease, box-shadow .25s ease, transform .2s ease;
  white-space: nowrap;
}

.ihero-btn-primary {
  background: #d81f26;
  color: #fff !important;
  box-shadow: 0 8px 20px rgba(216,31,38,0.28);
}

.ihero-btn-primary:hover {
  background: #b81b21;
  transform: translateY(-2px);
}

.ihero-btn-secondary {
  background: #fff;
  color: #d81f26 !important;
  border: 2px solid #d81f26;
}

.ihero-btn-secondary:hover {
  background: #fdeceb;
  transform: translateY(-2px);
}

/* انیمیشن ورود عناصر هر اسلاید فعال */
.ihero-slide.is-active .ihero-title {
  animation: ihero-fade-up .8s ease .15s forwards;
}
.ihero-slide.is-active .ihero-text,
.ihero-slide.is-active .ihero-list {
  animation: ihero-fade .8s ease .4s forwards;
}
.ihero-slide.is-active .ihero-actions {
  animation: ihero-fade-scale .6s ease .6s forwards;
}

@keyframes ihero-fade-up {
  to { opacity: 1; transform: translateY(0); }
}
@keyframes ihero-fade {
  to { opacity: 1; }
}
@keyframes ihero-fade-scale {
  to { opacity: 1; transform: scale(1); }
}

/* فلش‌ها */
.ihero-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 4;
  width: 46px;
  height: 46px;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,0.85);
  color: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,0.12);
  transition: background-color .2s ease, transform .2s ease;
}

.ihero-arrow:hover {
  background: #fff;
  transform: translateY(-50%) scale(1.08);
}

.ihero-arrow-prev { left: 24px; }
.ihero-arrow-next { right: 24px; }

/* نقطه‌ها */
.ihero-dots {
  position: absolute;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  display: flex;
  gap: 10px;
}

.ihero-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: none;
  background: rgba(17,17,17,0.25);
  cursor: pointer;
  padding: 0;
  transition: background-color .25s ease, transform .25s ease;
}

.ihero-dot.is-active {
  background: #d81f26;
  transform: scale(1.2);
}

/* ================================================================
   Responsive - نسخه اصلاح‌شده (فیکس زوم/کراپ‌شدگی عکس هیرو در موبایل)

   علت مشکل قبلی: ارتفاع .ihero ثابت و پیکسلی بود (420px) درحالی‌که
   عکس هیرو خیلی wide است (1920x700 ≈ نسبت 2.74:1). روی موبایل که
   عرض باکس کم می‌شود ولی ارتفاع ثابت می‌ماند، object-fit: cover
   مجبور می‌شود عکس را شدیداً بزرگ کند تا کل ارتفاع را پر کند -
   نتیجه‌اش این بود که فقط حدود ۳۰٪ از عرض واقعی عکس دیده می‌شد
   (حس زوم‌شدگی/کراپ شدید).

   فیکس: به‌جای height ثابت از aspect-ratio استفاده شد تا ارتفاع
   باکس متناسب با عرض صفحه کوچک شود (نسبت نمایش عکس از ~30٪ به
   ~55٪ بهبود پیدا می‌کند) + انیمیشن Ken Burns در موبایل غیرفعال
   شد چون روی عکس از قبل کراپ‌شده حس زوم را تشدید می‌کرد.
   ================================================================ */
@media (max-width: 768px) {
  .ihero {
    height: auto;
    aspect-ratio: 3 / 2;   /* به‌جای ارتفاع ثابت 420px */
    min-height: 230px;
    max-height: 320px;
  }

  .ihero-bg {
    animation: none;        /* حذف زوم Ken Burns در موبایل */
    object-position: center 45%;
  }

  .ihero-overlay {
    background: linear-gradient(180deg, rgba(255,255,255,0.25) 0%, rgba(255,255,255,0.9) 62%, rgba(255,255,255,0.98) 100%);
  }

  .ihero-content {
    max-width: 100%;
    align-items: center;
    text-align: center;
    padding: 0 20px;
  }

  .ihero-title {
    font-size: 20px;
    margin-bottom: 10px;
  }

  .ihero-text {
    font-size: 13px;
    margin-bottom: 14px;
  }

  .ihero-list {
    padding-right: 0;
    margin-bottom: 14px;
  }

  .ihero-list li {
    font-size: 13px;
    padding-right: 22px;
    margin-bottom: 6px;
  }

  .ihero-actions {
    flex-direction: column;
    width: 100%;
    gap: 8px;
  }

  .ihero-btn {
    width: 100%;
    text-align: center;
    padding: 11px 16px;
    font-size: 13.5px;
  }

  .ihero-arrow {
    width: 32px;
    height: 32px;
  }

  .ihero-arrow-prev { left: 8px; }
  .ihero-arrow-next { right: 8px; }

  .ihero-dots {
    bottom: 10px;
  }
}