/* ============================================
   همیار گرافیک — طراحی مینیمال و حرفه‌ای
   ============================================ */

:root {
    --e-global-color-primary: #E5AA08;
    --e-global-color-secondary: #818080;
    --e-global-color-text: #111827;
    --e-global-color-accent: #d3a410;
    --font-vazir: 'Vazir', Tahoma, Arial, sans-serif;
    /* سایه‌های نرم و مینیمال */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.1);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
}

body {
    font-family: var(--font-vazir);
    color: #111827;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ---- هیرو مرجع: پس‌زمینه سفید، نوار جستجو ---- */
.hero-reference {
    margin-top: 0;
    background: #fff;
}

.hero-reference-title {
    letter-spacing: -0.02em;
}
/* هیرو جستجو مینیمال: باکس کوچک، دکمه بیرون با فاصله */
.hero-search-minimal .hero-search-category-minimal {
    min-width: 110px;
}
[dir="rtl"] .hero-search-minimal .hero-search-category-minimal {
    background-position: left 0.5rem center;
}

/* ---- هیرو قدیمی (در صورت استفاده) ---- */
.hero-section {
    margin-top: 0;
    background: linear-gradient(165deg, #b78806 0%, #956f05 50%, #735504 100%);
}
.hero-dots-pattern {
    background-image: radial-gradient(circle at 2px 2px, rgba(255,255,255,0.08) 1px, transparent 0);
    background-size: 32px 32px;
}
.hero-title { font-weight: 800; letter-spacing: -0.02em; }
.hero-subtitle { opacity: 0.92; }
.hero-search-input { box-shadow: var(--shadow-sm); }
.hero-search-input:focus { box-shadow: var(--shadow-sm), 0 0 0 3px rgba(229, 170, 8, 0.2); }
.hero-search-btn { box-shadow: var(--shadow-xs); }

/* ---- کارت محصول: مینیمال (صفحات لیست محصولات) ---- */
.product-card {
    border-radius: var(--radius-lg);
    border: 1px solid #e5e7eb;
    box-shadow: var(--shadow-xs);
    transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.product-card:hover {
    box-shadow: var(--shadow-md);
    border-color: #f5dd9c;
    transform: translateY(-2px);
}
.product-card-image-wrap {
    height: 240px;
    background: #f9fafb;
}
.product-preview-overlay {
    display: none;
    position: absolute;
    inset: 0;
    background: rgba(17, 24, 39, 0.6);
    color: white;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    backdrop-filter: blur(4px);
}
.product-card:hover .product-preview-overlay {
    display: flex;
}
.img-placeholder-watermark {
    font-size: 0.8125rem;
    color: #9ca3af;
}

/* ---- کارت محصول صفحه اصلی (جدید، حرفه‌ای) ---- */
.product-card-home {
    transition: box-shadow 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}
.product-card-home:hover {
    transform: translateY(-4px);
}
.product-card-home-image {
    min-height: 200px;
}
.product-card-home-title {
    letter-spacing: -0.01em;
}

/* ---- صفحه اصلی: هیرو و فرم جستجو ---- */
.home-hero-select {
    appearance: none;
    background-repeat: no-repeat;
    background-size: 12px;
    background-position: right 0.75rem center;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
}
[dir="rtl"] .home-hero-select {
    background-position: left 0.75rem center;
}

/* پیش‌نمایش جستجو هیرو (دراپ‌داون زیر اینپوت) */
.hero-search-wrap {
    position: relative;
}
.hero-search-preview-dropdown {
    max-height: min(85vh, 420px);
    overflow-y: auto;
}
.hero-search-preview-dropdown:not(.hidden) .hero-search-preview-loading:not(.hidden) {
    display: flex !important;
}
.hero-search-preview .scrollbar-thin {
    scrollbar-width: thin;
}
.hero-search-preview a:hover {
    text-decoration: none;
}
/* بالا: لیست محصولات اسکرول، پایین: دسته و تگ ۵۰-۵۰ ثابت */
.hero-search-preview .hero-search-preview-products {
    display: flex;
    flex-direction: column;
}
.hero-search-preview .hero-search-products-list {
    max-height: 220px;
    overflow-y: auto;
    scrollbar-width: thin;
}
.hero-search-preview .hero-search-products-list::-webkit-scrollbar {
    width: 6px;
}
.hero-search-preview .hero-search-products-list::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}
.hero-search-preview .hero-search-products-list::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}
.hero-search-preview .grid.grid-cols-2 {
    flex-shrink: 0;
}

/* ---- صفحه اصلی: بخش جدیدترین محصولات (هدر یک خط) ---- */
.home-products-header-one {
    flex-wrap: wrap;
}
.home-products-title {
    letter-spacing: -0.02em;
}
.home-products-view-all-btn {
    margin-inline-start: auto;
}
.home-products-view-all-btn:hover {
    color: #fff;
}
.home-toolbar-select {
    min-width: 140px;
}
.home-filter-btn.home-filter-active {
    border-color: var(--e-global-color-primary);
    background: var(--e-global-color-primary);
    color: #fff;
}
.home-filter-btn.home-filter-active:hover {
    background: #b78806;
    border-color: #b78806;
    color: #fff;
}
.home-cta-btn {
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.home-cta-btn:hover {
    transform: translateY(-1px);
}
.home-categories-track {
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.home-categories-track::-webkit-scrollbar {
    display: none;
}

/* ---- اسلایدر دسته‌بندی‌ها ---- */
.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

/* در RTL جهت فلش‌های دسترسی سریع و تقویم درست شود */
[dir="rtl"] .home-quick-prev svg,
[dir="rtl"] .home-quick-next svg,
[dir="rtl"] .home-calendar-prev svg,
[dir="rtl"] .home-calendar-next svg {
    transform: scaleX(-1);
}

/* ---- تایپوگرافی سکشن‌ها ---- */
.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #111827;
}
.section-subtitle {
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 0.25rem;
}
.link-arrow {
    font-size: 0.875rem;
    font-weight: 600;
    color: #b78806;
}
.link-arrow:hover {
    color: #956f05;
}

/* ---- هدر سکشن مثل تصویر مرجع: عنوان + آیکون راست، مشاهده همه + فلش‌ها چپ ---- */
.section-header-ref-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #374151;
    margin: 0;
}
.section-header-ref-icon-box {
    flex-shrink: 0;
}
.btn-view-all {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #b78806;
    background: #fff;
    border: 2px solid #f5dd9c;
    border-radius: 9999px;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.btn-view-all:hover {
    background: #fefbf3;
    color: #735504;
    border-color: #E5AA08;
}
.section-header-ref-arrows .section-header-arrow {
    flex-shrink: 0;
}

/* ---- دکمه‌های ثانویه (فیلتر / تب) ---- */
.btn-outline-minimal {
    border: 1px solid #e5e7eb;
    border-radius: var(--radius-md);
    font-size: 0.8125rem;
    font-weight: 500;
    color: #374151;
    background: #fff;
    transition: border-color 0.2s, background 0.2s, color 0.2s;
}
.btn-outline-minimal:hover,
.btn-outline-minimal.active {
    border-color: #f5dd9c;
    background: #fefbf3;
    color: #735504;
}

/* ---- هدر و منو ---- */
.header-two-rows {
    box-shadow: var(--shadow-xs);
    border-bottom: 1px solid #f3f4f6;
}
.header-menu-bar {
    background: #fafafa;
    border-top: 1px solid #f3f4f6;
}
.header-menu-bar .nav-link {
    font-size: 0.8125rem;
    font-weight: 500;
    color: #4b5563;
}
.header-menu-bar .nav-link:hover,
.header-menu-bar .category-item a:hover {
    color: #b78806;
}
.header-future-features .flex.items-center.rounded-xl {
    max-width: 100%;
}
.header-future-features > div > div:hover {
    color: #111827;
}

/* ---- نوار منوی ادمین: فاصله از هدر سایت ---- */
.admin-nav-bar {
    /* هدر دو ردیف: h-14 + h-10 ≈ 96px؛ کمی فاصله برای جداسازی */
    top: 6.25rem; /* 100px */
}

/* ---- کارت‌های دسته‌بندی (صفحه اصلی) ---- */
.category-card-minimal {
    border: 1px solid #e5e7eb;
    border-radius: var(--radius-lg);
    background: #fff;
    box-shadow: var(--shadow-xs);
    transition: box-shadow 0.2s, border-color 0.2s, transform 0.2s;
}
.category-card-minimal:hover {
    box-shadow: var(--shadow-sm);
    border-color: #f5dd9c;
    transform: translateY(-1px);
}

/* ---- بنرها ---- */
.banner-card-minimal {
    border: 1px solid #e5e7eb;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-xs);
    transition: box-shadow 0.2s;
}
.banner-card-minimal:hover {
    box-shadow: var(--shadow-sm);
}

/* ---- فوتر مینیمال (legacy) ---- */
.footer-minimal {
    background: #111827;
    border-top: 1px solid #1f2937;
}
.footer-minimal .text-gray-300:hover {
    color: #f5dd9c;
}
.footer-minimal h3 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #f3f4f6;
}

/* ---- فوتر اصلی سایت (همیار گرافیک) ---- */
.site-footer {
    border-top: 1px solid #e5e7eb;
}
/* خط جداکننده فقط بین آیتم‌ها (بعد از آیتم ۱ تا ۴)، نه بعد از آخری */
.site-footer .footer-guarantee-item--has-divider {
    border-right: 1px solid #e5e7eb;
}
[dir="rtl"] .site-footer .footer-guarantee-item--has-divider {
    border-right: none;
    border-left: 1px solid #e5e7eb;
}
.site-footer .footer-support-cta {
    box-shadow: var(--shadow-xs);
}
.site-footer .footer-stat-item {
    transition: background-color 0.15s ease;
}
.site-footer .footer-stat-item:hover {
    background-color: #fefbf3;
}
[dir="rtl"] .site-footer .footer-stat-item > div {
    text-align: right;
}
.site-footer .footer-copyright {
    background: #111827;
}
.site-footer a:hover {
    text-decoration: none;
}

/* ---- فلش و انیمیشن دراپ‌داون ---- */
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}
.nav-dropdown-menu {
    animation: slideDown 0.2s ease-out;
}
.user-menu-dropdown {
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.group:hover .user-menu-dropdown {
    transform: translateY(0);
}

/* ---- اسکلتون تصویر محصول (حین lazy load) ---- */
@keyframes product-img-skeleton-shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
.product-img-wrap {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 120px;
    background: #f3f4f6;
}
.product-img-skeleton {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, #f3f4f6 0%, #e5e7eb 50%, #f3f4f6 100%);
    background-size: 200% 100%;
    animation: product-img-skeleton-shimmer 1.5s ease-in-out infinite;
    border-radius: inherit;
}
.product-img-wrap img.product-img-loadable {
    opacity: 0;
    transition: opacity 0.25s ease-out;
}
/* زوم تصویر محصول با هاور: انیمیشن نرم و تدریجی */
img.product-img-loadable,
.fj-gallery-img.product-img-loadable,
.product-card-home-image img[class*="object-cover"],
.product-img-wrap img[class*="object-cover"] {
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.product-img-wrap.loaded img.product-img-loadable {
    opacity: 1;
}
.product-img-wrap.loaded .product-img-skeleton {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease-out;
}

/* ---- گالری justified (صفحه اصلی) ---- */
/* در RTL چیدمان با left/float بهم می‌ریزد؛ گالری را LTR نگه می‌داریم */
.products-justified-gallery-wrapper.fj-gallery,
.fj-gallery.products-justified-gallery-wrapper {
    direction: ltr;
    text-align: left;
    position: relative;
    min-height: 120px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}
.fj-gallery-item {
    box-sizing: border-box;
}
/* انیمیشن محتوای هاور کارت محصول justified: از پایین به بالا */
.fj-gallery-item .product-card-justified-content {
    transform: translateY(14px);
    opacity: 0;
    transition: transform 0.35s ease-out, opacity 0.3s ease-out;
}
.fj-gallery-item.group:hover .product-card-justified-content {
    transform: translateY(0);
    opacity: 1;
}
.fj-gallery-item.group:hover .product-card-justified-top {
    transform: translateY(0);
    opacity: 1;
}
.fj-gallery-item a {
    display: block;
    height: 100%;
    direction: rtl;
    text-align: right;
}
.fj-gallery-item .fj-gallery-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ---- صفحات لیستینگ (دسته، تگ، جستجو): هیرو و فیلترها ---- */
.listing-hero {
    margin-bottom: 0;
}
.listing-hero-filters .listing-select:focus {
    outline: none;
}
.listing-type-chip {
    transition: background-color 0.2s ease, color 0.2s ease;
}
.listing-hero-submit:focus {
    outline: none;
}

/* ---- درخت دسته‌بندی (زیردسته‌ها) — کارت‌های اسکرول‌شونده ---- */
.category-tree-section .category-tree-wrapper {
    box-shadow: var(--shadow-xs);
}
.category-tree-card {
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.category-tree-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}
[dir="rtl"] .category-tree-prev svg,
[dir="rtl"] .category-tree-next svg {
    transform: scaleX(-1);
}
