﻿@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;500;600;700&display=swap');

* {
    font-family: 'Vazirmatn', sans-serif;
}

:root {
    --primary-color: #0071bc;
    --secondary-color: #003d6b;
    --text-dark: #333;
    --text-light: #666;
    --border-color: #e0e0e0;
    --hover-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

body {
    background-color: #f8f9fa;
    direction: rtl;
}

/* Header Styles */
.top-header {
    background: white;
    padding: 15px 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.logo-section img {
    max-height: 60px;
}

.search-box {
    position: relative;
    z-index: 30;
}

    .search-box input {
        border-radius: 25px;
        padding: 10px 50px 10px 20px;
        border: 2px solid var(--border-color);
        transition: all 0.3s;
    }

        .search-box input:focus {
            border-color: var(--primary-color);
            box-shadow: 0 0 0 0.2rem rgba(0,113,188,0.15);
        }

    .search-box.active input {
        border-color: var(--primary-color);
        border-bottom-left-radius: 12px;
        border-bottom-right-radius: 12px;
    }

    .search-box button,
    .search-box .header-search-btn {
        position: absolute;
        left: 5px;
        top: 50%;
        transform: translateY(-50%);
        background: var(--primary-color);
        border: none;
        border-radius: 50%;
        width: 40px;
        height: 40px;
        color: white;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: background 0.25s;
        z-index: 2;
    }

        .search-box button:hover,
        .search-box .header-search-btn:hover {
            background: var(--secondary-color);
        }

.search-results {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    left: 0;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
    overflow: hidden;
    z-index: 40;
}

.search-results__list {
    max-height: 360px;
    overflow-y: auto;
}

.search-results__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s;
}

    .search-results__item:last-child {
        border-bottom: none;
    }

    .search-results__item:hover {
        background: rgba(0, 113, 188, 0.06);
        text-decoration: none;
        color: inherit;
    }

.search-results__image {
    width: 56px;
    height: 56px;
    border-radius: 10px;
    background: #f8f9fa;
    border: 1px solid var(--border-color);
    object-fit: contain;
    padding: 4px;
    flex-shrink: 0;
}

.search-results__meta {
    min-width: 0;
    flex: 1;
}

.search-results__name {
    display: block;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.5;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-results__code {
    display: block;
    font-size: 0.82rem;
    color: var(--text-light);
}

.search-results__status {
    padding: 18px 16px;
    text-align: center;
    color: var(--text-light);
    font-size: 0.9rem;
}

.search-results__status--loading {
    color: var(--primary-color);
}

.header-icons a {
    color: var(--text-dark);
    font-size: 22px;
    margin: 0 15px;
    position: relative;
    transition: color 0.3s;
}

    .header-icons a:hover {
        color: var(--primary-color);
    }

.cart-badge {
    position: absolute;
    top: -8px;
    left: -8px;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* User Dropdown Menu */
.user-dropdown {
    position: relative;
    display: inline-block;
}

.user-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
    min-width: 250px;
    z-index: 1000;
    display: none;
    margin-top: 10px;
    padding: 15px 0;
}

.user-dropdown:hover .user-dropdown-menu {
    display: block;
}

.user-dropdown-menu::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 20px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid white;
}

.user-info-header {
    padding: 10px 20px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 10px;
}

    .user-info-header .user-name {
        display: flex;
        align-items: center;
        gap: 10px;
        font-weight: 600;
        color: var(--text-dark);
        margin-bottom: 5px;
    }

        .user-info-header .user-name i {
            font-size: 18px;
            color: var(--primary-color);
        }

.user-wallet,
.user-credit {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-light);
    margin-top: 8px;
}

    .user-wallet i,
    .user-credit i {
        width: 1em;
        text-align: center;
        flex-shrink: 0;
    }

    .user-wallet i {
        color: #f39c12;
    }

    .user-credit i {
        color: var(--primary-color);
    }

    .user-credit strong {
        color: var(--text-dark);
    }

.user-dropdown-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

    .user-dropdown-menu ul li a {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 12px 20px;
        color: var(--text-dark);
        text-decoration: none;
        transition: all 0.3s;
        font-size: 14px;
    }

        .user-dropdown-menu ul li a:hover {
            background: #f8f9fa;
            color: var(--primary-color);
            padding-right: 25px;
        }

        .user-dropdown-menu ul li a i {
            width: 20px;
            text-align: center;
            color: var(--text-light);
        }

        .user-dropdown-menu ul li a:hover i {
            color: var(--primary-color);
        }

.user-dropdown-menu .logout-link {
    border-top: 1px solid var(--border-color);
    margin-top: 10px;
    padding-top: 10px;
}

    .user-dropdown-menu .logout-link a {
        color: #dc3545;
    }

        .user-dropdown-menu .logout-link a:hover {
            background: #fff5f5;
        }

        .user-dropdown-menu .logout-link a i {
            color: #dc3545;
        }

/* Navigation */
.main-nav {
    background: var(--primary-color);
    padding: 0;
}

    .main-nav .navbar-nav .nav-link {
        color: white;
        padding: 15px 25px;
        font-weight: 500;
        transition: background 0.3s;
    }

        .main-nav .navbar-nav .nav-link:hover {
            background: var(--secondary-color);
        }

/* Mobile Top Section Styles */
.mobile-top-section {
    width: 100%;
    padding: 15px 0;
    border-bottom: 1px solid rgba(255,255,255,0.2);
    margin-bottom: 10px;
}

.mobile-icons {
    display: flex;
    justify-content: space-around;
    gap: 20px;
}

    .mobile-icons a {
        color: white;
        text-decoration: none;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 5px;
        font-size: 14px;
    }

        .mobile-icons a i {
            font-size: 20px;
        }

.navbar-toggler {
    border-color: rgba(255,255,255,0.5);
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.85%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Slider Section */
.hero-slider {
    margin-top: 20px;
    border-radius: 15px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: var(--hover-shadow);
    background: #fff;
}

.hero-slider .carousel-inner {
    border-radius: 15px;
}

.hero-slider .carousel-item {
    height: auto;
    min-height: 420px;
    background: #fff;
}

.hero-slide {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    min-height: 420px;
    align-items: stretch;
}

.hero-slide-media {
    position: relative;
    overflow: hidden;
    background: linear-gradient(160deg, #f8f9fa 0%, #eef4f9 100%);
    min-height: 320px;
}

.hero-slide-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 28px 36px;
    transition: opacity 0.45s ease, transform 0.45s ease;
}

.hero-slide-img--primary {
    opacity: 1;
    z-index: 1;
}

.hero-slide-img--secondary {
    opacity: 0;
    z-index: 2;
}

.hero-slide-media--has-hover:hover .hero-slide-img--primary {
    opacity: 0;
    transform: scale(1.03);
}

.hero-slide-media--has-hover:hover .hero-slide-img--secondary {
    opacity: 1;
    transform: scale(1.03);
}

.hero-slide-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #c5cdd6;
    font-size: 3rem;
}

.hero-slide-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    text-align: right;
    padding: 40px 36px;
    background: linear-gradient(180deg, #ffffff 0%, #f7fbfe 100%);
    border-right: 1px solid var(--border-color);
}

.hero-slide-eyebrow {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary-color);
    background: rgba(0, 113, 188, 0.08);
    border: 1px solid rgba(0, 113, 188, 0.15);
    border-radius: 20px;
    padding: 6px 14px;
    margin-bottom: 14px;
    letter-spacing: 0.02em;
}

.hero-slide-title {
    font-size: 1.85rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0 0 14px;
    line-height: 1.35;
}

.hero-slide-desc {
    font-size: 0.95rem;
    color: var(--text-light);
    line-height: 1.8;
    margin: 0 0 24px;
    max-width: 36ch;
}

.hero-slider__nav {
    width: 48px;
    opacity: 1;
}

.hero-slider__nav-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    color: var(--primary-color);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
    font-size: 0.95rem;
    transition: background 0.25s, color 0.25s, transform 0.2s;
}

.hero-slider__nav:hover .hero-slider__nav-icon {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
    transform: scale(1.05);
}

.hero-slider .carousel-control-prev,
.hero-slider .carousel-control-next {
    background: transparent;
    width: 56px;
}

.hero-slider .carousel-indicators {
    margin-bottom: 14px;
}

.hero-slider .carousel-indicators [data-bs-target] {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: rgba(0, 113, 188, 0.35);
    border: none;
    opacity: 1;
    transition: width 0.25s, background-color 0.25s, border-radius 0.25s;
}

.hero-slider .carousel-indicators .active {
    width: 28px;
    border-radius: 8px;
    background-color: var(--primary-color);
}

.btn-buy-now {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-color);
    color: #fff;
    padding: 12px 28px;
    border-radius: 10px;
    font-weight: 600;
    border: none;
    text-decoration: none;
    transition: all 0.3s;
}

    .btn-buy-now:hover {
        background: var(--secondary-color);
        color: #fff;
        transform: translateY(-2px);
        box-shadow: 0 6px 16px rgba(0, 113, 188, 0.28);
    }

/* Legacy caption styles kept for safety */
.carousel-caption {
    background: rgba(0, 0, 0, 0.5);
    padding: 30px;
    border-radius: 15px;
    left: auto;
    text-align: right;
}

    .carousel-caption h2 {
        font-size: 2.5rem;
        font-weight: 700;
        margin-bottom: 15px;
    }

/* Section Titles */
.section-title {
    text-align: center;
    margin: 50px 0 30px;
    position: relative;
}

    .section-title h3 {
        font-size: 2rem;
        font-weight: 700;
        color: var(--text-dark);
        display: inline-block;
        padding: 0 20px;
        background: #f8f9fa;
        position: relative;
        z-index: 1;
    }

    .section-title::before {
        content: '';
        position: absolute;
        top: 50%;
        left: 0;
        right: 0;
        height: 2px;
        background: var(--border-color);
    }

/* Category Cards */
.category-card {
    background: white;
    border-radius: 15px;
    padding: 30px;
    text-align: center;
    transition: all 0.3s;
    border: 2px solid transparent;
    height: 100%;
    cursor: pointer;
}

    .category-card:hover {
        transform: translateY(-10px);
        box-shadow: var(--hover-shadow);
        border-color: var(--primary-color);
    }

    .category-card i {
        font-size: 3.5rem;
        color: var(--primary-color);
        margin-bottom: 15px;
    }

    .category-card h5 {
        font-weight: 600;
        color: var(--text-dark);
        margin-bottom: 10px;
    }

    .category-card p {
        color: var(--text-light);
        font-size: 0.9rem;
        margin: 0;
    }

/* Banner Section */
.promo-banner {
    border-radius: 15px;
    overflow: hidden;
    position: relative;
    height: 250px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-align: center;
    padding: 30px;
    transition: all 0.3s;
    cursor: pointer;
}

    .promo-banner:hover {
        transform: scale(1.02);
        box-shadow: var(--hover-shadow);
    }

    .promo-banner h4 {
        font-size: 1.8rem;
        font-weight: 700;
        margin-bottom: 10px;
    }

    .promo-banner p {
        font-size: 1.1rem;
        margin: 0;
    }

.promo-banner-1 {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.promo-banner-2 {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

/* Product Cards */
.product-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    transition: all 0.3s;
    border: 1px solid var(--border-color);
    height: 100%;
}

    .product-card:hover {
        transform: translateY(-5px);
        box-shadow: var(--hover-shadow);
    }

.product-image {
    position: relative;
    overflow: hidden;
    height: 250px;
    background: #f8f9fa;
}

    .product-image img {
        width: 100%;
        height: 100%;
        object-fit: contain;
        padding: 20px;
        transition: transform 0.3s;
    }

.product-card:hover .product-image img {
    transform: scale(1.1);
}

.product-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #dc3545;
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

    .product-badge.new {
        background: #28a745;
    }

.product-info {
    padding: 20px;
}

.product-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 10px;
    height: 48px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-price {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
}

.price-current {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-color);
}

.price-old {
    font-size: 1rem;
    color: #999;
    text-decoration: line-through;
}

.product-actions {
    display: flex;
    gap: 10px;
}

.btn-add-cart {
    flex: 1;
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 10px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s;
}

    .btn-add-cart:hover {
        background: var(--secondary-color);
        transform: translateY(-2px);
    }

.btn-view {
    background: #f8f9fa;
    color: var(--text-dark);
    border: 1px solid var(--border-color);
    padding: 10px 20px;
    border-radius: 8px;
    transition: all 0.3s;
}

    .btn-view:hover {
        background: var(--primary-color);
        color: white;
        border-color: var(--primary-color);
    }

/* Features Section */
.features-section {
    background: white;
    padding: 50px 0;
    margin: 50px 0;
    border-radius: 15px;
}

.feature-box {
    text-align: center;
    padding: 20px;
}

    .feature-box i {
        font-size: 3rem;
        color: var(--primary-color);
        margin-bottom: 15px;
    }

    .feature-box h5 {
        font-weight: 600;
        color: var(--text-dark);
        margin-bottom: 10px;
    }

    .feature-box p {
        color: var(--text-light);
        margin: 0;
        font-size: 0.9rem;
    }

/* Footer */
.main-footer {
    background: var(--primary-color);
    color: white;
    padding: 40px 0 20px;
    margin-top: 50px;
}

.footer-section h5 {
    font-weight: 700;
    margin-bottom: 20px;
}

.footer-section ul {
    list-style: none;
    padding: 0;
}

    .footer-section ul li {
        margin-bottom: 10px;
    }

        .footer-section ul li a {
            color: rgba(255,255,255,0.8);
            text-decoration: none;
            transition: color 0.3s;
        }

            .footer-section ul li a:hover {
                color: white;
                padding-right: 5px;
            }

.social-links a {
    display: inline-block;
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    text-align: center;
    line-height: 40px;
    margin-left: 10px;
    color: white;
    transition: all 0.3s;
    padding: 3px 0px 0px 0px;
}

    .social-links a:hover {
        background: white;
        color: var(--primary-color);
        transform: translateY(-3px);
    }

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    margin-top: 30px;
    padding-top: 20px;
    text-align: center;
}

/* Responsive */
@media (max-width: 991px) {
    .hero-slide {
        grid-template-columns: 1fr;
        min-height: 0;
    }

    .hero-slider .carousel-item {
        min-height: 0;
    }

    .hero-slide-media {
        min-height: 260px;
        height: 280px;
    }

    .hero-slide-content {
        border-right: none;
        border-top: 1px solid var(--border-color);
        padding: 28px 24px 36px;
        align-items: stretch;
    }

    .hero-slide-title {
        font-size: 1.4rem;
    }

    .hero-slide-desc {
        max-width: none;
        margin-bottom: 20px;
    }

    .btn-buy-now {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .hero-slide-media {
        height: 220px;
        min-height: 220px;
    }

    .hero-slide-img {
        padding: 16px;
    }

    .hero-slide-title {
        font-size: 1.25rem;
    }

    .section-title h3 {
        font-size: 1.5rem;
    }

    .category-card {
        margin-bottom: 20px;
    }

    .promo-banner {
        margin-bottom: 20px;
    }

    .hero-slider__nav {
        display: none;
    }
}

/* Prefer reduced motion / touch: keep primary image stable without relying on hover */
@media (hover: none) {
    .hero-slide-media--has-hover:hover .hero-slide-img--primary {
        opacity: 1;
        transform: none;
    }

    .hero-slide-media--has-hover:hover .hero-slide-img--secondary {
        opacity: 0;
        transform: none;
    }
}
