/* رهگام پلاس — فروشگاه خدمات دانشجویی */
:root {
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --primary-light: #eef2ff;
    --accent: #06b6d4;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --bg: #f8fafc;
    --card: #ffffff;
    --shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
    --shadow-lg: 0 20px 50px rgba(15, 23, 42, 0.12);
    --radius: 16px;
    --radius-sm: 10px;
    --header-h: 72px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; border: none; }
img { max-width: 100%; display: block; }

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ─── Header ─── */
.shop-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    height: var(--header-h);
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 20px;
    height: var(--header-h);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 1.25rem;
    color: var(--primary);
    flex-shrink: 0;
}

.logo i { font-size: 1.6rem; }

.search-box {
    flex: 1;
    max-width: 520px;
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 12px 48px 12px 20px;
    border: 2px solid var(--border);
    border-radius: 50px;
    font-size: 0.95rem;
    background: var(--bg);
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

.search-box input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
    background: #fff;
}

.search-box i {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.btn-icon {
    position: relative;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bg);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: var(--text);
    transition: all 0.2s;
}

.btn-icon:hover { background: var(--primary-light); color: var(--primary); border-color: var(--primary); }

.cart-badge {
    position: absolute;
    top: -4px;
    left: -4px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: var(--danger);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-badge:empty, .cart-badge[data-count="0"] { display: none; }

.btn-header {
    padding: 10px 20px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--border);
    color: var(--text);
}

.btn-outline:hover { border-color: var(--primary); color: var(--primary); }

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    color: #fff;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.4);
}

.menu-toggle { display: none; }

/* ─── Hero ─── */
.hero-banner {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #06b6d4 100%);
    color: #fff;
    padding: 48px 0 56px;
    position: relative;
    overflow: hidden;
}

.hero-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 40px;
    align-items: center;
    position: relative;
    z-index: 1;
}

.hero-content h1 {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 800;
    line-height: 1.5;
    margin-bottom: 16px;
}

.hero-content p {
    font-size: 1.05rem;
    opacity: 0.9;
    margin-bottom: 28px;
    max-width: 520px;
}

.hero-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 28px;
}

.hero-tag {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.hero-btns { display: flex; flex-wrap: wrap; gap: 12px; }

.btn-hero {
    padding: 14px 28px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-hero-white {
    background: #fff;
    color: var(--primary);
}

.btn-hero-white:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(0,0,0,0.2); }

.btn-hero-ghost {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.35);
}

.btn-hero-ghost:hover { background: rgba(255, 255, 255, 0.2); }

.hero-card {
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 24px;
    padding: 28px;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.hero-stat {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
}

.hero-stat strong {
    display: block;
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 4px;
}

.hero-stat span { font-size: 0.85rem; opacity: 0.85; }

/* ─── Trust bar ─── */
.trust-bar {
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 16px 0;
}

.trust-items {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 32px;
}

.trust-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}

.trust-item i {
    width: 36px;
    height: 36px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ─── Categories ─── */
.shop-section { padding: 48px 0; }

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.section-header h2 {
    font-size: 1.5rem;
    font-weight: 800;
}

.category-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 28px;
}

.chip {
    padding: 10px 20px;
    border-radius: 50px;
    font-size: 0.88rem;
    font-weight: 600;
    background: #fff;
    border: 2px solid var(--border);
    color: var(--text-muted);
    transition: all 0.2s;
    cursor: pointer;
}

.chip:hover { border-color: var(--primary); color: var(--primary); }

.chip.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* ─── Product grid ─── */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

.product-card {
    background: var(--card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: all 0.25s;
    display: flex;
    flex-direction: column;
    position: relative;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
}

.product-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    z-index: 2;
}

.badge-popular { background: #fef3c7; color: #b45309; }
.badge-free { background: #d1fae5; color: #047857; }

.product-thumb {
    height: 140px;
    background: linear-gradient(135deg, var(--primary-light), #f0f9ff);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: var(--primary);
    position: relative;
}

.product-body {
    padding: 18px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-category {
    font-size: 0.78rem;
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 6px;
}

.product-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.5;
}

.product-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 12px;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 14px;
}

.product-meta .rating { color: #f59e0b; font-weight: 600; }

.product-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.product-price {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--primary);
}

.product-price.free { color: var(--success); }

.btn-add-cart {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: all 0.2s;
    flex-shrink: 0;
}

.btn-add-cart:hover { background: var(--primary-dark); transform: scale(1.05); }

.btn-buy {
    padding: 8px 16px;
    border-radius: 10px;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 700;
    transition: all 0.2s;
}

.btn-buy:hover { background: var(--primary); color: #fff; }

/* ─── How it works ─── */
.how-section {
    background: #fff;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.step-card {
    text-align: center;
    padding: 28px 20px;
}

.step-num {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.2rem;
    margin: 0 auto 16px;
}

.step-card h3 { font-size: 1rem; margin-bottom: 8px; }
.step-card p { font-size: 0.88rem; color: var(--text-muted); }

/* ─── Cart drawer ─── */
.cart-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.cart-overlay.open { opacity: 1; visibility: visible; }

.cart-drawer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    max-width: 420px;
    height: 100vh;
    background: #fff;
    z-index: 2001;
    transform: translateX(-100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
}

.cart-drawer.open { transform: translateX(0); }

.cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.cart-header h3 { font-size: 1.15rem; font-weight: 800; }

.cart-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: var(--text-muted);
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 16px 24px;
}

.cart-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.cart-empty i { font-size: 3rem; margin-bottom: 16px; opacity: 0.4; }

.cart-item {
    display: flex;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}

.cart-item-icon {
    width: 52px;
    height: 52px;
    background: var(--primary-light);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 1.2rem;
    flex-shrink: 0;
}

.cart-item-info { flex: 1; min-width: 0; }
.cart-item-title { font-weight: 700; font-size: 0.92rem; margin-bottom: 4px; }
.cart-item-price { font-size: 0.88rem; color: var(--primary); font-weight: 600; }

.cart-item-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.qty-btn {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: var(--bg);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
}

.qty-value { font-weight: 700; min-width: 24px; text-align: center; }

.cart-item-remove {
    margin-right: auto;
    color: var(--danger);
    font-size: 0.8rem;
    background: none;
    padding: 4px 8px;
}

.cart-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--border);
    background: var(--bg);
}

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    font-size: 1.05rem;
}

.cart-total strong { font-size: 1.2rem; color: var(--primary); }

.btn-checkout {
    width: 100%;
    padding: 16px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-checkout:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(79, 70, 229, 0.35); }

.btn-checkout:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ─── Product modal ─── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.modal-overlay.open { opacity: 1; visibility: visible; }

.modal-card {
    background: #fff;
    border-radius: 24px;
    max-width: 560px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    transform: scale(0.95);
    transition: transform 0.3s;
}

.modal-overlay.open .modal-card { transform: scale(1); }

.modal-close {
    position: absolute;
    top: 16px;
    left: 16px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    color: var(--text-muted);
}

.modal-hero {
    height: 160px;
    background: linear-gradient(135deg, var(--primary-light), #f0f9ff);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    color: var(--primary);
}

.modal-body { padding: 28px; }

.modal-body h2 { font-size: 1.4rem; margin-bottom: 12px; }

.modal-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin: 20px 0;
}

.modal-detail {
    background: var(--bg);
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 0.88rem;
}

.modal-detail span { display: block; color: var(--text-muted); font-size: 0.78rem; margin-bottom: 2px; }

.modal-rules {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 12px;
    padding: 14px 16px;
    font-size: 0.88rem;
    color: #92400e;
    margin-bottom: 20px;
}

.modal-actions {
    display: flex;
    gap: 12px;
}

.modal-actions .btn-primary { flex: 1; padding: 14px; border-radius: 14px; font-weight: 700; }
.modal-actions .btn-outline { flex: 1; padding: 14px; border-radius: 14px; font-weight: 700; }

/* ─── Toast ─── */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--text);
    color: #fff;
    padding: 14px 24px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
    z-index: 5000;
    opacity: 0;
    transition: all 0.35s;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow-lg);
}

.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.toast.success { background: var(--success); }

/* ─── Footer ─── */
.shop-footer {
    background: #0f172a;
    color: #94a3b8;
    padding: 48px 0 24px;
    margin-top: 48px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-brand .logo { color: #fff; margin-bottom: 12px; }
.footer-brand p { font-size: 0.9rem; line-height: 1.8; margin-bottom: 16px; }

.footer-enamad {
    margin-top: 12px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-enamad img {
    max-width: 100px;
    border-radius: 8px;
    background: #fff;
    padding: 4px;
}

.footer-social {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.footer-social a {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.88rem;
    transition: color 0.2s;
}

.footer-social a i {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #38bdf8;
}

.footer-social a:hover { color: #fff; }

.footer-col h4 {
    color: #fff;
    font-size: 0.95rem;
    margin-bottom: 16px;
}

.footer-col a {
    display: block;
    font-size: 0.88rem;
    margin-bottom: 10px;
    transition: color 0.2s;
}

.footer-col a:hover { color: #fff; }

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 24px;
    text-align: center;
    font-size: 0.85rem;
}

/* ─── Mobile bottom nav ─── */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid var(--border);
    padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
    z-index: 900;
}

.mobile-nav a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 0.72rem;
    color: var(--text-muted);
    padding: 6px;
}

.mobile-nav a.active, .mobile-nav a:hover { color: var(--primary); }
.mobile-nav a i { font-size: 1.2rem; }

.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.no-results i { font-size: 3rem; margin-bottom: 16px; opacity: 0.3; }

/* ─── Responsive ─── */
@media (max-width: 992px) {
    .hero-grid { grid-template-columns: 1fr; }
    .hero-card { display: none; }
    .steps-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
    .search-box { display: none; }
    .btn-header span { display: none; }
    .menu-toggle { display: flex; }
    .header-actions .btn-outline { display: none; }
    .products-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .product-thumb { height: 100px; font-size: 2rem; }
    .product-body { padding: 12px; }
    .product-title { font-size: 0.9rem; }
    .product-desc { display: none; }
    .btn-buy { display: none; }
    .steps-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
    .mobile-nav { display: flex; }
    body { padding-bottom: 70px; }
    .modal-details { grid-template-columns: 1fr; }
}

@media (max-width: 400px) {
    .products-grid { grid-template-columns: 1fr; }
}
