﻿
/* ریست پایه */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
   
}

body {
    background-color: #fff;
    font-family: Arial, sans-serif;
    color: #262626;
}

/* ظرف اصلی (برای محدودکردن عرض در مرکز صفحه) */
.container {
    max-width: 700px; /* عرض بزرگ‌تر برای عناصر */
    margin: 0 auto;
    padding-bottom: 50px; /* کمی فضای خالی انتهای صفحه */
}

/* نوار بالایی (شامل فلش بازگشت، نام کاربر، منوی سه نقطه) */
.nav-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px; /* کمی بلندتر */
    padding: 0 20px;
    border-bottom: 1px solid #dbdbdb;
}

    .nav-bar .left-icon,
    .nav-bar .right-icon {
        font-size: 1.4rem; /* بزرگ‌تر شدن آیکون‌ها */
        cursor: pointer;
        user-select: none;
    }

    .nav-bar .profile-username {
        font-weight: bold;
        font-size: 1.2rem; /* فونت بزرگ‌تر */
    }

/* بخش بالای پروفایل: عکس، آمار، نام، بیو و دکمه‌ها */
.profile-header {
    padding: 20px 0px; /* کمی بیشتر برای فاصله */
    border-bottom: 1px solid #dbdbdb;
}

/* ردیف بالایی: عکس پروفایل، آمار (پست/فالوئر/فالوئینگ) */
.profile-top-row {
    display: flex;
    margin-bottom: 16px; /* فاصله بیشتر */
}

.profile-pic {
    width: 25vw; /* مثلاً 25 درصد از عرض نمایشگر */
    height: 25vw;
    max-width: 100px; /* درعین‌حال، بزرگ‌تر از 100px نشود */
    max-height: 100px;
    border-radius: 50%;
    background-image: url("/img/profile.jpg");
    background-size: cover;
    background-position: center;
}


.profile-stats {
    display: flex;
    align-items: center;
    gap: 30px; /* فاصله بین هر آمار */
    flex: 1;
    justify-content: center; /* آمارها وسط بخش قرار بگیرند */
}

.stat {
    text-align: center;
}

    .stat .count {
        font-weight: 600;
        display: block;
        font-size: 1.2rem; /* عدد تعداد پست/فالو بزرگ‌تر */
    }

    .stat span {
        font-size: 1rem; /* عنوان پست/فالو هم کمی بزرگ‌تر */
        color: #8e8e8e;
    }

/* نام و بیوگرافی کاربر */
.profile-name {
    font-weight: bold;
    margin-bottom: 8px;
    font-size: 1.1rem; /* کمی بزرگ‌تر */
}

.profile-bio {
    font-size: 1rem; /* متن بیوگرافی بزرگ‌تر */
    line-height: 1.6;
    color: #555;
    margin-bottom: 12px;
}

/* دکمه‌های زیر بیوگرافی (Follow, Message, Email, ...) */
.profile-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.btn {
    flex: 1;
    text-align: center;
    border: 1px solid #dbdbdb;
    border-radius: 4px;
    padding: 8px 0; /* ارتفاع دکمه بیشتر */
    cursor: pointer;
    font-size: 0.95rem; /* کمی بزرگ‌تر از قبل */
    background-color: #fff;
}

.btn-following {
    background-color: #0095F6;
    font-weight: 600;
}

.btn-blue {
    background-color: #0095f6;
    border-color: transparent;
    color: #fff;
    font-weight: 600;
}

/* ===== هایلایت‌ها (استوری‌ها) ===== */
.highlights {
    display: flex;
    gap: 24px; /* فاصله بیشتر بین هایلایت‌ها */
    padding: 16px 20px;
    border-bottom: 1px solid #dbdbdb;
    overflow-x: auto;
}

.highlight-item {
    text-align: center;
    cursor: pointer;
    min-width: 70px; /* کمی عریض‌تر */
}

.highlight-pic {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background-color: #ccc;
    background-size: cover;
    background-position: center;
    margin-bottom: 6px;
}

.highlight-label {
    font-size: 0.8rem;
    color: #555;
}

/* ===== منوی پست/ریلز/تگ ===== */
.post-menu {
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 50px; /* بلندتر از 46 شد */
    border-bottom: 1px solid #dbdbdb;
    background-color: #fff;
}

    .post-menu div {
        flex: 1;
        text-align: center;
        cursor: pointer;
        color: #8e8e8e;
        font-size: 1rem; /* بزرگ‌تر از قبل */
        position: relative;
        padding: 6px 0;
    }

        .post-menu div:hover {
            background-color: #fafafa;
        }

/* ===== گالری پست‌ها (3 ستونی) ===== */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    background-color: #fff;
    padding: 10px;
    align-items : baseline;
}


.post {
    position: relative;
    background-color: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 280px;
}

    .post:hover {
        transform: translateY(-3px);
        box-shadow: 0 6px 12px rgba(0,0,0,0.08);
    }

    .post img {
        width: 100%;
        height: 192px;
        object-fit: cover;
    }

.post-caption {
    padding: 12px;
    text-align: center;
}

.post-name {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 6px;
    color: #222;
}

.post-price {
    font-size: 1rem;
    color: #007bff;
    font-weight: bold;
}

.post-description {
    font-size: 0.85rem;
    color: #666;
    margin-top: 4px;
    line-height: 1.4;
    white-space: normal;
}


.low-stock-label {
    position: absolute;
    top: 8px;
    right: 8px;
    background-color: #dc3545;
    color: white;
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 8px;
    font-weight: bold;
    z-index: 2;
}


/* استایل کلی پاپ‌آپ */
.popup {
    z-index  : 1000;
    display: none; /* مخفی پیش‌فرض */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
}

/* محتوای داخل پاپ‌آپ */
.popup-content {
    z-index : 1001;
    background: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    width: 80%;
    max-width: 400px;
    position: relative;
}

/* دکمه بستن پاپ‌آپ */
.close-popup {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
}

/* استایل تصویر محصول داخل پاپ‌آپ */
.popup-content img {
    width: 100%;
    max-height: 250px;
    object-fit: cover;
    border-radius: 10px;
}

/* استایل دکمه افزودن به سبد خرید */
.add-to-cart {
    background: #0095f6;
    color: white;
    border: none;
    padding: 10px;
    border-radius: 5px;
    cursor: pointer;
}



#cart-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    font-size: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.2);
}
.top-basket {
    z-index: 999;
}
.cart-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

    .cart-item img {
        width: 50px;
        height: 50px;
        object-fit: cover;
        border-radius: 5px;
    }

.cart-item-name {
    flex-grow: 1;
    padding: 0 10px;
    font-size: 16px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cart-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 16px;
}

    .cart-controls button {
        width: 40px;
        height: 40px;
        aspect-ratio: 1 / 1; /* تضمین مربع بودن */
        border-radius: 50%; /* اگر می‌خوای دایره بشه */
        border: 1px solid #ddd;
        font-size: 1.4rem;
        font-weight: bold;
        color: #333;
        background-color: #fff;
        transition: all 0.2s ease;
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
        padding: 0;
        line-height: 1;
    }

        .cart-controls button:hover {
            background: #f1f1f1;
            border-color: #ccc;
        }

        .cart-controls button:active {
            transform: scale(0.95);
        }

    .cart-controls .item-count {
        font-size: 1.2rem;
        font-weight: 600;
        min-width: 24px;
        text-align: center;
        color: #222;
    }



.table-btn {
    width: 48px;
    height: 48px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
}

    .table-btn.disabled {
        opacity: 0.4;
        cursor: not-allowed;
    }

    .table-btn:hover:not(.disabled) {
        background: #ffe4e6;
        cursor: pointer;
    }

    .table-btn.selected {
        background: #f472b6;
        color: #fff;
    }
.otp-inputs {
    display: flex;
    gap: 0.5rem;
}

.otp-box {
    width: 3rem;
    height: 3rem;
    text-align: center;
    font-size: 1.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
}

    .otp-box:focus {
        border-color: #007bff;
        outline: none;
    }

.post-description, #popup-description {
    unicode-bidi: plaintext;
    direction: rtl;
}
.modal-body {
direction : rtl;
}
.cart-item-name {
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: unset !important;
    display: inline-block;
    word-break: break-word;
    flex-grow: 1;
}

.post-caption .low-stock-warning {
    color: #dc3545;
    font-size: 0.85rem;
    font-weight: bold;
    margin-top: 4px;
}


.low-stock-label {
    position: absolute;
    top: 8px;
    right: 8px;
    background-color: #dc3545;
    color: white;
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 8px;
    font-weight: bold;
    z-index: 2;
}

.post {
    position: relative; /* برای اینکه لیبل داخلش درست پوزیشن بگیره */
    border: 1px solid #eee;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: transform 0.2s ease;
}

    .post:hover {
        transform: translateY(-3px);
    }

.post-caption {
    padding: 10px;
    text-align: center;
}

/* لیبل‌های موجودی */
.stock-label {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 8px;
    font-weight: bold;
    z-index: 2;
    color: #fff;
}

.low-stock {
    background-color: #dc3545;
}

.out-of-stock {
    background-color: #6c757d;
}

/* ظاهر خاکستری کارت‌های ناموجود */
.post.sold-out {
    opacity: 0.5;
    pointer-events: none;
    filter: grayscale(100%);
}



@keyframes cart-bounce-highlight {
    0% {
        transform: scale(1) rotate(0deg);
        box-shadow: none;
    }

    20% {
        transform: scale(1.2) rotate(-5deg);
        box-shadow: 0 0 12px rgba(0, 149, 246, 0.5);
    }

    40% {
        transform: scale(1.2) rotate(5deg);
        box-shadow: 0 0 18px rgba(0, 149, 246, 0.6);
    }

    60% {
        transform: scale(1.1) rotate(-3deg);
        box-shadow: 0 0 10px rgba(0, 149, 246, 0.4);
    }

    80% {
        transform: scale(1.05) rotate(3deg);
        box-shadow: 0 0 6px rgba(0, 149, 246, 0.3);
    }

    100% {
        transform: scale(1) rotate(0deg);
        box-shadow: none;
    }
}

#cart-button.highlight {
    animation: cart-bounce-highlight 0.8s ease;
}

@keyframes cart-bounce {
    0% {
        transform: scale(1);
    }

    30% {
        transform: scale(1.3) rotate(-5deg);
    }

    60% {
        transform: scale(1.1) rotate(5deg);
    }

    100% {
        transform: scale(1) rotate(0deg);
    }
}

#cart-button.bounce {
    animation: cart-bounce 0.5s ease;
}


@keyframes pop-scale {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.3);
    }

    100% {
        transform: scale(1);
    }
}

.increase-btn.animate {
    animation: pop-scale 0.3s ease;
}
.cart-item {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-bottom: 1px solid #eee;
    font-size: 0.95rem;
}

.item-name {
    color: #333;
    font-weight: 500;
    line-height: 1.4;
}

.item-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

    .item-controls button {
        width: 28px;
        height: 28px;
        font-size: 1.1rem;
        border-radius: 6px;
        padding: 0;
    }

.item-quantity {
    min-width: 20px;
    text-align: center;
    font-weight: bold;
}

.item-price {
    font-weight: bold;
    color: #007bff;
    white-space: nowrap;
    font-size: 0.95rem;
}



.invoice-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    animation: fadeIn 0.3s ease;
}

.invoice-content {
    background: #fff;
    padding: 20px 24px;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
    position: relative;
    animation: slideUp 0.4s ease;
}

.close-invoice {
    position: absolute;
    top: 8px;
    right: 12px;
    font-size: 1.5rem;
    cursor: pointer;
}

.otp-inputs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 1rem;
}

.otp-digit {
    width: 50px;
    height: 60px;
    text-align: center;
    font-size: 24px;
    border-radius: 10px;
    border: 1px solid #ccc;
}


/* انیمیشن‌ها */
@keyframes fadeIn {
    from { opacity: 0; } to { opacity: 1; }
}
@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
