:root {
    --bg: #f6f7f9;
    --surface: #ffffff;
    --surface-soft: #fafafa;
    --text: #1f2937;
    --muted: #6b7280;
    --border: #e5e7eb;
    --primary: #7c2d12;
    --primary-hover: #5f220d;
    --primary-soft: #fff7ed;
    --danger: #b91c1c;
    --success: #047857;
    --warning: #b45309;
    --radius: 14px;
    --shadow: 0 8px 28px rgba(15, 23, 42, 0.05);
}

* {
    box-sizing: border-box;
}

html {
    direction: rtl;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Tahoma, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.9;
    direction: rtl;
    text-align: right;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    color: var(--primary-hover);
}

img {
    max-width: 100%;
    height: auto;
}

.ir-wrap,
.container {
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    padding-left: 16px;
    padding-right: 16px;
}

.ir-topbar,
.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.03);
}

.ir-brand,
.site-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 0;
    flex-wrap: wrap;
}

.ir-brand-title,
.site-brand {
    font-size: 21px;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
}

.ir-muted,
.card-meta,
.page-subtitle,
.form-help {
    color: var(--muted);
}

.ir-nav,
.site-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 0 0 14px;
}

.ir-nav a,
.site-nav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 7px 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: #ffffff;
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
}

.ir-nav a:hover,
.site-nav a:hover {
    background: var(--primary-soft);
    color: var(--primary);
    border-color: #fed7aa;
}

.ir-main,
.page {
    padding-top: 26px;
    padding-bottom: 42px;
}

.ir-card,
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px;
    margin-bottom: 18px;
}

.page-title,
.ir-card h1 {
    margin: 0 0 18px;
    font-size: 24px;
    line-height: 1.5;
}

.card-title {
    margin: 0 0 10px;
    font-size: 18px;
    line-height: 1.6;
}

.ir-alert,
.alert {
    border-radius: var(--radius);
    padding: 12px 14px;
    margin: 0 0 18px;
    border: 1px solid #fed7aa;
    background: var(--primary-soft);
    color: var(--text);
}

.ir-alert-danger,
.alert-danger,
.alert-error {
    background: #fef2f2;
    border-color: #fecaca;
    color: var(--danger);
}

.alert-success {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: var(--success);
}

.alert-warning {
    background: #fffbeb;
    border-color: #fde68a;
    color: var(--warning);
}

.alert-info {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 40px;
    padding: 8px 15px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #ffffff;
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    line-height: 1.4;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}

.btn:hover {
    background: var(--surface-soft);
    color: var(--text);
}

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
}

.btn-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    color: #ffffff;
}

.btn-block {
    width: 100%;
}

.btn.disabled,
.btn[disabled] {
    opacity: 0.55;
    cursor: not-allowed;
    pointer-events: none;
}

.form-group {
    margin-bottom: 14px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 700;
}

.form-control {
    width: 100%;
    min-height: 42px;
    padding: 8px 11px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #ffffff;
    color: var(--text);
    font-family: inherit;
    font-size: 15px;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(124, 45, 18, 0.12);
}

.form-error {
    margin-top: 5px;
    color: var(--danger);
    font-size: 13px;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.table {
    width: 100%;
    border-collapse: collapse;
    min-width: 640px;
}

.table th,
.table td {
    padding: 11px 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

.table th {
    background: var(--surface-soft);
    font-weight: 700;
}

.table tr:last-child td {
    border-bottom: 0;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.product-card {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px;
    min-width: 0;
}

.product-media {
    flex: 0 0 116px;
    width: 116px;
}

.product-thumb,
.product-thumb-placeholder {
    display: block;
    width: 116px;
    height: 116px;
    max-width: 116px;
    max-height: 116px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface-soft);
}

.product-body {
    flex: 1 1 auto;
    min-width: 0;
}

.product-title {
    margin: 0 0 8px;
    font-size: 18px;
    line-height: 1.6;
}

.product-description {
    color: var(--muted);
    font-size: 14px;
    margin: 0 0 12px;
}

.download-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.download-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.download-name {
    min-width: 0;
    overflow-wrap: anywhere;
}

.actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.empty-state {
    background: var(--surface);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    padding: 28px 18px;
    text-align: center;
    color: var(--muted);
}

.ir-footer,
.footer {
    color: var(--muted);
    font-size: 13px;
    padding: 24px 0;
    text-align: center;
}

@media (max-width: 900px) {
    .product-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .ir-brand,
    .site-header-inner {
        align-items: flex-start;
        flex-direction: column;
    }

    .ir-card,
    .card {
        padding: 18px;
    }
}

@media (max-width: 640px) {
    body {
        font-size: 14px;
    }

    .ir-wrap,
    .container {
        padding-left: 12px;
        padding-right: 12px;
    }

    .ir-main,
    .page {
        padding-top: 18px;
        padding-bottom: 32px;
    }

    .page-title,
    .ir-card h1 {
        font-size: 21px;
    }

    .ir-nav,
    .site-nav {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
        gap: 8px;
    }

    .ir-nav a,
    .site-nav a {
        width: 100%;
        border-radius: 10px;
        white-space: normal;
        text-align: center;
    }

    .product-card {
        flex-direction: column;
    }

    .product-media {
        width: 100%;
        flex-basis: auto;
    }

    .product-thumb,
    .product-thumb-placeholder {
        width: 100%;
        height: 180px;
        max-width: 100%;
        max-height: 180px;
    }

    .download-item {
        align-items: stretch;
        flex-direction: column;
    }

    .download-item .btn {
        width: 100%;
    }

    .actions {
        width: 100%;
    }

    .actions .btn {
        flex: 1 1 auto;
    }
}

/* Product catalog */
.catalog-page .page-head {
    margin-bottom: 24px;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.product-card {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.product-card-image {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f7f7f7;
    height: 180px;
    text-decoration: none;
}

.product-card-image img {
    max-width: 100%;
    max-height: 160px;
    object-fit: contain;
    display: block;
}

.product-image-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #777;
    background: #f0f0f0;
    width: 100%;
    height: 100%;
    min-height: 140px;
}

.product-image-placeholder-large {
    min-height: 320px;
    border-radius: 14px;
}

.product-card-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}

.product-card h2 {
    font-size: 18px;
    line-height: 1.7;
    margin: 0;
}

.product-card h2 a {
    color: inherit;
    text-decoration: none;
}

.product-card h2 a:hover {
    text-decoration: underline;
}

.product-excerpt {
    color: #555;
    line-height: 1.9;
    margin: 0;
    font-size: 14px;
}

.product-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-top: auto;
}

.product-price,
.product-detail-price {
    font-weight: 700;
    color: #222;
}

.product-detail-price {
    font-size: 22px;
    margin: 10px 0 18px;
}

.price-stack {
    display: inline-flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
}

.price-regular {
    color: #777;
    text-decoration: line-through;
    font-weight: 400;
    white-space: nowrap;
}

.price-final {
    color: var(--success);
    font-weight: 700;
    white-space: nowrap;
}
.price-regular del {
    text-decoration: line-through;
    text-decoration-thickness: 1px;
}

.product-detail-price .price-final {
    font-size: 1.1em;
}

.ownership-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 13px;
    line-height: 1.5;
}

.ownership-owned {
    background: #e8f6ee;
    color: #14723b;
}

.ownership-guest {
    background: #fff4df;
    color: #8a5a00;
}

.ownership-available {
    background: #eef3ff;
    color: #244f9e;
}

.product-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 6px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 8px 14px;
    border-radius: 10px;
    border: 1px solid transparent;
    text-decoration: none;
    cursor: pointer;
    font: inherit;
    line-height: 1.5;
}

.button-primary {
    background: #222;
    color: #fff;
}

.button-secondary {
    background: #fff;
    color: #222;
    border-color: #ddd;
}

.button-disabled {
    background: #eee;
    color: #777;
    cursor: not-allowed;
}

.product-detail {
    display: grid;
    grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
    gap: 28px;
    align-items: start;
}

.product-detail-image {
    background: #f7f7f7;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid #e8e8e8;
}

.product-detail-image img {
    width: 100%;
    max-height: 420px;
    object-fit: contain;
    display: block;
}

.product-detail-content h1 {
    margin-top: 0;
}

.product-short-description,
.product-description,
.product-download-summary {
    margin-top: 22px;
    line-height: 2;
}

.product-description h2,
.product-download-summary h2 {
    font-size: 18px;
    margin-bottom: 8px;
}

.download-name-list {
    margin: 10px 0;
    padding-right: 22px;
}

.download-name-list li {
    margin-bottom: 6px;
}

.muted-text {
    color: #777;
    font-size: 14px;
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: #777;
    margin-bottom: 18px;
    font-size: 14px;
}

.breadcrumb a {
    color: inherit;
}

.notice {
    border-radius: 12px;
    padding: 12px 14px;
    line-height: 1.9;
    margin: 12px 0;
}

.notice-success {
    background: #e8f6ee;
    color: #14723b;
}

.notice-warning {
    background: #fff4df;
    color: #8a5a00;
}

.notice-info {
    background: #eef3ff;
    color: #244f9e;
}

.notice-error {
    background: #ffecec;
    color: #a40000;
}

@media (max-width: 960px) {
    .product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .product-detail {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 620px) {
    .product-grid {
        grid-template-columns: 1fr;
    }

    .product-card-image {
        height: 150px;
    }

    .product-card-image img {
        max-height: 135px;
    }

    .product-actions,
    .product-detail-actions {
        flex-direction: column;
    }

    .button {
        width: 100%;
    }
}


.site-brand-logo-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.site-brand-logo {
    display: block;
    width: auto;
    max-width: min(360px, 72vw);
    height: auto;
    max-height: 70px;
}

@media (max-width: 640px) {
    .site-brand-logo {
        max-width: min(280px, 78vw);
        max-height: 56px;
    }
}

.ssl-shot-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-top: 18px;
}

.ssl-shot-card {
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 16px;
    background: #fff;
    overflow: hidden;
}

.ssl-shot-button {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.ssl-shot-thumb-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 16 / 10;
    background: #f6f7f9;
    overflow: hidden;
}

.ssl-shot-thumb {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.ssl-shot-body {
    padding: 14px 16px 16px;
}

.image-modal[hidden] {
    display: none;
}

.image-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
}

.image-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
}

.image-modal-dialog {
    position: relative;
    z-index: 1;
    max-width: min(1100px, 96vw);
    max-height: 92vh;
    background: #fff;
    border-radius: 16px;
    padding: 14px;
    box-shadow: 0 20px 70px rgba(0, 0, 0, 0.35);
}

.image-modal-img {
    display: block;
    max-width: 100%;
    max-height: 84vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 10px;
}

.image-modal-close {
    position: absolute;
    top: -12px;
    left: -12px;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 999px;
    background: #fff;
    color: #111;
    font-size: 28px;
    line-height: 38px;
    cursor: pointer;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.25);
}

body.modal-open {
    overflow: hidden;
}

@media (max-width: 720px) {
    .ssl-shot-grid {
        grid-template-columns: 1fr;
    }

    .image-modal {
        padding: 10px;
    }

    .image-modal-dialog {
        max-width: 98vw;
        padding: 10px;
    }

    .image-modal-img {
        max-height: 82vh;
    }
}


/* Chat 19: public free-download post mirror. Append to /assets/css/style.css */
.gift-files-page,
.gift-file-page {
    width: 100%;
}

.gift-page-head {
    margin-bottom: 18px;
}

.gift-filter-notice {
    margin-top: 12px;
    padding: 10px 12px;
    border: 1px solid rgba(0,0,0,.08);
    border-radius: 12px;
    background: rgba(0,0,0,.025);
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    align-items: center;
}

.gift-list {
    display: grid;
    gap: 14px;
}

.gift-row {
    display: grid;
    grid-template-columns: 96px 1fr;
    gap: 14px;
    padding: 14px;
    border: 1px solid rgba(0,0,0,.08);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 4px 18px rgba(0,0,0,.04);
}

.gift-row-thumb {
    display: block;
    width: 96px;
    height: 96px;
    border-radius: 14px;
    overflow: hidden;
    background: rgba(0,0,0,.04);
    text-decoration: none;
}

.gift-row-thumb img,
.gift-detail-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gift-thumb-placeholder {
    display: flex;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    padding: 8px;
    text-align: center;
    color: #777;
    font-size: 13px;
}

.gift-row-body h2 {
    margin: 0 0 8px;
    font-size: 18px;
    line-height: 1.6;
}

.gift-row-body h2 a {
    color: inherit;
    text-decoration: none;
}

.gift-row-meta,
.gift-detail-meta,
.gift-media-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
    color: #666;
    font-size: 13px;
    line-height: 1.8;
}

.gift-categories a {
    text-decoration: none;
}

.gift-excerpt {
    margin: 8px 0 12px;
    color: #444;
    line-height: 1.9;
}

.gift-read-more {
    width: fit-content;
}

.gift-pagination {
    margin-top: 18px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
}


.gift-pagination-form {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.gift-pagination-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #555;
    font-size: 14px;
}

.gift-pagination-input {
    width: 78px;
    min-height: 40px;
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    color: var(--text);
    font: inherit;
    text-align: center;
}

.gift-pagination-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(124, 45, 18, 0.12);
}

.pagination-current {
    color: #555;
    font-size: 14px;
}

.gift-detail {
    max-width: 920px;
    margin: 0 auto;
}

.gift-detail-header h1 {
    margin-bottom: 8px;
    line-height: 1.7;
}

.gift-detail-image {
    width: min(100%, 420px);
    aspect-ratio: 16 / 9;
    margin: 18px auto;
    border-radius: 18px;
    overflow: hidden;
    background: rgba(0,0,0,.04);
}

.gift-content {
    margin-top: 18px;
    line-height: 2.1;
    font-size: 16px;
}

.gift-content p {
    margin: 0 0 14px;
}

.gift-media-section {
    margin-top: 26px;
    padding-top: 18px;
    border-top: 1px solid rgba(0,0,0,.08);
}

.gift-media-list {
    display: grid;
    gap: 16px;
}

.gift-media-item {
    padding: 14px;
    border: 1px solid rgba(0,0,0,.08);
    border-radius: 16px;
    background: rgba(0,0,0,.015);
}

.gift-media-head {
    display: grid;
    gap: 4px;
    margin-bottom: 10px;
}

.gift-media-item video,
.gift-media-item audio {
    display: block;
    width: 100%;
    margin: 10px 0;
}

.gift-media-item video {
    max-height: 480px;
    border-radius: 12px;
    background: #000;
}

.gift-detail-actions {
    margin-top: 20px;
}

@media (max-width: 640px) {
    .gift-row {
        grid-template-columns: 78px 1fr;
        gap: 10px;
        padding: 10px;
    }

    .gift-row-thumb {
        width: 78px;
        height: 78px;
        border-radius: 12px;
    }

    .gift-row-body h2 {
        font-size: 15px;
    }

    .gift-excerpt {
        font-size: 13px;
    }

    .gift-detail-image {
        width: 100%;
    }
}
