@import url('https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/Vazirmatn-font-face.css');

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #13131a;
    --bg-card: #1a1a24;
    --bg-hover: #222230;
    
    --accent-primary: #6366f1;
    --accent-secondary: #8b5cf6;
    --accent-success: #10b981;
    --accent-warning: #f59e0b;
    
    --text-primary: #f5f5f7;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    
    --border-color: #27273a;
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-accent: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.6);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Vazirmatn', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html {
    scroll-behavior: smooth;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ===== NAVBAR ===== */
.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(10, 10, 15, 0.8);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    padding: 16px 0;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 24px;
    font-weight: 800;
    color: var(--text-primary);
    text-decoration: none;
    transition: var(--transition);
}

.logo-icon {
    font-size: 28px;
}

.logo:hover {
    opacity: 0.8;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 24px;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    right: 0;
    width: 0;
    height: 2px;
    background: var(--accent-primary);
    transition: var(--transition);
}

.nav-link:hover {
    color: var(--text-primary);
}

.nav-link:hover::after {
    width: 100%;
}

.btn-cart {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--bg-card);
    color: var(--text-primary);
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    transition: var(--transition);
    position: relative;
}

.btn-cart:hover {
    background: var(--bg-hover);
    transform: translateY(-2px);
}

.cart-icon {
    font-size: 18px;
}

.cart-badge {
    position: absolute;
    top: -8px;
    left: -8px;
    background: var(--accent-primary);
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 12px;
    min-width: 20px;
    text-align: center;
}

/* ===== BUTTONS ===== */
button, input, select, textarea {
    font-family: 'Vazirmatn', sans-serif !important;
}

a {
    text-decoration: none !important;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    font-weight: 600;
    font-size: 15px;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    text-align: center;
}

.btn-primary {
    background: var(--accent-primary);
    color: white;
}

.btn-primary:hover {
    background: #5558e3;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.btn-outline:hover {
    border-color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.1);
}

.btn-primary-sm, .btn-outline-sm {
    padding: 8px 16px;
    font-size: 14px;
}

.btn-icon {
    width: 18px;
    height: 18px;
}

/* ===== HERO SECTION ===== */
.hero {
    position: relative;
    padding: 120px 0 80px;
    overflow: hidden;
}

.hero-decoration {
    position: absolute;
    top: -200px;
    left: -200px;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15), transparent);
    filter: blur(80px);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.hero-title {
    font-size: 56px;
    font-weight: 900;
    line-height: 1.2;
    margin-bottom: 24px;
}

.gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 20px;
    color: var(--text-secondary);
    margin-bottom: 40px;
    line-height: 1.6;
}

.hero-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ===== SECTIONS ===== */
.section {
    padding: 80px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 56px;
}

.section-title {
    font-size: 40px;
    font-weight: 800;
    margin-bottom: 16px;
}

.section-subtitle {
    font-size: 18px;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* ===== SERVICES GRID ===== */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 32px;
}

.service-card {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition);
}

.service-card:hover {
    transform: translateY(-8px);
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-lg);
}

.service-badge {
    position: absolute;
    top: 16px;
    left: 16px;
    background: var(--gradient-accent);
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    z-index: 10;
}

.service-image {
    position: relative;
    width: 100%;
    height: 240px;
    overflow: hidden;
    background: var(--bg-secondary);
}

.service-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.service-card:hover .service-image img {
    transform: scale(1.05);
}

.service-content {
    padding: 24px;
}

.service-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 8px;
}

.service-desc {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 20px;
}

.service-features {
    list-style: none;
    margin-bottom: 24px;
}

.service-features li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    color: var(--text-secondary);
    font-size: 14px;
}

.check-icon {
    width: 18px;
    height: 18px;
    color: var(--accent-success);
    flex-shrink: 0;
}

.service-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.service-price {
    display: flex;
    flex-direction: column;
}

.price-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.price-value {
    font-size: 24px;
    font-weight: 800;
    color: var(--accent-primary);
}

.price-currency {
    font-size: 14px;
    color: var(--text-secondary);
    margin-right: 4px;
}

.btn-add-cart {
    white-space: nowrap;
}

/* ===== PRODUCTS GRID ===== */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 28px;
}

.product-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: var(--transition);
}

.product-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-md);
}

.product-image {
    position: relative;
    width: 100%;
    height: 380px;
    overflow: hidden;
    background: var(--bg-secondary);
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.product-card:hover .product-image img {
    transform: scale(1.08);
}

.product-overlay {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
}

.product-card:hover .product-overlay {
    opacity: 1;
}

.btn-quick-add {
    padding: 12px 24px;
    background: white;
    color: #0a0a0f;
    font-weight: 700;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-quick-add:hover {
    transform: scale(1.05);
}

.product-content {
    padding: 20px;
}

.product-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
}

.product-desc {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 16px;
}

.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.product-price {
    font-size: 20px;
    font-weight: 800;
    color: var(--accent-primary);
}

.product-price small {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-right: 4px;
}

/* ===== FOOTER ===== */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 64px 0 24px;
    margin-top: 80px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 48px;
    margin-bottom: 48px;
}

.footer-section {
    display: flex;
    flex-direction: column;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 16px;
}

.footer-tagline {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
}

.footer-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.footer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
    font-size: 14px;
}

.footer-links a:hover {
    color: var(--accent-primary);
    padding-right: 4px;
}

.footer-contact {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.footer-contact li {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-secondary);
    font-size: 14px;
}

.contact-icon {
    width: 20px;
    height: 20px;
    color: var(--accent-primary);
    flex-shrink: 0;
}

.footer-contact a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
}

.footer-contact a:hover {
    color: var(--accent-primary);
}

.social-links {
    display: flex;
    gap: 12px;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    transition: var(--transition);
}

.social-link:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
    transform: translateY(-2px);
}

.social-link svg {
    width: 20px;
    height: 20px;
}

.footer-bottom {
    padding-top: 32px;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.copyright, .developer {
    color: var(--text-muted);
    font-size: 14px;
    margin: 8px 0;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-card, .service-card {
    animation: fadeInUp 0.6s ease-out;
}

/* ===== AUTH PAGES (Login/Register) ===== */
.auth-container {
    max-width: 400px;
    margin: 80px auto;
    background: var(--bg-card);
    padding: 40px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.auth-container h2 {
    margin-bottom: 30px;
    color: var(--text-primary);
    font-size: 24px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    text-align: right;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    transition: var(--transition);
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.form-actions button {
    flex: 1;
    justify-content: center;
}

.btn-secondary {
    background: var(--bg-hover);
    color: var(--text-primary);
    padding: 12px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}

.btn-secondary:hover {
    background: #333;
}

/* Alerts */
.alert {
    padding: 12px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    margin-bottom: 20px;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

/* ===== CART PAGE STYLES (NEW & IMPROVED) ===== */

.cart-header {
    margin-bottom: 30px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
}

.cart-container {
    display: grid;
    grid-template-columns: 2fr 1fr; /* دو ستون: لیست محصولات و خلاصه حساب */
    gap: 30px;
}

.cart-items {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.cart-item {
    display: grid;
    grid-template-columns: auto 2fr auto auto; /* Image | Details | Controls | Price */
    align-items: center;
    gap: 24px;
    background: var(--bg-card);
    padding: 20px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.cart-item:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

/* SMALLER IMAGES */
.cart-item img {
    width: 80px;      /* سایز فیکس و کوچک */
    height: 80px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    margin: 0;
}

.cart-details {
    flex-grow: 1;
}

.cart-details h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.cart-details .price {
    font-size: 14px;
    color: var(--text-secondary);
}

/* BETTER QUANTITY CONTROLS */
.quantity-controls {
    display: flex;
    align-items: center;
    background: var(--bg-secondary);
    border-radius: 50px; /* کپسولی شکل */
    padding: 4px;
    border: 1px solid var(--border-color);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}

.qty-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.qty-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.qty-display {
    min-width: 40px;
    text-align: center;
    font-weight: 800;
    font-size: 18px;
    color: var(--accent-primary); /* رنگ برجسته برای تعداد */
    padding: 0 8px;
}

/* PRICE DISPLAY */
.item-total {
    text-align: left;
    min-width: 120px;
    font-weight: 800;
    font-size: 18px;
    color: var(--text-primary);
}

.item-total small {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 400;
    margin-right: 4px;
}

/* ENHANCED CART SUMMARY */
.cart-summary {
    background: var(--bg-card);
    padding: 30px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    height: fit-content;
    position: sticky;
    top: 100px;
    box-shadow: var(--shadow-md);
    background: linear-gradient(to bottom, var(--bg-card), var(--bg-secondary));
}

.cart-summary h3 {
    font-size: 20px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 16px;
    color: var(--text-secondary);
    font-size: 15px;
}

.summary-row span:last-child {
    color: var(--text-primary);
    font-weight: 600;
}

.summary-row.total {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px dashed var(--border-color);
}

.summary-row.total span:first-child {
    font-size: 16px;
    font-weight: 700;
}

.summary-row.total span:last-child {
    font-size: 24px;
    font-weight: 900;
    color: var(--accent-success); /* رنگ سبز برای مبلغ نهایی */
}

/* CHECKOUT BUTTON */
.btn-checkout {
    width: 100%;
    margin-top: 24px;
    padding: 16px;
    font-size: 16px;
    border-radius: var(--radius-md);
    background: var(--gradient-primary); /* گرادینت جذاب */
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
    border: none;
    transition: var(--transition);
}

.btn-checkout:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.6);
}

/* RESPONSIVE FIXES */
@media (max-width: 768px) {
    .cart-header {
        text-align: center;
    }

    .cart-container {
        grid-template-columns: 1fr;
    }

    .cart-item {
        grid-template-columns: auto 1fr;
        grid-template-rows: auto auto auto;
        gap: 12px;
        padding: 16px;
    }
    
    .cart-item img {
        grid-row: span 2;
    }

    .quantity-controls {
        grid-column: 2;
        justify-self: start;
        margin: 0;
    }

    .item-total {
        grid-column: 1 / -1;
        text-align: right;
        padding-top: 12px;
        border-top: 1px solid var(--border-color);
        margin-right: 0;
    }

    /* General Responsive Fixes */
    .hero-title { font-size: 36px; }
    .hero-subtitle { font-size: 16px; }
    .section-title { font-size: 32px; }
    
    .nav-links { gap: 12px; flex-wrap: wrap; }
    .nav-link { font-size: 14px; }
    
    .services-grid { grid-template-columns: 1fr; }
    .products-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
    
    .footer-content { grid-template-columns: 1fr; gap: 32px; }
    .hero-buttons { flex-direction: column; }
    .btn { width: 100%; justify-content: center; }
}

@media (max-width: 480px) {
    .container { padding: 0 16px; }
    .hero { padding: 80px 0 60px; }
    .section { padding: 60px 0; }
}

/* ===== CHECKOUT PAGE ===== */
.checkout-container {
    max-width: 600px;
    margin: 0 auto;
    background: var(--bg-card);
    padding: 30px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.checkout-summary {
    background: var(--bg-secondary);
    padding: 15px;
    border-radius: var(--radius-sm);
    margin-bottom: 25px;
    border: 1px dashed var(--accent-primary);
}

.checkout-summary .total-amount {
    font-size: 20px;
    font-weight: 800;
    color: var(--accent-success);
}

.shipping-info {
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-md);
}

.shipping-info h3 {
    margin-bottom: 10px;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-text {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.checkout-form textarea {
    width: 100%;
    padding: 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    resize: vertical;
}

.btn-pay {
    width: 100%;
    padding: 16px;
    font-size: 18px;
    background: var(--gradient-primary);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

/* ===== RECEIPT CARD (Callback) ===== */
.receipt-card {
    background: var(--bg-card);
    width: 100%;
    max-width: 400px;
    padding: 40px;
    border-radius: 24px;
    text-align: center;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    position: relative;
    overflow: hidden;
}

.receipt-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
}

.receipt-card.success::before { background: var(--accent-success); }
.receipt-card.error::before { background: var(--accent-secondary); }

.receipt-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.receipt-card.success .receipt-icon {
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-success);
}

.receipt-card.error .receipt-icon {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.receipt-icon svg {
    width: 40px;
    height: 40px;
}

.receipt-card h2 {
    font-size: 24px;
    margin-bottom: 10px;
}

.receipt-message {
    color: var(--text-secondary);
    margin-bottom: 30px;
    font-size: 14px;
}

.receipt-details {
    background: var(--bg-primary);
    padding: 20px;
    border-radius: var(--radius-sm);
    text-align: right;
}

.receipt-details .row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 14px;
    color: var(--text-secondary);
}

.receipt-details .row:last-child {
    margin-bottom: 0;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
    color: var(--text-primary);
    font-weight: 700;
}
