﻿/* کارت شیشه‌ای */
.glass-card {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(16px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    border-radius: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15), inset 0 4px 8px rgba(255, 255, 255, 0.2);
}

/* --- دکمه‌ها --- */
.btn-primary {
    background: linear-gradient(to bottom right, #1b8763, #167a59);
    color: white;
    padding: 0.375rem 0.75rem;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    font-size: 0.875rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

@media (min-width: 768px) {
    .btn-primary {
        padding: 0.5rem 1rem;
        font-size: 1rem;
    }
}

.btn-primary:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    transform: translateY(-0.125rem);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(to bottom right, rgba(255,255,255,0.4) 0%, rgba(255,255,255,0) 60%);
    transform: rotate(30deg);
    transition: all 0.6s ease;
}

.btn-primary:hover::after {
    left: 100%;
}

.btn-secondary {
    background-color: #f3f4f6;
    color: #111827;
    padding: 0.375rem 0.75rem;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    border: 1px solid #e5e7eb;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

@media (min-width: 768px) {
    .btn-secondary {
        padding: 0.5rem 1rem;
        font-size: 1rem;
    }
}

.btn-secondary:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    background-color: white;
    transform: translateY(-0.125rem);
}

/* ورودی جستجو و دکمه پاک‌سازی */
.input-search {
    width: 100%;
    padding: 0.375rem 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

@media (min-width: 768px) {
    .input-search {
        padding: 0.5rem 1rem;
        font-size: 1rem;
    }
}

.input-search:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 122, 81, 0.2);
    border-color: transparent;
}

.clear-btn {
    position: absolute;
    left: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    transition: color 0.2s;
    font-size: 0.875rem;
}

    .clear-btn:hover {
        color: #4b5563;
    }

/* ساختار گرید ریسپانسیو */
.store-grid {
    --gap: 0.75rem;
    gap: var(--gap);
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr)); /* 2 ستون در موبایل */
    grid-auto-rows: minmax(200px, auto); /* ارتفاع انعطاف‌پذیر */
    padding: 0;
}

@media (min-width: 768px) {
    .store-grid {
        --gap: 1rem;
        grid-template-columns: repeat(4, minmax(0, 1fr)); /* 4 ستون در دسکتاپ */
    }
}

.store-grid-wrapper {
    --pad: 0.75rem;
    --gap: 0.75rem;
    padding: var(--pad);
    height: auto;
    max-height: none;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

@media (min-width: 640px) {
    .store-grid-wrapper {
        --pad: 1rem;
        --gap: 1rem;
    }
}

/* --- کارت فروشگاه --- */
.store-card {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(16px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    border-radius: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 200px;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15), inset 0 4px 8px rgba(255, 255, 255, 0.2);
}

@media (min-width: 640px) {
    .store-card {
        padding: 1rem;
        min-height: 220px;
    }
}

.store-card:hover {
    transform: translateY(-0.125rem);
    box-shadow: 0 4px 12px rgba(0, 122, 81, 0.25);
}

/* ساختار جدید کارت */
.store-card-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    justify-content: space-between;
}

.store-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 1rem;
}

.store-logo-container {
    position: relative;
    margin-bottom: 0.75rem;
}

.store-logo {
    width: 4rem;
    height: 4rem;
    border-radius: 9999px;
    border: 2px solid white;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    object-fit: cover;
    transition: transform 0.25s ease;
}

@media (min-width: 640px) {
    .store-logo {
        width: 5rem;
        height: 5rem;
    }
}

.store-card:hover .store-logo {
    transform: translateY(-0.125rem) scale(1.02);
}

.store-badge {
    position: absolute;
    bottom: -5px;
    right: -5px;
    background: #1b8763;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    border: 2px solid white;
}

.store-info {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.store-name {
    font-size: 0.875rem;
    font-weight: bold;
    color: #111827;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    min-height: 1.5rem;
    line-height: 1.4;
}

    .store-name i {
        color: #1b8763;
        font-size: 1rem;
    }

@media (min-width: 640px) {
    .store-name {
        font-size: 1rem;
    }
}

.store-meta {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.store-location {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    color: #4b5563;
    font-size: 0.75rem;
}

    .store-location i {
        color: #1b8763;
        font-size: 0.875rem;
    }

@media (min-width: 640px) {
    .store-location {
        font-size: 0.875rem;
    }
}

.card-footer {
    margin-top: auto;
    padding-top: 0.75rem;
    border-top: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* دکمه مشاهده فروشگاه */
.btn-enter-store {
    background: linear-gradient(to bottom right, #1b8763, #167a59);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

@media (min-width: 768px) {
    .btn-enter-store {
        font-size: 0.875rem;
        padding: 0.625rem 1.25rem;
    }
}

.btn-enter-store:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
    color: white;
    text-decoration: none;
}

/* =========================
   کلاس‌های کمکی
   ========================= */
.center-empty-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    min-height: 60vh;
}

/* آیکن‌های متریال با رنگ سبز تیره */
.material-icons {
    color: #1b8763;
}

/* استایل برای مدیریت ارتفاع متغیر نام فروشگاه */
.store-name-wrapper {
    min-height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.store-name-content {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
    max-height: 2.8rem;
}
.search-results-list {
    scrollbar-width: thin;
    scrollbar-color: #dee2e6 #f8f9fa;
}

.search-results-list::-webkit-scrollbar {
    width: 6px;
}

.search-results-list::-webkit-scrollbar-track {
    background: #f8f9fa;
}

.search-results-list::-webkit-scrollbar-thumb {
    background-color: #dee2e6;
    border-radius: 3px;
}

.search-result-item {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
    transition: all 0.2s;
    background: white;
}

    .search-result-item:hover {
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        transform: translateY(-1px);
    }

.result-image {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 6px;
}

.result-store-logo {
    width: 30px;
    height: 30px;
    object-fit: cover;
    border-radius: 50%;
    border: 1px solid #dee2e6;
}

.result-price {
    font-weight: bold;
    color: #198754;
    font-size: 1.1rem;
}

.result-store-name {
    font-size: 0.85rem;
    color: #6c757d;
}

.result-type-badge {
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
}

.product-badge {
    background-color: #e3f2fd;
    color: #0d6efd;
}

.store-badge {
    background-color: #f0f9ff;
    color: #0dcaf0;
}