/* ========================================================
   فروشگاه — صفحات عمومی و ادمین فروشگاه
   فقط در صفحاتی که این فایل لینک شده لود می‌شود (روی تم app.css سوار می‌شود)
   ======================================================== */

/* ---------- اسلایدر فروشگاه ---------- */

.shop-slider {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--ink-line);
    height: 320px;
    margin-bottom: 3rem;
}

.shop-slide {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.shop-slide.active {
    opacity: 1;
}

.shop-slide::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(10, 10, 12, 0.9) 0%, rgba(10, 10, 12, 0.35) 55%, transparent 100%);
}

.shop-slide-body {
    position: relative;
    z-index: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 3rem;
    max-width: 560px;
}

.shop-slide-body h2 {
    color: var(--paper);
    font-size: 1.9rem;
    margin-bottom: 0.6rem;
}

.shop-slide-body p {
    color: var(--paper-dim);
    margin-bottom: 1.2rem;
}

.shop-slider-dots {
    position: absolute;
    bottom: 1.2rem;
    right: 3rem;
    z-index: 2;
    display: flex;
    gap: 0.5rem;
}

.shop-slider-dots span {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.35);
    cursor: pointer;
    transition: background 0.25s ease;
}

.shop-slider-dots span.active {
    background: var(--gold);
}

/* ---------- دسته‌بندی‌های دایره‌ای ---------- */

.category-row {
    display: flex;
    gap: 1.6rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    margin-bottom: 3rem;
}

.category-circle {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    flex-shrink: 0;
    width: 96px;
    text-align: center;
}

.category-circle .circle-img {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    background: var(--ink-900);
    border: 1.5px solid var(--ink-line-strong);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.25s ease;
}

.category-circle:hover .circle-img {
    border-color: var(--gold);
}

.category-circle .circle-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.category-circle .circle-placeholder {
    font-size: 1.6rem;
    color: var(--paper-dim);
}

.category-circle span {
    color: var(--paper-dim);
    font-size: 0.85rem;
    font-weight: 500;
}

.category-circle:hover span {
    color: var(--gold);
}

/* ---------- نوار جستجو/فیلتر ---------- */

.shop-toolbar {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 2rem;
}

.shop-toolbar .form-control {
    max-width: 220px;
}

.shop-toolbar input[type="text"] {
    flex: 1;
    min-width: 200px;
    max-width: none;
}

/* ---------- گرید و کارت محصول ---------- */

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 1.4rem;
}

.product-card {
    background: var(--ink-900);
    border: 1px solid var(--ink-line);
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    transition: border-color 0.25s ease, transform 0.25s ease;
}

.product-card:hover {
    border-color: var(--gold-dim);
    transform: translateY(-4px);
    text-decoration: none;
}

.product-card-media {
    position: relative;
    aspect-ratio: 1 / 1;
    background: var(--ink-950);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.product-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-card-media .no-image {
    font-size: 2.2rem;
    color: var(--paper-dim);
    opacity: 0.5;
}

.product-card-badges {
    position: absolute;
    top: 0.6rem;
    right: 0.6rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    align-items: flex-end;
}

.discount-badge {
    background: var(--danger);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.2rem 0.55rem;
    border-radius: 8px;
}

.product-card-body {
    padding: 1rem 1.1rem 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.product-card-body h4 {
    font-size: 0.98rem;
    color: var(--paper);
    margin: 0;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.price-row {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
    margin-top: auto;
}

.price-current {
    color: var(--gold);
    font-weight: 700;
    font-size: 1.05rem;
}

.price-old {
    color: var(--paper-dim);
    font-size: 0.82rem;
    text-decoration: line-through;
    opacity: 0.7;
}

.product-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.type-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    background: var(--ink-800);
    color: var(--paper-dim);
    border: 1px solid var(--ink-line-strong);
}

.type-badge.type-digital {
    background: var(--gold-dim);
    color: var(--gold);
    border-color: transparent;
}

.stock-badge {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
}

.stock-badge.in-stock {
    background: rgba(76, 175, 80, 0.15);
    color: #8bd996;
}

.stock-badge.out-of-stock {
    background: rgba(244, 67, 54, 0.15);
    color: #ff9c94;
}

.empty-shop-state {
    text-align: center;
    padding: 4rem 1rem;
    color: var(--paper-dim);
    grid-column: 1 / -1;
}

/* ---------- صفحه محصول ---------- */

.product-page-grid {
    display: grid;
    grid-template-columns: minmax(280px, 460px) 1fr;
    gap: 3rem;
    align-items: start;
}

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

.product-gallery-main {
    aspect-ratio: 1 / 1;
    background: var(--ink-900);
    border: 1px solid var(--ink-line);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.product-gallery-main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-gallery-thumbs {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.product-gallery-thumbs img {
    width: 66px;
    height: 66px;
    object-fit: cover;
    border-radius: 8px;
    border: 1.5px solid var(--ink-line-strong);
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s ease, border-color 0.2s ease;
}

.product-gallery-thumbs img.active,
.product-gallery-thumbs img:hover {
    opacity: 1;
    border-color: var(--gold);
}

.product-info-price {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    margin: 1rem 0;
}

.product-info-price .price-current {
    font-size: 1.7rem;
}

.product-info-price .price-old {
    font-size: 1rem;
}

.variant-group {
    margin-bottom: 1.5rem;
}

.variant-group label {
    display: block;
    font-weight: 600;
    color: var(--paper);
    margin-bottom: 0.6rem;
}

.qty-stepper {
    display: inline-flex;
    align-items: center;
    border: 1.5px solid var(--ink-line-strong);
    border-radius: 10px;
    overflow: hidden;
}

.qty-stepper button {
    width: 40px;
    height: 40px;
    background: var(--ink-900);
    border: none;
    color: var(--paper);
    font-size: 1.1rem;
    cursor: pointer;
}

.qty-stepper button:hover {
    background: var(--ink-800);
}

.qty-stepper input {
    width: 48px;
    height: 40px;
    text-align: center;
    background: var(--ink-950);
    border: none;
    border-inline: 1.5px solid var(--ink-line-strong);
    color: var(--paper);
    font-size: 1rem;
}

.product-cta-row {
    display: flex;
    gap: 0.8rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.product-cta-row .btn {
    flex: 1;
    min-width: 160px;
}

.product-specs {
    margin-top: 3rem;
    border-top: 1px solid var(--ink-line);
    padding-top: 2rem;
}

.product-specs h4 {
    margin-bottom: 1rem;
}

.related-products {
    margin-top: 3rem;
}

/* ---------- دکمه خرید از پیام‌رسان بله ---------- */

.btn-bale {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 5px;
    background: #ffffff;
    color: #009EE3;
    font-weight: 700;
    font-size: 0.95rem;
    text-decoration: none;
    border: 1.5px solid #009EE3;
    transition: all 0.2s ease;
}

.btn-bale:hover {
    background: #009EE3;
    color: #fff;
    text-decoration: none;
}

.bale-icon {
    display: inline-flex;
    flex-shrink: 0;
}

/* ---------- لایت‌باکس تصویر محصول (اندازه واقعی) ---------- */

.lightbox-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
    z-index: 3000;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
    padding: 2rem;
}

.lightbox-overlay.show {
    display: flex;
}

.lightbox-overlay img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
    cursor: default;
}

.lightbox-close {
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
    color: #fff;
    font-size: 2.2rem;
    cursor: pointer;
    line-height: 1;
    opacity: 0.8;
}

.lightbox-close:hover {
    opacity: 1;
}

.product-gallery-main {
    cursor: zoom-in;
}

/* ---------- نظرات و امتیازها ---------- */

.product-reviews {
    margin-top: 3.5rem;
    border-top: 1px solid var(--ink-line);
    padding-top: 2.5rem;
}

.star-picker {
    display: flex;
    gap: 0.3rem;
    font-size: 1.8rem;
    direction: ltr;
}

.star-picker .star {
    color: var(--ink-line-strong);
    cursor: pointer;
    transition: color 0.15s ease;
}

.star-picker .star.active {
    color: var(--gold);
}

.review-list {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.review-item {
    background: var(--ink-900);
    border: 1px solid var(--ink-line);
    border-radius: var(--radius-md);
    padding: 1.2rem 1.4rem;
}

.review-item-head {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.review-stars {
    color: var(--gold);
    letter-spacing: 1px;
}

.admin-reply-box {
    margin-top: 0.8rem;
    padding: 0.8rem 1rem;
    background: var(--gold-dim);
    border-right: 3px solid var(--gold);
    border-radius: 8px;
    font-size: 0.9rem;
}

.admin-reply-box strong {
    color: var(--gold);
}

/* ---------- سبد خرید ---------- */

.cart-row {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    padding: 1.2rem 0;
    border-bottom: 1px solid var(--ink-line);
}

.cart-row:last-child {
    border-bottom: none;
}

.cart-row-thumb {
    width: 72px;
    height: 72px;
    border-radius: 10px;
    overflow: hidden;
    background: var(--ink-950);
    border: 1px solid var(--ink-line);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-row-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-row-info {
    flex: 1;
    min-width: 0;
}

.cart-row-info h4 {
    font-size: 0.95rem;
    margin: 0 0 0.3rem;
}

.cart-row-info .variant-name {
    color: var(--paper-dim);
    font-size: 0.85rem;
}

.cart-row-price {
    color: var(--gold);
    font-weight: 700;
    white-space: nowrap;
}

.cart-summary {
    position: sticky;
    top: 90px;
}

/* ---------- Checkout ---------- */

.checkout-section {
    margin-bottom: 2rem;
}

.checkout-section h4 {
    margin-bottom: 1rem;
}

.order-summary-line {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    color: var(--paper-dim);
    font-size: 0.92rem;
}

/* ---------- بج نوع سرویس فروشگاه (سفارش‌های من / ادمین) ---------- */

.shop-order-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
    background: var(--ink-800);
    color: var(--paper-dim);
    border: 1px solid var(--ink-line-strong);
}

/* ---------- ادمین فروشگاه: مدیریت تصاویر/گزینه‌ها ---------- */

.admin-image-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.admin-image-tile {
    position: relative;
    width: 90px;
    height: 90px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--ink-line-strong);
}

.admin-image-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.admin-image-tile .remove-btn {
    position: absolute;
    top: 2px;
    left: 2px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    cursor: pointer;
    font-size: 0.8rem;
    line-height: 1;
}

.admin-variant-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.6rem;
    flex-wrap: wrap;
}

.admin-variant-row .form-control {
    margin-bottom: 0;
}

/* ---------- اسلایدر محصولات جدید در صفحه اصلی ---------- */

.home-products-slider {
    display: flex;
    gap: 1.4rem;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    padding-bottom: 1rem;
}

.home-product-slide {
    flex: 0 0 240px;
    scroll-snap-align: start;
}

.home-product-slide .product-card {
    height: 100%;
}

/* ---------- ری‌اسپانسیو ---------- */

@media (max-width: 768px) {
    .shop-slider {
        height: 220px;
    }

    .shop-slide-body {
        padding: 0 1.5rem;
        max-width: 100%;
    }

    .shop-slide-body h2 {
        font-size: 1.3rem;
    }

    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 0.9rem;
    }

    .cart-summary {
        position: static;
    }
}
