/* User-supplied brand font (IRANSansWeb / font_nbt.ttf) — used site-wide, replacing the
   previous IRANYekanX font. */
@font-face {
    font-family: "IRANSansWeb";
    font-style: normal;
    font-weight: normal;
    src: url("/fonts/IRANSansWeb.ttf") format("truetype");
    font-display: swap;
}

html, body {
    font-family: "IRANSansWeb", Tahoma, sans-serif;
}

/* "این کالا با عنوان‌های ... هم شناخته می‌شود" note on the product-detail page
   (Views/Products/Details.cshtml) - deliberately understated so it reads as a small aside,
   not a competing headline, even though its real job is on-page SEO phrase coverage. */
.product-seo-note {
    line-height: 1.8;
    padding-top: 4px;
}

.product-seo-note a {
    color: var(--text-primary, #111);
    text-decoration: underline;
}

/* Simple fallbacks for icon-frame placeholders (no icon library ported) */
.icon-frame {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.icon-frame-square {
    border-radius: 9999px;
    background: var(--bg-tertiary, #f4f4f5);
    width: 40px;
    height: 40px;
}

/* Mobile nav toggle (plain JS, no React) */
.mobile-nav-hidden {
    display: none;
}

/* Homepage hero slider (Lamari / Phoenix cars) */
.hero-slider-track {
    display: flex;
    height: 100%;
    width: 100%;
    transition: transform 0.5s ease-in-out;
}

.hero-slide {
    position: relative;
    inset: unset;
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    display: block;
}

.hero-slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 9999px;
    border: none;
    background: rgba(255, 255, 255, 0.85);
    color: #111;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.hero-slider-arrow:hover {
    background: #fff;
}

.hero-slider-prev {
    right: 12px;
}

.hero-slider-next {
    left: 12px;
}

.hero-slider-dots {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    display: flex;
    gap: 8px;
}

.hero-slider-dot {
    width: 8px;
    height: 8px;
    border-radius: 9999px;
    border: none;
    background: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    padding: 0;
}

.hero-slider-dot.is-active {
    background: #fff;
    width: 20px;
    border-radius: 9999px;
}

/* Admin price-edit panel (/admin/login, /admin/products) — minimal, discreet, matching the
   site's own utility-class look rather than pulling in a separate UI framework. */
.admin-alert {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.875rem;
    margin-bottom: 16px;
}

.admin-alert-danger {
    background: #fdecec;
    color: #b3261e;
    border: 1px solid #f5c2c0;
}

.admin-alert-success {
    background: #e7f6ec;
    color: #1e7a3c;
    border: 1px solid #bfe8cd;
}

.admin-table-wrap {
    border: 1px solid var(--border-secondary, #e5e5e5);
    border-radius: 12px;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.admin-table th,
.admin-table td {
    padding: 12px 16px;
    text-align: right;
    white-space: normal;
    overflow-wrap: break-word;
    border-bottom: 1px solid var(--border-secondary, #e5e5e5);
    vertical-align: middle;
}

.admin-table thead th {
    font-weight: 600;
    color: var(--text-secondary, #444);
    background: var(--bg-tertiary, #f4f4f5);
}

.admin-table tbody tr:last-child td {
    border-bottom: none;
}

/* Sortable column headers (?sort=&dir=) on the admin products table. */
.admin-sort-link {
    color: inherit;
    text-decoration: none;
    white-space: nowrap;
}

.admin-sort-link:hover {
    text-decoration: underline;
}

/* Below this width, nine columns can't stay readable side by side even with wrapping text —
   so instead of falling back to horizontal scrolling, each row becomes a small stacked card
   with its own header text as a label (via the data-label attributes on each <td> in
   Views/AdminProducts/Index.cshtml). Every value stays fully visible, nothing is cut off or
   requires scrolling sideways to read. */
@media (max-width: 1024px) {
    .admin-table thead {
        display: none;
    }

    .admin-table,
    .admin-table tbody,
    .admin-table tr,
    .admin-table td {
        display: block;
        width: 100%;
    }

    .admin-table tbody tr {
        padding: 10px 14px;
        border-bottom: 1px solid var(--border-secondary, #e5e5e5);
    }

    .admin-table tbody tr:last-child {
        border-bottom: none;
    }

    .admin-table td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 6px 0;
        border-bottom: none;
        text-align: left;
    }

    .admin-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-secondary, #444);
        flex-shrink: 0;
    }

    .admin-table td[data-label="تصویر"] {
        justify-content: flex-start;
    }

    .admin-table td[data-label="قیمت جدید"] .admin-price-form {
        flex: 1;
        justify-content: flex-end;
    }

    .admin-table td[data-label="عملیات"] {
        justify-content: flex-start;
    }
}

.admin-table-price {
    font-weight: 700;
}

.admin-price-form {
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-price-input {
    width: 130px;
}

.admin-header-row {
    flex-wrap: wrap;
    gap: 12px;
}

.admin-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.admin-badge-manual {
    background: var(--bg-tertiary, #f4f4f5);
    color: var(--text-secondary, #555);
}

.admin-badge-auto {
    background: #e7f6ec;
    color: #1e7a3c;
}

/* Live progress panel for the "بروزرسانی خودکار قیمت‌ها از ترب" button
   (Controllers/AdminProductsController.cs AutoUpdatePriceStream, an SSE endpoint). */
.admin-progress-panel {
    border: 1px solid var(--border-secondary, #e5e5e5);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 16px;
    background: var(--bg-secondary, #fafafa);
}

.admin-progress-summary {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.admin-progress-log {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 240px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.admin-progress-item {
    font-size: 0.8125rem;
    padding: 4px 10px;
    border-radius: 6px;
    background: #fff;
    border: 1px solid var(--border-secondary, #e5e5e5);
}

.admin-progress-updated {
    color: #1e7a3c;
}

.admin-progress-not-found,
.admin-progress-skipped {
    color: var(--text-secondary, #666);
}

.admin-progress-error {
    color: #b3261e;
}

/* Discreet admin footer link — small, low-contrast, tucked in with the legal links. */
.admin-footer-link {
    font-size: 0.7rem;
    color: var(--text-quaternary, #999);
    opacity: 0.7;
    text-decoration: none;
}

.admin-footer-link:hover {
    opacity: 1;
    text-decoration: underline;
}

/* Product dashboard additions (add/edit/remove products, images) — /admin/products,
   /admin/products/add, /admin/products/edit/{sku}. */
.admin-thumb {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border-secondary, #e5e5e5);
    display: block;
}

.admin-row-inactive {
    opacity: 0.5;
}

.admin-badge-active {
    background: #e7f6ec;
    color: #1e7a3c;
}

.admin-badge-inactive {
    background: #fdecec;
    color: #b3261e;
}

.product-stock-in {
    color: #1e7a3c;
}

.product-stock-out {
    color: #b3261e;
}

.admin-row-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.admin-row-actions form {
    display: inline-flex;
}

.admin-button-danger {
    background: #b3261e;
    color: #fff;
    border: 1px solid #b3261e;
}

.admin-button-danger:hover {
    background: #92201a;
    border-color: #92201a;
}

.admin-form-page {
    max-width: 560px;
}

.admin-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.admin-form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.875rem;
    color: var(--text-secondary, #444);
}

.admin-form-field .input {
    width: 100%;
}

.admin-form-hint {
    font-size: 0.8125rem;
    color: var(--text-quaternary, #999);
    margin: -4px 0 0;
}

.admin-current-image {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid var(--border-secondary, #e5e5e5);
}
