/* تعریف فونت صمیم */
@font-face {
    font-family: 'Samim';
    src: url('../fonts/Samim-Bold-FD.woff2') format('woff2'),
         url('../fonts/Samim-Bold-FD.woff') format('woff'),
         url('../fonts/Samim-Bold-FD.ttf') format('truetype');
    font-weight: bold;
    font-style: normal;
}

:root {
    --primary: #e06d44;        /* نارنجی آجری دلنشین لوگو */
    --primary-hover: #c95730;
    --accent: #f7a631;         /* زرد گرم خورشیدی لوگو */
    --soft-purple: #9d84b7;    /* یاسی لوگو */
    --soft-green: #7ebca8;     /* سبز ملایم لوگو */
    --bg-warm: #fdfaf6;        /* پس‌زمینه کرمی نرم متناسب با بوم توت‌بگ */
    --card-bg: #ffffff;
    --dark: #2c2523;           /* متن اصلی متمایل به قهوه‌ای گرم */
    --gray: #6e6563;           /* متن توضیحات */
    --border: #f0e6dc;         /* بردر ظریف و روشن */
    --shadow-sm: 0 4px 12px rgba(224, 109, 68, 0.08);
    --shadow-md: 0 10px 25px rgba(44, 37, 35, 0.07);
    --radius-sm: 10px;
    --radius-md: 18px;
    --radius-full: 9999px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Samim', system-ui, -apple-system, sans-serif;
}

body {
    background-color: var(--bg-warm);
    color: var(--dark);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    width: 92%;
    max-width: 1200px;
    margin: 0 auto;
}

/* ==================== هدر ==================== */
.main-header {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--primary);
}

.site-logo-img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: var(--radius-full);
}

.site-title {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary);
    letter-spacing: -0.5px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-links a {
    text-decoration: none;
    color: var(--dark);
    font-size: 0.95rem;
    transition: color 0.2s ease;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary);
}

.nav-links .admin-link {
    color: var(--gray);
    font-size: 0.85rem;
}

.cart-btn {
    background-color: var(--primary);
    color: #fff;
    border: none;
    padding: 10px 18px;
    border-radius: var(--radius-full);
    cursor: pointer;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.2s ease, transform 0.15s ease;
}

.cart-btn:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

.badge-count {
    background-color: #fff;
    color: var(--primary);
    padding: 2px 7px;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: bold;
}

/* ==================== بنر معرفی (Hero) ==================== */
.hero {
    background: linear-gradient(135deg, #fff7f2 0%, #fbf1e8 100%);
    border-bottom: 1px solid var(--border);
    padding: 40px 0 50px;
}

.hero-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
}

.hero-text {
    flex: 1;
}

.hero-text h2 {
    font-size: 2.2rem;
    color: var(--primary);
    margin-bottom: 14px;
    line-height: 1.3;
}

.hero-text p {
    font-size: 1.1rem;
    color: var(--gray);
    margin-bottom: 24px;
    max-width: 520px;
}

.hero-image-wrap {
    flex-shrink: 0;
}

.hero-logo-banner {
    width: 220px;
    height: 220px;
    object-fit: contain;
    border-radius: var(--radius-full);
    background-color: #fff;
    padding: 10px;
    box-shadow: var(--shadow-md);
    animation: float 4s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* ==================== دکمه‌ها ==================== */
.btn {
    display: inline-block;
    padding: 10px 22px;
    border-radius: var(--radius-full);
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    text-align: center;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-hero {
    background-color: var(--accent);
    color: #fff;
    font-size: 1.05rem;
    padding: 12px 28px;
    box-shadow: 0 4px 15px rgba(247, 166, 49, 0.35);
}

.btn-hero:hover {
    background-color: #e5931e;
    transform: translateY(-2px);
}

.btn-primary {
    background-color: var(--primary);
    color: #fff;
}
.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-disabled {
    background-color: #e3deda;
    color: #9c938e;
    cursor: not-allowed;
}

.btn-block {
    width: 100%;
}

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--primary);
    color: var(--primary);
}
.btn-outline:hover {
    background-color: var(--primary);
    color: #fff;
}

.btn-success {
    background-color: #27ae60;
    color: #fff;
}
.btn-success:hover {
    background-color: #219653;
}

.btn-secondary {
    background-color: #7f8c8d;
    color: #fff;
}

.btn-danger {
    background-color: #e74c3c;
    color: #fff;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
    border-radius: var(--radius-sm);
}

/* ==================== تیتر بخش‌ها ==================== */
.section-heading {
    text-align: center;
    margin: 45px 0 30px;
}

.section-title {
    font-size: 1.8rem;
    color: var(--dark);
    margin-bottom: 6px;
}

.section-subtitle {
    color: var(--gray);
    font-size: 1rem;
}

/* ==================== گرید و کارت محصولات ==================== */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 25px;
    margin-bottom: 50px;
}

.product-card {
    background-color: var(--card-bg);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.image-wrapper {
    position: relative;
    width: 100%;
    padding-top: 100%; /* نسبت مربع ۱:۱ */
    background-color: #f7f3ee;
    overflow: hidden;
}

.image-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.product-card:hover .image-wrapper img {
    transform: scale(1.05);
}

.out-of-stock-overlay {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(231, 76, 60, 0.9);
    color: #fff;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: bold;
}

.card-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    justify-content: space-between;
}

.product-title {
    font-size: 1.05rem;
    color: var(--dark);
    margin-bottom: 12px;
    min-height: 48px;
}

.price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-top: 1px dashed var(--border);
    padding-top: 10px;
}

.price-label {
    color: var(--gray);
    font-size: 0.9rem;
}

.price-amount {
    font-size: 1.15rem;
    color: var(--primary);
    font-weight: bold;
}

.price-amount small {
    font-size: 0.8rem;
    color: var(--gray);
    font-weight: normal;
}

/* پیام‌ها و خالی بودن */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 50px 20px;
    background: #fff;
    border-radius: var(--radius-md);
    color: var(--gray);
    border: 1px dashed var(--border);
}

.alert {
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    margin-top: 20px;
    margin-bottom: 20px;
    text-align: center;
    font-size: 1rem;
}
.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* ==================== بنر سفارش عمده ==================== */
.custom-order-banner {
    background: linear-gradient(135deg, #ffffff 0%, #fff9f6 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 60px;
    box-shadow: var(--shadow-sm);
}

.custom-order-info h3 {
    color: var(--primary);
    margin-bottom: 6px;
}

.custom-order-info p {
    color: var(--gray);
}

.custom-order-contact {
    display: flex;
    gap: 12px;
}

/* ==================== مدال سبد خرید ==================== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.55);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(3px);
}

.modal-card {
    background: #fff;
    width: 92%;
    max-width: 500px;
    max-height: 90vh;
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
    animation: modalPop 0.25s ease-out;
}

@keyframes modalPop {
    from { opacity: 0; transform: scale(0.92); }
    to { opacity: 1; transform: scale(1); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.modal-header h4 {
    font-size: 1.15rem;
    color: var(--primary);
}

.close-btn {
    background: transparent;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: var(--gray);
    line-height: 1;
}

.cart-items {
    padding: 15px 20px;
    overflow-y: auto;
    max-height: 260px;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: #fdf8f4;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    font-size: 1.05rem;
}

.checkout-form {
    padding: 16px 20px;
    background-color: #fff;
}

.form-group {
    margin-bottom: 12px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 0.9rem;
    color: var(--dark);
}

.form-group input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s ease;
}

.form-group input:focus {
    border-color: var(--primary);
}

.text-center {
    text-align: center;
}

/* ==================== فوتر ==================== */
.main-footer {
    background-color: #fff;
    border-top: 1px solid var(--border);
    padding: 30px 0 20px;
    margin-top: auto;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    text-align: center;
}

.footer-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.footer-logo {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-full);
}

.copyright {
    color: var(--gray);
    font-size: 0.85rem;
}

/* ==================== پنل ادمین ==================== */
.admin-dashboard {
    background: #f4f6f9;
}

.admin-header {
    background: #fff;
    padding: 15px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e1e8ed;
    margin-bottom: 25px;
}

.card {
    background: #fff;
    border-radius: var(--radius-sm);
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.grid-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    align-items: flex-end;
}

.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.table th, .table td {
    padding: 12px 14px;
    border-bottom: 1px solid #edf2f7;
    text-align: right;
}

.table th {
    background-color: #f8fafc;
    color: #475569;
}

.table-thumb {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 6px;
}

.badge {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.8rem;
}
.badge-success { background: #dcfce7; color: #166534; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-secondary { background: #e2e8f0; color: #334155; }
.badge-info { background: #e0f2fe; color: #075985; display: inline-block; }
.mb-2 { margin-bottom: 10px; }
.mb-3 { margin-bottom: 20px; }

/* ==================== Media Queries مخصوص موبایل و تبلت ==================== */
@media (max-width: 768px) {
    .header-container {
        flex-wrap: wrap;
        gap: 10px;
    }

    .site-title {
        font-size: 1.25rem;
    }

    .nav-links {
        order: 3;
        width: 100%;
        justify-content: center;
        border-top: 1px solid var(--border);
        padding-top: 10px;
        gap: 12px;
    }

    .cart-btn-wrapper {
        order: 2;
    }

    .cart-btn {
        padding: 8px 14px;
        font-size: 0.85rem;
    }

    .cart-text {
        display: none; /* مخفی کردن متن روی موبایل و نمایش آیکون + عدد */
    }

    .hero-content {
        flex-direction: column-reverse;
        text-align: center;
        gap: 20px;
    }

    .hero-logo-banner {
        width: 140px;
        height: 140px;
    }

    .hero-text h2 {
        font-size: 1.6rem;
    }

    .hero-text p {
        font-size: 0.95rem;
        margin: 0 auto 20px;
    }

    .product-grid {
        grid-template-columns: repeat(2, 1fr); /* دو ستونه روی موبایل */
        gap: 14px;
    }

    .product-title {
        font-size: 0.9rem;
        min-height: 40px;
    }

    .price-amount {
        font-size: 1rem;
    }

    .custom-order-banner {
        flex-direction: column;
        text-align: center;
    }

    .custom-order-contact {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .product-grid {
        grid-template-columns: 1fr; /* تک ستونه برای موبایل‌های کوچک */
    }
}
