:root {
    --primary-color: #3b82f6;
    /* Blue 500 */
    --primary-dark: #2563eb;
    --secondary-color: #10b981;
    /* Emerald 500 */
    --background-dark: #0f172a;
    /* Slate 900 */
    --background-card: rgba(30, 41, 59, 0.7);
    /* Slate 800 with opacity */
    --text-main: #f8fafc;
    /* Slate 50 */
    --text-muted: #94a3b8;
    /* Slate 400 */
    --border-color: rgba(255, 255, 255, 0.1);
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --font-family: 'Vazirmatn', sans-serif;
    --transition-base: all 0.3s ease;
}

/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background-color: var(--background-dark);
    color: var(--text-main);
    line-height: 1.6;
    background-image:
        radial-gradient(circle at top right, rgba(59, 130, 246, 0.1), transparent 40%),
        radial-gradient(circle at bottom left, rgba(16, 185, 129, 0.1), transparent 40%);
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* Typography Headings */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    margin-bottom: 0.5em;
    color: #fff;
}

/* Layout Container */
.main-container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 10;
}

/* Header */
.header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.logo h1 {
    font-size: 2rem;
    background: linear-gradient(90deg, #60a5fa, #34d399);
    /* Gradient Text */
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
    vertical-align: middle;
    margin: 0;
}

.badge {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    padding: 0.2rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    margin-right: 0.5rem;
    vertical-align: middle;
}

.btn-outline {
    color: var(--text-muted);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    transition: var(--transition-base);
}

.btn-outline:hover {
    color: var(--text-main);
    border-color: var(--primary-color);
    background: rgba(59, 130, 246, 0.1);
}


/* ... existing styles ... */

/* Enhanced Hero Section */
.hero {
    text-align: center;
    width: 100%;
    padding: 4rem 0 2rem;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: 50%;
    transform: translateX(-50%);
    width: 150%;
    height: 100%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.15) 0%, transparent 60%);
    z-index: -1;
}

.hero h2 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    background: linear-gradient(to right, #ffffff, #94a3b8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.hero-description {
    font-size: 1.25rem;
    color: #e2e8f0;
    margin-bottom: 1rem;
    font-weight: 300;
}

.hero-brand-tagline {
    font-size: 1.1rem;
    color: #60a5fa;
    margin-bottom: 3rem;
    font-weight: 500;
    background: rgba(59, 130, 246, 0.1);
    display: inline-block;
    padding: 0.5rem 1.5rem;
    border-radius: 9999px;
    border: 1px solid rgba(59, 130, 246, 0.2);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}


/* Search Box Container */
.search-box-container {
    background: var(--background-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 2rem;
    border-radius: 1.5rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg), 0 0 20px rgba(59, 130, 246, 0.1);
    /* Glow */
    max-width: 600px;
    margin: 0 auto 3rem auto;
    transition: transform 0.3s ease;
}

/* Chatbot Widget - Enhanced & Modern */
.chatbot-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    font-family: var(--font-family);
    direction: rtl;
}

.chatbot-toggle {
    width: 65px;
    height: 65px;
    background: linear-gradient(135deg, #1d4ed8, #3b82f6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 30px rgba(59, 130, 246, 0.5);
    transition: all 0.4s cubic-bezier(0.19, 1, 0.22, 1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    position: relative;
    overflow: hidden;
}

.chatbot-toggle::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.4) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.3s;
}

.chatbot-toggle:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 12px 40px rgba(59, 130, 246, 0.6);
}

.chatbot-toggle:hover::after {
    opacity: 1;
}

.chatbot-toggle i {
    color: white;
    font-size: 32px;
    z-index: 1;
}

.chatbot-window {
    position: fixed;
    bottom: 110px;
    right: 30px;
    width: 380px;
    height: 600px;
    max-height: 80vh;
    background: rgba(30, 41, 59, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 1.5rem;
    box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.19, 1, 0.22, 1);
}

.chatbot-window.active {
    transform: translateY(0) scale(1);
    opacity: 1;
    visibility: visible;
}

.chat-header {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.9), rgba(37, 99, 235, 0.9));
    padding: 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
}

.chat-header .close-chat {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    cursor: pointer;
    font-size: 1.2rem;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.chat-header .close-chat:hover {
    background: rgba(255, 255, 255, 0.3);
}

.chat-messages {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.2));
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.message {
    max-width: 85%;
    padding: 1rem 1.2rem;
    border-radius: 1.2rem;
    font-size: 0.95rem;
    line-height: 1.6;
    position: relative;
    word-wrap: break-word;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    animation: messageIn 0.3s ease-out forwards;
    opacity: 0;
    transform: translateY(10px);
}

@keyframes messageIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.bot {
    align-self: flex-start;
    background: rgba(51, 65, 85, 0.8);
    color: #f1f5f9;
    border-bottom-right-radius: 0.2rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.message.user {
    align-self: flex-end;
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    color: white;
    border-bottom-left-radius: 0.2rem;
}

.chat-input-area {
    padding: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    gap: 0.75rem;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.chat-input-area input {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.75rem;
    padding: 0.9rem 1rem;
    color: white;
    font-family: var(--font-family);
    outline: none;
    transition: border-color 0.3s;
}

.chat-input-area input:focus {
    border-color: #60a5fa;
    background: rgba(0, 0, 0, 0.5);
}

.chat-input-area button {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    border: none;
    border-radius: 0.75rem;
    width: 50px;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.chat-input-area button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(59, 130, 246, 0.4);
}

/* Mobile Responsiveness for Chatbot */
@media (max-width: 480px) {
    .chatbot-window {
        width: 100%;
        height: 100vh;
        max-height: 100vh;
        bottom: 0;
        right: 0;
        border-radius: 0;
        transform: translateY(100%);
    }

    .chatbot-window.active {
        transform: translateY(0);
    }

    .chatbot-toggle {
        bottom: 20px;
        right: 20px;
        width: 55px;
        height: 55px;
    }
}


/* Search Box Container */
.search-box-container {
    background: var(--background-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 2rem;
    border-radius: 1.5rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg), 0 0 20px rgba(59, 130, 246, 0.1);
    /* Glow */
    max-width: 600px;
    margin: 0 auto 3rem auto;
    transition: transform 0.3s ease;
}

.search-box-container:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg), 0 0 30px rgba(59, 130, 246, 0.2);
}

.input-group {
    display: flex;
    position: relative;
    margin-bottom: 1.5rem;
}

.input-group input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    /* Space for icon */
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    color: white;
    font-size: 1rem;
    transition: var(--transition-base);
    font-family: inherit;
    text-align: center;
    /* Center placeholder/text */
}

.input-group input::placeholder {
    color: var(--text-muted);
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
    background: rgba(15, 23, 42, 0.8);
}

.input-group .icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.5rem;
    pointer-events: none;
}

.btn-primary {
    position: absolute;
    /* Actually make it separate or inline? Let's make it block below or inline */
    /* Revised: Input separate from Button for better mobile view */
}

/* Wait, rewriting input group to be stacked or flexible */
.input-group {
    flex-direction: column;
    gap: 1rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 0.75rem;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 4px 6px rgba(59, 130, 246, 0.3);
    width: 100%;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #60a5fa, #3b82f6);
    transform: translateY(-2px);
    box-shadow: 0 8px 12px rgba(59, 130, 246, 0.4);
}

/* Secondary Button (QR) */
.btn-secondary {
    background: transparent;
    color: var(--text-main);
    border: 1px solid var(--border-color);
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    cursor: pointer;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition-base);
    font-size: 0.95rem;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--text-muted);
}

.qr-scan-option {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.qr-scan-option span {
    position: relative;
    padding: 0 10px;
}

.qr-scan-option span::before,
.qr-scan-option span::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 20px;
    height: 1px;
    background: var(--border-color);
}

.qr-scan-option span::before {
    right: 100%;
}

.qr-scan-option span::after {
    left: 100%;
}


/* Features Grid */
.features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 3rem;
}

.feature-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.feature-item i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

/* Footer */
.footer {
    width: 100%;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: auto;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    max-width: 800px;
}

.contact-info {
    margin-top: 0.5rem;
    color: var(--text-main);
    font-weight: 500;
}

/* Modal for QR Scanner */
.modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal.visible {
    display: flex;
    /* Flex to center */
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: #1e293b;
    padding: 20px;
    border: 1px solid #334155;
    width: 90%;
    max-width: 500px;
    border-radius: 1rem;
    text-align: center;
    position: relative;
}

.close-modal {
    position: absolute;
    top: 10px;
    left: 15px;
    /* RTL close button on left */
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-modal:hover,
.close-modal:focus {
    color: white;
    text-decoration: none;
    cursor: pointer;
}

#reader {
    width: 100%;
    border-radius: 0.5rem;
    overflow: hidden;
    margin-bottom: 1rem;
}

/* Responsive */
@media (max-width: 600px) {
    .features {
        grid-template-columns: 1fr;
        /* Stack features on mobile */
    }

    .hero h2 {
        font-size: 1.8rem;
    }

    .search-box-container {
        padding: 1.5rem;
    }
}

/* Sections General */
section {
    width: 100%;
    margin-bottom: 4rem;
}

.section-title {
    text-align: center;
    font-size: 1.8rem;
    margin-bottom: 2rem;
    color: var(--text-main);
    position: relative;
    display: inline-block;
    padding-bottom: 0.5rem;
    left: 50%;
    transform: translateX(-50%);
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 20%;
    width: 60%;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
}

/* Brands Slider */
.brands-section {
    padding: 2rem 0;
    background: rgba(30, 41, 59, 0.3);
    /* Subtle dark bg */
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    overflow: hidden;
}

.brands-container {
    display: flex;
    gap: 3rem;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    max-width: 1000px;
    margin: 0 auto;
}

.brand-item img {
    height: 60px;
    opacity: 0.6;
    transition: var(--transition-base);
    filter: grayscale(100%);
}

.brand-item img:hover {
    opacity: 1;
    filter: grayscale(0%);
    transform: scale(1.05);
}

/* Product Catalog (Swiper) */
.catalog-section {
    max-width: 1200px;
    margin: 0 auto 4rem auto;
    padding: 0 1rem;
}

.product-card {
    background: var(--background-card);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    overflow: hidden;
    transition: var(--transition-base);
    text-align: center;
    padding-bottom: 1.5rem;
    position: relative;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.product-image-wrapper {
    width: 100%;
    height: 250px;
    background: #fff;
    /* White bg for products */
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 1rem;
}

.product-image-wrapper img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.5s ease;
}

.product-card:hover .product-image-wrapper img {
    transform: scale(1.08);
}

.product-title {
    margin-top: 1rem;
    font-size: 1.1rem;
    color: var(--text-main);
    font-weight: 700;
}

.product-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* How It Works Steps */
.how-it-works {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    text-align: center;
    max-width: 1000px;
    margin: 0 auto;
}

.step-card {
    background: rgba(15, 23, 42, 0.4);
    padding: 2rem;
    border-radius: 1rem;
    border: 1px solid var(--border-color);
    position: relative;
    transition: var(--transition-base);
}

.step-card:hover {
    background: rgba(15, 23, 42, 0.8);
    border-color: var(--primary-color);
}

.step-number {
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
    margin: 0 auto 1rem auto;
    box-shadow: 0 0 10px var(--primary-color);
}

.step-title {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: #fff;
}

.step-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.swiper {
    width: 100%;
    height: 100%;
    padding-bottom: 3rem !important;
    /* Space for pagination */
}

.swiper-pagination-bullet {
    background: var(--text-muted) !important;
}

.swiper-pagination-bullet-active {
    background: var(--primary-color) !important;
}