/* ════════════════════════════════════════════════════
   Arshia Products Pro — assets/products.css
   برند: بنفش #352070 + طلایی #EEBB66
   ════════════════════════════════════════════════════ */

/* ── ۰. توکن ── */
.app-canvas {
    --app-brand: #352070;
    --app-brand-dark: #24154e;
    --app-gold: #EEBB66;
    --app-ok: #16803c;
    --app-ink: #1f2937;
    --app-muted: #6b7280;
    --app-line: #e8e4f3;
    --app-shadow: 0 10px 34px rgba(53, 32, 112, .08);
    --app-shadow-lg: 0 18px 50px rgba(53, 32, 112, .16);
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    color: var(--app-ink);
}

/* ════════════════════════════════════════════════════
   ۱. نوار فیلتر محصولات
   ════════════════════════════════════════════════════ */
.app-filters {
    background: #fff;
    border: 1px solid var(--app-line);
    border-radius: 18px;
    padding: 22px 24px;
    box-shadow: var(--app-shadow);
    margin-bottom: 28px;
}
.app-filter-search { margin-bottom: 18px; }
.app-filter-search input {
    width: 100%;
    padding: 11px 16px;
    border: 1.5px solid var(--app-line);
    border-radius: 12px;
    font-family: inherit;
    font-size: 14px;
    transition: border-color .2s, box-shadow .2s;
}
.app-filter-search input:focus {
    outline: none;
    border-color: var(--app-brand);
    box-shadow: 0 0 0 3px rgba(53, 32, 112, .12);
}
.app-filter-group { margin-bottom: 16px; }
.app-filter-group h4 {
    font-size: 13px;
    font-weight: 800;
    color: var(--app-brand-dark);
    margin: 0 0 9px;
}
.app-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.app-pill {
    position: relative;
    cursor: pointer;
    margin: 0;
}
.app-pill input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}
.app-pill span {
    display: inline-block;
    padding: 7px 16px;
    border-radius: 24px;
    border: 1.5px solid var(--app-line);
    font-size: 13px;
    font-weight: 600;
    color: var(--app-muted);
    background: #faf9fe;
    transition: all .2s ease;
}
.app-pill:hover span {
    border-color: var(--app-brand);
    color: var(--app-brand);
}
.app-pill input:checked + span {
    background: var(--app-brand);
    border-color: var(--app-brand);
    color: #fff;
    box-shadow: 0 6px 16px -6px rgba(53, 32, 112, .6);
}
.app-filter-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px dashed var(--app-line);
    padding-top: 14px;
    margin-top: 4px;
}
.app-reset {
    background: none;
    border: none;
    color: var(--app-brand);
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
}
.app-reset:hover { background: #f0ebfa; }
.app-count { font-size: 12.5px; color: var(--app-muted); font-weight: 600; }

/* ════════════════════════════════════════════════════
   ۲. گرید محصولات
   ════════════════════════════════════════════════════ */
.app-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
}
.app-grid .ap-card {
    background: #fff;
    border: 1px solid var(--app-line);
    border-radius: 18px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform .28s ease, box-shadow .28s ease, border-color .28s ease;
    position: relative;
}
.app-grid .ap-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--app-shadow-lg);
    border-color: rgba(53, 32, 112, .22);
}
.app-grid .ap-thumb {
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: linear-gradient(135deg, #f0ebfa, #e8e0f7);
}
.app-grid .ap-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 16px;
    transition: transform .35s ease;
}
.app-grid .ap-card:hover .ap-thumb img { transform: scale(1.04); }
.app-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    background: var(--app-brand);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    padding: 4px 12px;
    border-radius: 20px;
    box-shadow: 0 4px 12px -3px rgba(53, 32, 112, .5);
}
.app-badge-corporate { background: #352070; }
.app-badge-retail    { background: #b45309; }

.app-grid .ap-body {
    padding: 18px 20px 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 8px;
}
.app-grid .ap-name { margin: 0; font-size: 16px; font-weight: 800; color: var(--app-brand-dark); }
.app-grid .ap-name a { color: inherit; text-decoration: none; }
.app-grid .ap-name a:hover { color: var(--app-brand); }
.app-grid .ap-desc {
    font-size: 13px;
    color: var(--app-muted);
    line-height: 1.8;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.app-grid .ap-features {
    list-style: none;
    margin: 4px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.app-grid .ap-features li {
    font-size: 12.5px;
    color: var(--app-ink);
    display: flex;
    gap: 7px;
    align-items: flex-start;
}
.app-feat-ico { flex-shrink: 0; font-size: 13px; line-height: 1.6; }
.app-grid .ap-foot {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px dashed var(--app-line);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}
.app-grid .ap-price { font-size: 17px; font-weight: 900; color: var(--app-brand); white-space: nowrap; }
.app-grid .ap-price em { font-style: normal; font-size: 14px; color: var(--app-muted); }
.app-grid .ap-price small { font-size: 11px; font-weight: 600; color: var(--app-muted); }
.app-actions { display: flex; gap: 8px; margin-top: 10px; }
.app-grid .ap-cta,
.app-grid .ap-add-calc {
    flex: 1;
    text-align: center;
    border-radius: 10px;
    padding: 9px 12px;
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    border: 1px solid transparent;
    transition: all .2s ease;
}
.app-grid .ap-cta {
    background: var(--app-brand);
    color: #fff;
}
.app-grid .ap-cta:hover { background: var(--app-brand-dark); }
.app-grid .ap-add-calc {
    background: #f0ebfa;
    color: var(--app-brand);
    border-color: #d6ccf5;
}
.app-grid .ap-add-calc:hover,
.app-grid .ap-add-calc.is-added { background: var(--app-gold); color: var(--app-brand-dark); border-color: var(--app-gold); }

/* ════════════════════════════════════════════════════
   ۳. صفحه‌بندی AJAX
   ════════════════════════════════════════════════════ */
.app-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 34px;
    flex-wrap: wrap;
}
.app-page {
    min-width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 1px solid var(--app-line);
    background: #fff;
    color: var(--app-ink);
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    transition: all .2s ease;
}
.app-page:hover:not(:disabled) {
    border-color: var(--app-brand);
    color: var(--app-brand);
}
.app-page.is-active {
    background: var(--app-brand);
    border-color: var(--app-brand);
    color: #fff;
}
.app-page:disabled { opacity: .4; cursor: not-allowed; }
.app-page-dots { color: var(--app-muted); padding: 0 2px; }

/* ════════════════════════════════════════════════════
   ۴. skeleton loading
   ════════════════════════════════════════════════════ */
.app-grid.is-loading { opacity: .6; transition: opacity .2s; }
.app-skeleton {
    background: linear-gradient(90deg, #f0ebfa 25%, #e6def7 50%, #f0ebfa 75%);
    background-size: 200% 100%;
    animation: appShimmer 1.2s infinite linear;
    border-radius: 18px;
    height: 340px;
    border: 1px solid var(--app-line);
}
@keyframes appShimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.app-empty {
    text-align: center;
    padding: 56px 20px;
    color: var(--app-muted);
    font-size: 15px;
    background: #fff;
    border: 1px dashed var(--app-line);
    border-radius: 16px;
    grid-column: 1 / -1;
}

/* ════════════════════════════════════════════════════
   ۵. مودال درخواست فاکتور
   ════════════════════════════════════════════════════ */
.apq-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.apq-modal[hidden] { display: none; }
.apq-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(16, 10, 40, .6);
    backdrop-filter: blur(3px);
}
.apq-modal-box {
    position: relative;
    width: min(620px, 100%);
    max-height: 90vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 20px;
    padding: 30px 28px 26px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, .4);
    font-family: 'Vazirmatn', Tahoma, sans-serif;
}
.apq-close {
    position: absolute;
    top: 14px;
    left: 14px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: #f0ebfa;
    color: var(--app-brand);
    font-size: 15px;
    cursor: pointer;
}
.apq-close:hover { background: var(--app-brand); color: #fff; }
.apq-modal-box h2 { margin: 0 0 6px; font-size: 20px; font-weight: 900; color: var(--app-brand-dark); }
.apq-subtitle { margin: 0 0 18px; font-size: 13px; color: var(--app-muted); }
.apq-summary {
    background: #faf9fe;
    border: 1px solid var(--app-line);
    border-radius: 14px;
    padding: 16px 18px;
    margin-bottom: 18px;
}
.apq-summary h3 { margin: 0 0 8px; font-size: 13.5px; font-weight: 800; color: var(--app-brand); }
.apq-summary ul { list-style: none; margin: 0 0 10px; padding: 0; }
.apq-summary li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 13px;
    padding: 4px 0;
    border-bottom: 1px dashed #eee;
}
.apq-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 10px;
    font-size: 14px;
    font-weight: 700;
}
.apq-total-row strong { font-size: 18px; color: var(--app-brand); }
.apq-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.apq-field { display: flex; flex-direction: column; gap: 5px; }
.apq-field--full { grid-column: 1 / -1; }
.apq-field span { font-size: 12.5px; font-weight: 700; color: var(--app-ink); }
.apq-field input,
.apq-field textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1.5px solid var(--app-line);
    border-radius: 10px;
    font-family: inherit;
    font-size: 13.5px;
    transition: border-color .2s, box-shadow .2s;
}
.apq-field input:focus,
.apq-field textarea:focus {
    outline: none;
    border-color: var(--app-brand);
    box-shadow: 0 0 0 3px rgba(53, 32, 112, .12);
}
.apq-field input:invalid { border-color: #dc2626; }
.apq-submit {
    width: 100%;
    margin-top: 16px;
    padding: 13px 20px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--app-gold), #d9a23f);
    color: var(--app-brand-dark);
    font-family: inherit;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 10px 22px -10px rgba(217, 162, 63, .75);
    transition: transform .18s, box-shadow .18s;
}
.apq-submit:hover { transform: translateY(-2px); box-shadow: 0 14px 28px -10px rgba(217, 162, 63, .9); }
.apq-submit:disabled { opacity: .55; cursor: wait; transform: none; }
.apq-notice { margin: 12px 0 0; font-size: 13px; min-height: 18px; text-align: center; }
.apq-notice.is-success { color: var(--app-ok); font-weight: 700; }
.apq-notice.is-error { color: #dc2626; font-weight: 700; }

/* ── دکمه ماشه (trigger) ── */
.apq-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    border-radius: 14px;
    padding: 14px 26px;
    background: linear-gradient(135deg, var(--app-gold), #d9a23f);
    color: var(--app-brand-dark);
    font-family: inherit;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 10px 22px -10px rgba(217, 162, 63, .75);
    transition: transform .18s, box-shadow .18s;
}
.apq-trigger:hover { transform: translateY(-2px); box-shadow: 0 14px 28px -10px rgba(217, 162, 63, .9); }

/* ════════════════════════════════════════════════════
   ۶. واکنش‌گرایی
   ════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
    .app-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    .app-grid { grid-template-columns: 1fr; }
    .apq-grid { grid-template-columns: 1fr; }
    .app-grid .ap-actions { flex-direction: column; }
    .app-grid .ap-actions .ap-cta,
    .app-grid .ap-actions .ap-add-calc { width: 100%; }
}
@media (prefers-re-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}
