/* ═══════════════════════════════════════════
   SEARCH PAGE — assets/css/search.css
   ═══════════════════════════════════════════ */

.dm-search-wrap {
    direction: rtl;
    padding-bottom: 60px;
}

.dm-search-container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ── هدر جستجو ── */
.dm-search-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    padding: 24px 0 16px;
    border-bottom: 1px solid var(--dm-border, #eee);
    margin-bottom: 20px;
}

.dm-search-title {
    font-size: 18px;
    font-weight: 700;
    color: #222;
    margin: 0 0 4px;
}

.dm-search-title span {
    color: var(--dm-primary, #ff6600);
}

.dm-search-count {
    font-size: 13px;
    color: #888;
    margin: 0;
}

/* ── باکس جستجوی مجدد ── */
.dm-search-rebox { flex-shrink: 0; }

.dm-search-input-wrap {
    display: flex;
    align-items: center;
    border: 1.5px solid var(--dm-border, #eee);
    border-radius: var(--dm-radius, 10px);
    background: var(--dm-bg-soft, #f8f9fb);
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
    min-width: 280px;
}

.dm-search-input-wrap:focus-within {
    border-color: var(--dm-primary, #ff6600);
    box-shadow: 0 0 0 3px var(--dm-primary-10, rgba(255,102,0,0.1));
    background: #fff;
}

.dm-search-input-wrap button {
    background: transparent;
    border: none;
    padding: 10px 12px;
    cursor: pointer;
    color: #aaa;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.dm-search-input-wrap button:hover { color: var(--dm-primary, #ff6600); }

.dm-search-input-wrap input[type="search"] {
    border: none;
    background: transparent;
    padding: 10px 0 10px 12px;
    font-size: 13px;
    outline: none;
    font-family: inherit;
    flex: 1;
    color: #222;
}

/* ── تب‌ها ── */
.dm-search-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    border-bottom: 2px solid var(--dm-border, #eee);
}

.dm-search-tab {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 18px;
    font-size: 13.5px;
    font-weight: 600;
    color: #777;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color 0.2s, border-color 0.2s;
}

.dm-search-tab.is-active {
    color: var(--dm-primary, #ff6600);
    border-bottom-color: var(--dm-primary, #ff6600);
}

.dm-search-tab:hover { color: var(--dm-primary, #ff6600); }

/* ── فیلتر دسته ── */
.dm-search-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid var(--dm-border, #eee);
    margin-bottom: 20px;
}

.dm-search-cats-label {
    font-size: 13px;
    font-weight: 700;
    color: #555;
    margin-left: 4px;
    flex-shrink: 0;
}

.dm-search-cat-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    border-radius: 20px;
    border: 1.5px solid var(--dm-border, #eee);
    background: #fff;
    font-size: 12.5px;
    font-weight: 600;
    color: #555;
    text-decoration: none;
    transition: all 0.2s;
}

.dm-search-cat-btn:hover,
.dm-search-cat-btn.is-active {
    background: var(--dm-primary, #ff6600);
    border-color: var(--dm-primary, #ff6600);
    color: #fff;
}

.dm-search-cat-count {
    background: rgba(0,0,0,0.1);
    border-radius: 10px;
    padding: 1px 6px;
    font-size: 11px;
    color: inherit;
}

.dm-search-cat-btn.is-active .dm-search-cat-count { background: rgba(255,255,255,0.25); }

/* ── گرید محصولات ── */
.dm-search-products-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

/* ── گرید مقالات ── */
.dm-search-posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 32px;
}

.dm-search-post-card {
    background: #fff;
    border: 1px solid var(--dm-border, #eee);
    border-radius: var(--dm-radius, 10px);
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s;
}

.dm-search-post-card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.09);
    transform: translateY(-3px);
}

.dm-spc-img-wrap { display: block; overflow: hidden; aspect-ratio: 16/9; }
.dm-spc-img-wrap img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.dm-spc-img-wrap:hover img { transform: scale(1.04); }

.dm-spc-body { padding: 14px 16px; }
.dm-spc-cat { font-size: 11px; font-weight: 700; color: var(--dm-primary, #ff6600); background: var(--dm-primary-10, rgba(255,102,0,0.1)); padding: 2px 8px; border-radius: 10px; display: inline-block; margin-bottom: 8px; }
.dm-spc-title { font-size: 14px; font-weight: 700; color: #222; margin: 0 0 8px; line-height: 1.5; }
.dm-spc-title a { color: inherit; text-decoration: none; }
.dm-spc-title a:hover { color: var(--dm-primary, #ff6600); }
.dm-spc-excerpt { font-size: 12.5px; color: #777; line-height: 1.7; margin: 0 0 10px; }
.dm-spc-date { font-size: 11.5px; color: #aaa; }

/* ── صفحه‌بندی ── */
.dm-search-pagination { display: flex; justify-content: center; margin-top: 32px; }
.dm-search-pagination .page-numbers { display: flex; gap: 6px; list-style: none; padding: 0; margin: 0; flex-wrap: wrap; justify-content: center; }
.dm-search-pagination .page-numbers li span,
.dm-search-pagination .page-numbers li a {
    display: flex; align-items: center; justify-content: center;
    width: 38px; height: 38px;
    border: 1.5px solid var(--dm-border, #eee);
    border-radius: 8px;
    font-size: 14px; font-weight: 700;
    color: #555; text-decoration: none;
    transition: all 0.2s;
}
.dm-search-pagination .page-numbers li .current,
.dm-search-pagination .page-numbers li a:hover {
    background: var(--dm-primary, #ff6600);
    border-color: var(--dm-primary, #ff6600);
    color: #fff;
}

/* ── نتیجه خالی ── */
.dm-search-empty {
    text-align: center;
    padding: 60px 24px;
    color: #888;
}
.dm-search-empty h2 { font-size: 20px; color: #444; margin: 16px 0 8px; }
.dm-search-empty p { font-size: 14px; margin: 0 0 20px; }
.dm-search-all-btn {
    display: inline-flex; align-items: center;
    background: var(--dm-primary, #ff6600); color: #fff;
    padding: 11px 24px; border-radius: var(--dm-radius, 10px);
    font-size: 14px; font-weight: 700; text-decoration: none;
    transition: opacity 0.2s;
}
.dm-search-all-btn:hover { opacity: 0.88; color: #fff; }

/* ── Responsive ── */
@media (max-width: 1100px) { .dm-search-products-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 900px)  { .dm-search-products-grid { grid-template-columns: repeat(3, 1fr); } .dm-search-posts-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px)  {
    .dm-search-products-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .dm-search-posts-grid { grid-template-columns: 1fr; }
    .dm-search-header { flex-direction: column; align-items: flex-start; }
    .dm-search-input-wrap { min-width: unset; width: 100%; }
    .dm-search-rebox { width: 100%; }
    .dm-search-form { width: 100%; }
}


/* ═══════════════════════════════════════════
   SKELETON LOADER — archive + search
   (می‌توان به post-archive.css هم اضافه کرد)
   ═══════════════════════════════════════════ */
.dm-skeleton-overlay {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

@media (max-width: 1100px) { .dm-skeleton-overlay { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 768px)  { .dm-skeleton-overlay { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 480px)  { .dm-skeleton-overlay { grid-template-columns: repeat(2, 1fr); } }

.dm-skel-card {
    background: #fff;
    border: 1px solid #f0f0f0;
    border-radius: var(--dm-radius, 10px);
    padding: 12px;
    overflow: hidden;
}

.dm-skel-img {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 8px;
    background: #f0f0f0;
    margin-bottom: 12px;
    position: relative;
    overflow: hidden;
}

.dm-skel-line {
    height: 12px;
    border-radius: 6px;
    background: #f0f0f0;
    margin-bottom: 8px;
    position: relative;
    overflow: hidden;
}

.dm-skel-line--title { width: 85%; }
.dm-skel-line--short { width: 55%; height: 10px; }
.dm-skel-line--price { width: 65%; height: 14px; background: #e8e8e8; margin-top: 12px; }

/* shimmer animation */
.dm-skel-img::after,
.dm-skel-line::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.7) 50%, transparent 100%);
    background-size: 200% 100%;
    animation: dm-shimmer 1.4s infinite ease-in-out;
}

@keyframes dm-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ── انیمیشن ورود کارت محصول در archive ── */
.dm-archive-grid .dm-product-card,
.dm-archive-grid .type-product {
    animation: dm-card-in 0.35s ease backwards;
}
.dm-product-card{
        max-height: 412px;
}

@keyframes dm-card-in {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: none; }
}

/* stagger */
.dm-archive-grid > *:nth-child(1)  { animation-delay: 0.04s; }
.dm-archive-grid > *:nth-child(2)  { animation-delay: 0.08s; }
.dm-archive-grid > *:nth-child(3)  { animation-delay: 0.12s; }
.dm-archive-grid > *:nth-child(4)  { animation-delay: 0.16s; }
.dm-archive-grid > *:nth-child(5)  { animation-delay: 0.20s; }
.dm-archive-grid > *:nth-child(6)  { animation-delay: 0.24s; }
.dm-archive-grid > *:nth-child(7)  { animation-delay: 0.28s; }
.dm-archive-grid > *:nth-child(8)  { animation-delay: 0.32s; }
.dm-archive-grid > *:nth-child(n+9){ animation-delay: 0.36s; }