/* =========================================================
   TANDUROST ACCOUNT MODAL
========================================================= */

.td-account-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    visibility: hidden;
    opacity: 0;
    transition: all .35s ease;
    font-family: inherit;
    direction: rtl;
}

.td-account-modal.active {
    visibility: visible;
    opacity: 1;
    z-index: 9999999999;
}

.td-account-overlay {
    position: absolute;
    inset: 0;
    background: rgba(20, 20, 20, .72);
    backdrop-filter: blur(5px);
}

.td-account-box {
    position: absolute;
    top: 50%;
    left: 50%;

    width: 480px;
    height: 100%;
    max-width: calc(100% - 30px);
    max-height: calc(100vh - 30px);

    background: #fff;
    border-radius: 24px;

    transform: translate(-50%, -46%) scale(.96);

    overflow: hidden;

    box-shadow:
            0 25px 80px rgba(0,0,0,.25);

    transition: all .4s cubic-bezier(.4,0,.2,1);
}

.td-account-modal.active .td-account-box {
    transform: translate(-50%, -50%) scale(1);
}


/* CLOSE */

.td-modal-close {
    position: absolute;
    top: 18px;
    left: 18px;

    width: 38px;
    height: 38px;

    border: 0;
    border-radius: 50%;

    background: #f5f5f5;

    cursor: pointer;

    z-index: 20;

    transition: .2s;
}

.td-modal-close:hover {
    background: #aa1823;
}

.td-modal-close span {
    position: absolute;

    width: 15px;
    height: 2px;

    background: #444;

    left: 11px;
    top: 18px;
}

.td-modal-close span:first-child {
    transform: rotate(45deg);
}

.td-modal-close span:last-child {
    transform: rotate(-45deg);
}

.td-modal-close:hover span {
    background: #fff;
}


/* =========================================================
   LOGIN
========================================================= */

.td-login-section {
    height: 100%;
    padding: 55px 45px 45px;
    overflow-y: auto;
}

.td-login-content {
    text-align: center;
}

.td-brand-icon {
    margin-bottom: 22px;
}

.td-brand-circle {
    width: 76px;
    height: 76px;

    margin: auto;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    color: #fff;

    background: linear-gradient(
            145deg,
            #aa1823,
            #7e0f18
    );

    box-shadow:
            0 12px 30px rgba(170,24,35,.25);
}

.td-brand-circle i {
    font-size: 28px;
}

.td-login-content h2 {
    margin: 0 0 10px;

    font-size: 24px;
    font-weight: 800;

    color: #222;
}

.td-login-description {
    margin: 0 auto 30px;
    color: #777;
    line-height: 1.9;
    font-size: 14px;
}


/* INPUT */

.td-input-group {
    text-align: right;
    margin-bottom: 18px;
}

.td-input-group label {
    display: block;

    margin-bottom: 8px;

    font-size: 13px;
    font-weight: 700;

    color: #333;
}

.td-input-wrapper {
    position: relative;
}

.td-input-wrapper > i,
.td-input-wrapper > svg
{
    position: absolute;

    right: 17px;
    top: 50%;

    transform: translateY(-50%);

    color: #999;

    font-size: 17px;
}

.td-input {
    width: 100%;
    height: 54px;

    border: 1px solid #e5e5e5;
    border-radius: 13px;

    background: #fafafa;

    padding: 0 48px 0 15px;

    outline: none;

    color: #222;

    font-family: inherit;
    font-size: 15px;

    transition: .2s;

    box-sizing: border-box;
}

.td-input:focus {
    border-color: #aa1823;
    background: #fff;

    box-shadow:
            0 0 0 4px rgba(170,24,35,.08);
}

.td-input::placeholder {
    color: #aaa;
}


/* BUTTON */

.td-main-btn {
    width: 100%;
    height: 54px;

    border: 0;
    border-radius: 13px;

    color: #fff;

    background: linear-gradient(
            135deg,
            #aa1823,
            #8d121c
    );

    font-family: inherit;
    font-size: 14px;
    font-weight: 700;

    cursor: pointer;

    box-shadow:
            0 10px 25px rgba(170,24,35,.18);

    transition: .25s;
}

.td-main-btn:hover {
    transform: translateY(-1px);

    box-shadow:
            0 14px 30px rgba(170,24,35,.25);
}

.td-main-btn:disabled {
    opacity: .7;
    cursor: not-allowed;
    transform: none;
}

.td-btn-loading {
    display: none;
}

.td-main-btn.loading .td-btn-text {
    display: none;
}

.td-main-btn.loading .td-btn-loading {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    gap: 10px;
}

.td-spinner {
    width: 16px;
    height: 16px;

    border: 2px solid rgba(255,255,255,.4);
    border-top-color: #fff;

    border-radius: 50%;

    animation: tdSpin .7s linear infinite;
}

@keyframes tdSpin {
    to {
        transform: rotate(360deg);
    }
}


/* ALERT */

.td-alert {
    display: none;

    padding: 11px 14px;

    margin-bottom: 15px;

    border-radius: 10px;

    font-size: 13px;
    line-height: 1.7;

    text-align: right;
}

.td-alert-error {
    background: #fff1f2;
    border: 1px solid #ffd7da;
    color: #a71925;
}

.td-alert-success {
    background: #effbf3;
    border: 1px solid #c9efd5;
    color: #18763a;
}


/* =========================================================
   OTP
========================================================= */

.td-otp-info {
    display: flex;

    align-items: center;

    gap: 13px;

    padding: 14px;

    margin-bottom: 25px;

    border-radius: 13px;

    background: #fafafa;

    text-align: right;
}

.td-otp-icon {
    width: 43px;
    height: 43px;

    flex-shrink: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 11px;

    color: #aa1823;
    background: #f9e8ea;
}

.td-otp-info strong {
    display: block;

    margin-bottom: 3px;

    font-size: 13px;
}

.td-otp-info p {
    margin: 0;

    font-size: 11px;

    color: #777;
}

.td-otp-info b {
    color: #333;
}

.td-otp-input {
    direction: ltr;

    text-align: center;

    letter-spacing: 8px;

    padding: 0 15px !important;

    font-size: 20px;

    font-weight: 700;
}

.td-otp-footer {
    display: flex;

    align-items: center;
    justify-content: center;

    gap: 10px;

    margin-top: 18px;

    color: #aaa;

    font-size: 12px;
}

.td-otp-footer button {
    border: 0;

    padding: 0;

    background: transparent;

    color: #777;

    font-family: inherit;
    font-size: 12px;

    cursor: pointer;
}

.td-otp-footer button:hover {
    color: #aa1823;
}

.td-otp-footer button:disabled {
    color: #aaa;
    cursor: not-allowed;
}


/* =========================================================
   ORDERS FULLSCREEN
========================================================= */

.td-orders-section {
    display: none;

    height: 100%;

    background: #f7f7f8;
}

.td-account-box.orders-mode {
    top: 0;
    left: 0;

    width: 100%;
    max-width: none;

    height: 100vh;
    max-height: none;

    border-radius: 0;

    transform: none !important;
}

.td-account-box.orders-mode .td-login-section {
    display: none;
}

.td-account-box.orders-mode .td-orders-section {
    display: block;
}

.td-account-box.orders-mode .td-modal-close {
    top: 25px;
    left: 30px;
}


/* HEADER */

.td-orders-header {
    min-height: 100px;

    padding: 0 8% 10px;

    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 30px;

    color: #fff;

    background:
            radial-gradient(
                    circle at 85% 20%,
                    rgba(255,255,255,.12),
                    transparent 30%
            ),
            linear-gradient(
                    135deg,
                    #aa1823,
                    #7c1018
            );

    box-sizing: border-box;
}

.td-header-small {
    display: block;

    margin-bottom: 7px;

    font-size: 12px;

    opacity: .75;
}

.td-orders-header h2 {
    margin: 0 0 7px;
    color: #fff;
    font-size: 30px;

    font-weight: 800;
}

.td-orders-header p {
    margin: 0;

    font-size: 13px;

    opacity: .75;
}

.td-user-info {
    display: flex;

    align-items: center;

    gap: 12px;

    padding: 10px 18px 10px 10px;

    border-radius: 15px;

    background: rgba(255,255,255,.1);

    backdrop-filter: blur(8px);
}

.td-user-avatar {
    width: 43px;
    height: 43px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 12px;

    background: rgba(255,255,255,.16);
}

.td-user-info strong {
    display: block;

    font-size: 13px;
}

.td-user-info small {
    display: block;

    margin-top: 3px;

    font-size: 11px;

    opacity: .7;

    direction: ltr;
}


/* BODY */

.td-orders-body {
    height: calc(100vh - 190px);

    overflow-y: auto;

    padding: 35px 8% 70px;

    box-sizing: border-box;
}

.td-orders-list {
    max-width: 1450px;
    margin: auto;
}


/* ORDER CARD */

.td-order-card {
    background: #fff;

    border: 1px solid #eee;

    border-radius: 17px;

    margin-bottom: 17px;

    overflow: hidden;

    box-shadow:
            0 4px 20px rgba(0,0,0,.035);

    transition: .25s;
}

.td-order-card:hover {
    box-shadow:
            0 10px 35px rgba(0,0,0,.07);
}

.td-order-top {
    display: grid;

    grid-template-columns:
        1.1fr
        1fr
        1fr
        1.2fr
        1fr
        auto;

    gap: 20px;

    align-items: center;

    padding: 22px 25px;
}

.td-order-label {
    display: block;

    margin-bottom: 7px;

    color: #999;

    font-size: 11px;
}

.td-order-value {
    color: #222;

    font-size: 13px;

    font-weight: 700;
}

.td-order-code {
    color: #aa1823;

    direction: ltr;

    font-size: 15px;
}


/* STATUS */

.td-order-status {
    display: inline-flex;

    align-items: center;

    gap: 6px;

    padding: 7px 12px;

    border-radius: 30px;

    font-size: 11px;

    font-weight: 700;
}

.td-status-success {
    background: #eaf8ef;
    color: #1d7a42;
}

.td-status-warning {
    background: #fff7e7;
    color: #9b6800;
}

.td-status-danger {
    background: #fff0f1;
    color: #a71925;
}

.td-status-info {
    background: #edf5ff;
    color: #246bb2;
}

.td-status-default {
    background: #f1f1f1;
    color: #666;
}


/* ITEMS BUTTON */

.td-items-btn {
    border: 0;

    padding: 10px 14px;

    border-radius: 10px;

    background: #f8e9eb;

    color: #aa1823;

    font-family: inherit;

    font-size: 11px;
    font-weight: 700;

    cursor: pointer;

    transition: .2s;
}

.td-items-btn:hover {
    background: #aa1823;
    color: #fff;
}


/* ORDER DETAILS */

.td-order-details {
    display: none;

    padding: 0 25px 22px;

    border-top: 1px solid #f1f1f1;

    background: #fcfcfc;
}

.td-order-details.active {
    display: block;

    animation: tdFadeIn .25s ease;
}

@keyframes tdFadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.td-items-table {
    width: 100%;

    border-collapse: collapse;

    font-size: 12px;
}

.td-items-table th {
    padding: 15px 10px;

    text-align: right;

    color: #999;

    font-size: 11px;

    font-weight: 600;
}

.td-items-table td {
    padding: 13px 10px;

    border-top: 1px solid #eee;

    color: #333;
}

.td-item-name {
    font-weight: 700;
}

.td-item-price {
    direction: ltr;
    text-align: right;
}


/* PRICE */

.td-order-price {
    direction: ltr;

    font-size: 13px;

    font-weight: 800;
}

.td-price-details {
    position: relative;
}

.td-price-main {
    color: #222;
}

.td-price-sub {
    display: block;

    margin-top: 4px;

    color: #999;

    font-size: 10px;
}


/* EMPTY */

.td-orders-empty {
    max-width: 500px;

    margin: 70px auto;

    text-align: center;
}

.td-empty-icon {
    width: 80px;
    height: 80px;

    margin: auto auto 20px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: #f9e8ea;

    color: #aa1823;

    font-size: 30px;
}

.td-orders-empty h3 {
    margin-bottom: 8px;

    font-size: 17px;
}

.td-orders-empty p {
    margin: 0;

    color: #999;

    font-size: 12px;
}


/* LOADING */

.td-orders-loading {
    padding: 100px 0;

    text-align: center;

    color: #888;
}

.td-big-spinner {
    display: block;

    width: 38px;
    height: 38px;

    margin: auto auto 15px;

    border: 3px solid #eee;
    border-top-color: #aa1823;

    border-radius: 50%;

    animation: tdSpin .8s linear infinite;
}

.td-orders-loading p {
    font-size: 13px;
}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 900px) {

    .td-account-box {
        width: calc(100% - 20px);
        max-height: calc(100vh - 20px);

        border-radius: 20px;
    }

    .td-orders-header {
        min-height: 160px;

        padding: 40px 20px 25px;

        align-items: flex-end;
    }

    .td-orders-header h2 {
        font-size: 24px;
    }

    .td-user-info {
        display: none;
    }

    .td-orders-body {
        height: calc(100vh - 160px);

        padding: 20px 12px 50px;
    }

    .td-order-top {
        grid-template-columns: 1fr 1fr;

        gap: 18px;

        padding: 20px;
    }

    .td-order-top > div:last-child {
        grid-column: span 2;
    }

    .td-order-details {
        padding: 0 12px 15px;

        overflow-x: auto;
    }

    .td-items-table {
        min-width: 550px;
    }
}


@media (max-width: 500px) {

    .td-login-section {
        padding: 45px 25px 35px;
    }

    .td-account-box {
        width: calc(100% - 12px);
        max-height: calc(100vh - 12px);

        border-radius: 18px;
    }

    .td-orders-header {
        min-height: 145px;

        padding: 35px 18px 22px;
    }

    .td-orders-body {
        height: calc(100vh - 145px);
    }

    .td-order-top {
        grid-template-columns: 1fr 1fr;
    }

    .td-order-value {
        font-size: 12px;
    }

    .td-modal-close {
        width: 34px;
        height: 34px;
    }

    .td-account-box.orders-mode .td-modal-close {
        top: 20px;
        left: 15px;
    }
}

.td-order-details {
    margin-top: 14px;
    padding: 12px;
    background: #f8f8f8;
    border-radius: 10px;
    font-size: 13px;
}

.td-order-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 7px 0;
    border-bottom: 1px solid #e9e9e9;
}

.td-order-detail-row:last-child {
    border-bottom: 0;
}

.td-order-detail-row strong {
    text-align: left;
    overflow-wrap: anywhere;
}

.td-order-final-price strong {
    color: #aa1823;
    font-size: 15px;
}

.td-order-product {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
    direction: rtl;
}

.td-order-product-photo {
    width: 76px;
    min-width: 76px;
    height: 90px;
    overflow: hidden;
    border-radius: 8px;
    background: #f4f4f4;
}

.td-order-product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.td-order-product-placeholder {
    display: flex;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    color: #aaa;
    font-size: 22px;
}

.td-order-product-info {
    min-width: 0;
    flex: 1;
}

.td-order-product-name {
    font-weight: 700;
    line-height: 1.8;
}

.td-order-product-link {
    color: #333;
    text-decoration: none;
}

.td-order-product-link:hover {
    color: #aa1823;
}

.td-order-product-detail {
    margin-top: 5px;
    color: #777;
    font-size: 12px;
}

.td-order-product-price {
    margin-top: 7px;
    color: #aa1823;
    font-weight: 700;
}

/* چیدمان محصولات سفارش */
.td-order-products {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-top: 15px;
    direction: rtl;
}

/* کارت محصول */
.td-order-product {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 12px;
    border: 1px solid #eee;
    border-radius: 12px;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.td-order-product:hover {
    border-color: #ddd;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.06);
}

/* تصویر محصول */
.td-order-product-photo {
    width: 100%;
    height: 180px;
    min-width: 0;
    overflow: hidden;
    border-radius: 8px;
    background: #f8f8f8;
}

.td-order-product-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* اطلاعات محصول */
.td-order-product-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    margin-top: 10px;
}

.td-order-product-name {
    font-size: 13px;
    font-weight: 700;
    line-height: 1.9;
    overflow-wrap: anywhere;
}

.td-order-product-link {
    color: #333;
    text-decoration: none;
}

.td-order-product-link:hover {
    color: #aa1823;
}

.td-order-product-detail {
    margin-top: 6px;
    color: #777;
    font-size: 12px;
    line-height: 1.8;
    overflow-wrap: anywhere;
}

.td-order-product-price {
    margin-top: auto;
    padding-top: 12px;
    color: #aa1823;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.8;
}

/* دسکتاپ کوچک و تبلت بزرگ */
@media (max-width: 1199px) {
    .td-order-products {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .td-order-product-photo {
        height: 165px;
    }
}

/* تبلت کوچک */
@media (max-width: 767px) {
    .td-order-products {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .td-order-product {
        padding: 9px;
    }

    .td-order-product-photo {
        height: 150px;
    }
}

/* موبایل */
@media (max-width: 480px) {
    .td-order-products {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .td-order-product {
        flex-direction: row;
        align-items: flex-start;
        gap: 12px;
        padding: 10px;
    }

    .td-order-product-photo {
        width: 100px;
        min-width: 100px;
        height: 120px;
    }

    .td-order-product-info {
        margin-top: 0;
    }

    .td-order-product-name {
        font-size: 12px;
    }

    .td-order-product-detail {
        font-size: 11px;
    }

    .td-order-product-price {
        font-size: 13px;
    }
}

.d-flex-gap-2px
{
    display: flex!important;
    gap: 2px!important;
}

/* بررسی وضعیت ورود */
.td-account-checking {
    display: none;
    min-height: 300px;
    width: 100%;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    text-align: center;
    padding: 30px 20px;
    box-sizing: border-box;
}

.td-account-checking p {
    margin: 0;
    font-size: 14px;
    color: #444;
}

.td-account-checking small {
    font-size: 12px;
    color: #888;
}

/* هنگام بررسی، فرم ورود و سفارش‌ها نمایش داده نشوند */
.td-account-box.checking-auth .td-account-checking {
    display: flex !important;
}

.td-account-box.checking-auth .td-login-section,
.td-account-box.checking-auth .td-orders-section {
    display: none !important;
}
