:root {
    /* ===== تم: صنعتی / هشدار کارگاهی (زرد و مشکی) ===== */
    --bg-dark: #161616;
    --bg-panel: #1f1f1f;
    --bg-panel-light: #262626;

    --yellow: #ffc700;
    --yellow-dim: #d9a900;
    --yellow-hover: #ffd93d;

    --steel: #4a4a4a;
    --steel-light: #6b6b6b;

    --text-light: #f5f5f0;
    --text-dark: #161616;
    --text-body: #d8d5cc;
    --muted-text: #8a8a82;

    --border-color: #3a3a3a;
    --error-red: #ff4d4d;
    --success-green: #6fcf6f;

    --hazard-stripes: repeating-linear-gradient(
        45deg,
        #161616,
        #161616 12px,
        #ffc700 12px,
        #ffc700 24px
    );
}

/* =======================
   RESET
======================= */

* {
    box-sizing: border-box;
}

@font-face {
    font-family: "Vazirmatn";
    src: url("admin/Vazirmatn-Regular.woff2") format("woff2");
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

body {
    font-family: "Vazirmatn";
}

.search-bar input,
.search-bar input[type="text"],
.search-bar input[type="submit"] {
    font-family: "Vazirmatn";
}

input,
textarea,
select,
button {
    font-family: "Vazirmatn";
}

body {
    margin: 0;
    padding: 0;
    background: var(--bg-dark);
    color: var(--text-body);
    text-align: center;
    font-size: 12px;
}

/* نوار هشدار بالای صفحه */
body::before {
    content: "";
    display: block;
    height: 6px;
    width: 100%;
    background: var(--hazard-stripes);
}

/* =======================
   MAIN WRAPPER
======================= */

.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 10px;
}

/* =======================
   TEXT
======================= */

h1 {
    font-size: 20px;
    color: var(--yellow);
    text-transform: uppercase;
    letter-spacing: 1px;
}

p {
    font-size: 14px;
    margin-top: 10px;
}

/* =======================
   PRODUCT GRID
======================= */

.product-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 15px;
    margin: 20px auto;
    width: 100%;
    align-items: stretch;
}

/* =======================
   PRODUCT CARD
======================= */

.product {
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
    padding: 0 0 10px;
    background: var(--bg-panel);
    color: var(--text-light);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 360px;
    overflow: hidden;
    transition: border-color 0.25s ease, transform 0.25s ease;
}

.product:hover {
    border-color: var(--yellow);
    transform: translateY(-2px);
}

/* نوار هشدار بالای هر کارت */
.product::before {
    content: "";
    align-self: stretch;
    height: 8px;
    width: 100%;
    background: var(--hazard-stripes);
    flex-shrink: 0;
}

/* =======================
   IMAGE
======================= */

.product img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
    filter: grayscale(0.15) contrast(1.05);
    border-bottom: 1px solid var(--border-color);
}

/* =======================
   SEARCH
======================= */

.search-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    background: var(--bg-panel);
    padding: 8px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.search-bar input[type="text"] {
    width: 240px;
    padding: 10px 12px;
    border-radius: 3px;
    border: 1px solid var(--border-color);
    outline: none;
    font-size: 13px;
    background: var(--bg-dark);
    color: var(--text-light);
    transition: 0.25s;
}

.search-bar input[type="text"]::placeholder {
    color: var(--muted-text);
}

.search-bar input[type="text"]:focus {
    border-color: var(--yellow);
    box-shadow: 0 0 0 1px var(--yellow);
}

.search-bar input[type="submit"] {
    padding: 10px 14px;
    border-radius: 3px;
    border: none;
    cursor: pointer;
    font-weight: 700;
    font-size: 13px;
    color: var(--text-dark);
    background: var(--yellow);
    transition: 0.2s;
}

.search-bar input[type="submit"]:hover {
    background: var(--yellow-hover);
}

/* =======================
   PAGINATION
======================= */

.pagination {
    margin-top: 15px;
}

.pagination a {
    padding: 5px 10px;
    margin: 0 5px;
    background-color: var(--bg-panel-light);
    color: var(--text-light);
    border: 1px solid var(--border-color);
    border-radius: 3px;
    text-decoration: none;
    font-size: 11px;
}

.pagination a.active {
    background: var(--yellow);
    color: var(--text-dark);
    border-color: var(--yellow);
    font-weight: 700;
}

/* =======================
   BUTTON LINK
======================= */

.product-link-btn {
    display: inline-block;
    margin-top: 10px;
    padding: 10px 18px;
    background: var(--yellow);
    color: var(--text-dark) !important;
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    border-radius: 3px;
    transition: 0.2s;
}

.product-link-btn:hover,
.product-link-btn:visited,
.product-link-btn:active {
    background: var(--yellow-hover);
    color: var(--text-dark) !important;
}

/* =======================
   USER INFO
======================= */

.user-info {
    position: fixed;
    top: 10px;
    left: 10px;
    background-color: var(--bg-panel);
    border: 1px solid var(--border-color);
    color: var(--text-light);
    padding: 8px;
    border-radius: 4px;
    font-size: 14px;
}

/* =======================
   INPUTS
======================= */

input[type="text"],
input[type="password"] {
    padding: 8px;
    border-radius: 3px;
    border: 1px solid var(--border-color);
    margin-bottom: 10px;
    width: 100%;
    background: var(--bg-dark);
    color: var(--text-light);
}

/* =======================
   MOBILE INPUT FIX
======================= */

.mobile-input {
    width: 100%;
    max-width: 240px;
    padding: 6px 8px;
    font-size: 12px;
    border-radius: 3px;
    text-align: center;
    outline: 2px solid var(--yellow);
    margin: 0 auto;
    display: block;
    background: var(--bg-dark);
    color: var(--text-light);
}

/* =======================
   BUTTONS
======================= */

.button {
    padding: 8px 16px;
    background: var(--steel);
    color: var(--text-light);
    border: 1px solid var(--border-color);
    cursor: pointer;
    border-radius: 3px;
    width: 100%;
    transition: 0.2s;
}

.button:hover {
    background: var(--steel-light);
}

.payment-button {
    width: 100%;
    padding: 12px;
    margin-top: 15px;

    background: var(--yellow);
    color: var(--text-dark);

    border: none;
    border-radius: 4px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
}

.payment-button:hover {
    background: var(--yellow-hover);
}

/* =======================
   MENU
======================= */

.main-menu {
    text-align: center;
}

.main-menu-root,
.sub-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    direction: rtl;
}

.main-menu-root > li {
    position: relative;
    display: inline-block;
}

.sub-menu li {
    position: relative;
    white-space: nowrap;
}

.main-menu-root li a,
.sub-menu li a {
    display: block;
    padding: 10px 18px;
    margin: 0;

    background: var(--bg-panel-light);
    color: var(--text-light);
    text-decoration: none;

    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-weight: 700;
    font-size: 13px;

    min-width: 120px;
    text-align: center;

    transition: 0.2s ease;
}

.main-menu-root li a:hover,
.sub-menu li a:hover {
    background: var(--yellow);
    color: var(--text-dark);
    border-color: var(--yellow);
}

/* =======================
   SUBMENU
======================= */

.main-menu-root > li > .sub-menu,
.sub-menu {
    display: none;
    position: absolute;

    top: 0;
    right: 100%;

    min-width: 160px;
    width: max-content;

    padding: 5px 0;
    margin: 0;

    border-radius: 4px;

    background: transparent;
    box-shadow: none;

    z-index: 99999;
}

.main-menu-root li:hover > .sub-menu,
.sub-menu li:hover > .sub-menu {
    display: block;
}

.sub-menu li {
    position: relative;
    white-space: nowrap;
}

.sub-menu li a {
    display: block;
    padding: 10px 16px;

    background: var(--bg-panel-light);
    color: var(--text-light);

    text-decoration: none;
    border-radius: 4px;

    transition: 0.2s ease;
}

.sub-menu li a:hover {
    background: var(--yellow);
    color: var(--text-dark);
}

.main-menu {
    position: relative;
    z-index: 99999;
}

.sub-menu {
    z-index: 99999;
}

.product-container {
    position: relative;
    z-index: 1;
}

/* =======================
   AUTH BOX
======================= */
.auth-box {
    width: 100%;
    max-width: 360px;
    margin: 20px auto;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 10px;
    position: relative;
    z-index: 1000;
}

.auth-form {
    display: none;
    width: 100%;
    margin-top: 10px;
}

.auth-form.active {
    display: block;
}

.auth-tabs {
    display: flex;
    margin-top: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.auth-tabs button {
    flex: 1;
    padding: 10px;
    cursor: pointer;
    border: none;
    background: var(--bg-panel-light);
    color: var(--text-light);
}

.auth-tabs button.active-tab {
    background: var(--yellow);
    color: var(--text-dark);
    font-weight: 700;
}

/* =======================
   DOWNLOAD
======================= */

.free-download-button {
    display: inline-block;
    padding: 8px;
    width: 50%;
}

/* =======================
   ERROR / SUCCESS
======================= */

.error {
    color: var(--error-red);
}

.success {
    color: var(--success-green);
}

/* =======================
   FILE NAME
======================= */

.filename p{
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    color: var(--yellow);
}

/* =======================
   PRICE FIX
======================= */

.hidden-price {
    font-size: 18px;
    font-weight: 700;
    color: var(--yellow);
}

/* =======================
   RESPONSIVE FIX
======================= */

@media (max-width: 768px) {

    .product-container {
        grid-template-columns: 1fr;
        padding: 10px;
    }

    .product {
        width: 100%;
        max-width: 320px;
        margin: 0 auto;
        border-radius: 4px;
    }

    .auth-box {
        max-width: 95%;
    }

    .mobile-input {
        max-width: 80%;
    }
}

/* صفحه محصول تکی */
.single-product {
    display: flex !important;
    justify-content: center;
    align-items: center;
    min-height: 70vh;
}

.single-product .product {
    max-width: 420px;
    width: 100%;
}

.product h2,
.product h2 a {
    color: var(--text-light);
    text-decoration: none;
}

@media (min-width: 769px) {

    .top-bar {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px 20px;
    }

    .auth-box {
        position: static;
        width: 280px;
        margin: 0;
    }

    .main-menu {
        flex: 1;
        text-align: center;
    }
}

.auth-box {
    position: static;
    margin: 0;
}

.top-bar {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    align-items: center;
    margin: 15px auto;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

.top-center {
    display: flex;
    justify-content: center;
}

.top-right {
    display: flex;
    justify-content: flex-end;
}

.search-bar input[type="text"] {
    width: 220px;
}

.main-menu {
    text-align: right;
}

@media (max-width: 768px) {

    .top-bar {
        display: flex;
        flex-direction: column;
        gap: 10px;
        align-items: center;
    }

    .top-left,
    .top-center,
    .top-right {
        width: 100%;
        display: flex;
        justify-content: center;
    }

    .search-bar input[type="text"] {
        width: 90%;
        max-width: 300px;
    }

    .auth-box {
        width: 95%;
        max-width: 360px;
    }

    .main-menu {
        text-align: center;
    }
}

@media (max-width: 768px) {

    .main-menu-root li a,
    .sub-menu li a {
        width: 90%;
        margin: 5px auto;
        font-size: 14px;
        padding: 12px;
    }

    .main-menu-root > li {
        display: block;
        position: relative;
    }

    .main-menu-root > li > .sub-menu,
    .sub-menu {
        position: relative !important;
        top: auto !important;
        right: auto !important;
        left: auto !important;

        width: 100% !important;
        min-width: 100% !important;

        background: transparent;
    }
}

@media (max-width: 768px) {
    .search-bar {
        width: 95%;
        flex-direction: column;
    }

    .search-bar input[type="text"] {
        width: 100%;
    }

    .search-bar input[type="submit"] {
        width: 100%;
    }
}

/* بدون ذرات شناور تزئینی در این نسخه — حس صنعتی/ساده */
.bg-particles {
    display: none;
}

main {
    position: relative;
    z-index: 2;
}

.user-row{
    display:flex;
    align-items:center;
    justify-content:center;
    gap:8px;
    flex-wrap:wrap;
}

.user-row p{
    margin:0;
    padding:8px 14px;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    color: var(--text-light);
    border-radius:4px;
    font-weight:700;
    font-size:14px;
}

.admin-button{
    display:inline-block;
    padding:8px 14px;
    text-decoration:none;
    border-radius:4px;
    color: var(--text-dark);
    font-weight:700;
    background: var(--yellow);
    transition:.2s;
}

.admin-button:hover{
    background: var(--yellow-hover);
}

.logout-button{
    display:inline-block;
    padding:8px 14px;
    text-decoration:none;
    border-radius:4px;
    color:#fff;
    font-weight:700;
    background: var(--error-red);
    transition:.2s;
}

.logout-button:hover{
    opacity: 0.85;
}

.login-popup-btn{
    padding:10px 18px;
    border:none;
    border-radius:4px;
    cursor:pointer;
    color: var(--text-dark);
    font-weight:700;
    background: var(--yellow);
}

.login-popup-btn:hover{
    background: var(--yellow-hover);
}

.modal{
    display:none;
    position:fixed;
    inset:0;
    background:rgba(0,0,0,.85);
    z-index:99999;
}

.modal.show{
    display:block;
}

.modal-content{
    position:absolute;
    top:50%;
    left:50%;
    transform:translate(-50%,-50%);
}

.close-modal{
    position:absolute;
    top:5px;
    left:10px;
    font-size:28px;
    color: var(--yellow);
    cursor:pointer;
}

.modal .auth-box{
    margin:0;
    width:350px;
    max-width:95vw;
}

.auth-form button.button{
    background: var(--yellow);
    color: var(--text-dark);
    width: 100%;
    font-weight: 700;
    padding: 10px 16px;
    border-radius: 4px;
    transition: 0.2s;
}

.auth-form button.button:hover{
    background: var(--yellow-hover);
}

.home-link {
    cursor: pointer;
    position: relative;
    display: inline-block;
    color: inherit;
    font-weight: 600;
    transition: all 0.2s ease;
}

.home-link::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -4px;
    width: 0%;
    height: 2px;
    background: var(--yellow);
    transition: all 0.25s ease;
    transform: translateX(-50%);
}

.home-link:hover {
    color: var(--yellow);
}

.home-link:hover::after {
    width: 80%;
}

.show-description-btn{
    width:100%;
    margin:10px 0;
    padding:10px;
    cursor:pointer;
    background: var(--bg-panel-light);
    color: var(--text-light);
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.show-description-btn:hover{
    background: var(--yellow);
    color: var(--text-dark);
}

.description-modal-content{
    max-width:800px;
    max-height:80vh;
    overflow-y:auto;
    text-align:right;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    color: var(--text-light);
}

#descriptionText{
    line-height:2;
    white-space:normal;
}

.site-title{
    display:flex;
    align-items:center;
    justify-content:center;
    gap:10px;
    cursor:pointer;
}

.site-logo-left{
    width:100px;
    height:75px;
    object-fit:contain;
    order: 2;
}

.site-logo{
    width:55px;
    height:55px;
    object-fit:contain;
    order: 1;
}

.terms-link{
    text-align:center;
    margin:12px 0;
}

.terms-link a{
    color: var(--yellow);
    text-decoration:none;
    font-size:14px;
    font-weight:700;
    cursor:pointer;
}

.terms-link a:hover{
    text-decoration:underline;
}

.terms-modal{
    max-width:700px;
    width:90%;
}

.terms-content{
    max-height:60vh;
    overflow-y:auto;
    text-align:right;
    line-height:2;
    padding:10px;
    color: var(--text-body);
    background: var(--bg-panel);
}

.terms-modal .close-modal{
    font-size:50px;
    color: var(--yellow);
    font-weight:700;
}

#descriptionText img,
.description-modal-content img {
    width: auto;
    max-width: 100%;
    height: auto;
    border: 1px solid var(--border-color);
    border-radius: 3px;
}

.desc-content {
    direction: rtl;
    text-align: right;
}
