/**
 * DiamondTire - Components Stylesheet
 * Diamond Tire - استایل کامپوننت‌ها
 */

/* ============================================
   Header - هدر
   ============================================ */
.header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    box-shadow: var(--shadow-md);
}

.header-top {
    padding: var(--space-3) 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 0;
}

@media (min-width: 768px) {
    .header-main {
        gap: var(--space-6);
        padding: var(--space-4) 0;
    }
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: 4px 0;
}

.logo img {
    height: 44px;
    width: auto;
    margin-top: 2px;
}

@media (min-width: 768px) {
    .logo img {
        height: 60px;
        margin-top: 4px;
    }
}

@media (min-width: 1280px) {
    .logo img {
        height: 70px;
        margin-top: 4px;
    }
}

.logo-text {
    font-size: var(--font-size-2xl);
    font-weight: 800;
    color: var(--text-white);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.header-btn {
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    color: var(--text-white);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.header-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-white);
}

.header-btn i {
    font-size: 1.2rem;
}

.cart-count {
    position: absolute;
    top: 0;
    right: 0;
    transform: translate(35%, -35%);
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    background: var(--accent);
    color: white;
    border-radius: var(--radius-full);
}

/* ============================================
    Search Bar - نوار جستجو
    ============================================ */
.search-bar {
    flex: 1;
    min-width: 0;
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.dark .search-bar {
    background: var(--gray-100);
}

.search-bar input {
    flex: 1;
    padding: 8px 14px;
    font-size: 13px;
    background: transparent;
    border: none;
    outline: none;
    min-width: 0;
    min-height: 36px;
}

.search-bar .search-filter-btn {
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
    flex-shrink: 0;
}

@media (min-width: 768px) {
    .search-bar {
        max-width: 500px;
    }

    .search-bar input {
        padding: var(--space-3) var(--space-4);
        font-size: var(--font-size-base);
    }

    .search-bar .search-filter-btn {
        display: flex;
    }
}

.search-bar .search-filter-btn:hover {
    color: var(--secondary);
}

.search-bar .search-submit-btn {
    width: 34px;
    height: 34px;
    background: var(--secondary);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 2px;
    flex-shrink: 0;
    transition: background 0.2s;
    font-size: 13px;
}

@media (min-width: 768px) {
    .search-bar .search-submit-btn {
        width: 40px;
        height: 40px;
        font-size: var(--font-size-base);
    }
}

/* ============================================
    Navigation - منوی ناوبری
    ============================================ */
.nav {
    background: var(--primary-dark);
    display: none;
}

@media (min-width: 768px) {
    .nav {
        display: block;
    }
}

.nav-list {
    display: flex;
    align-items: center;
    list-style: none;
    gap: 0;
}

@media (min-width: 768px) {
    .nav-list {
        gap: var(--space-1);
    }
}

.nav-item {
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
    color: var(--text-white);
    font-weight: 500;
    font-size: 14px;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

@media (min-width: 768px) {
    .nav-link {
        padding: var(--space-4) var(--space-5);
        font-size: var(--font-size-base);
    }
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-white);
}

.nav-link i {
    font-size: 0.75rem;
    transition: transform var(--transition-fast);
}

.nav-item:hover .nav-link i {
    transform: rotate(180deg);
}

/* Dropdown Menu */
.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 220px;
    background: var(--bg-primary);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all var(--transition-fast);
    z-index: 1000;
}

.nav-item:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu a {
    display: block;
    padding: var(--space-3) var(--space-4);
    color: var(--text-primary);
    border-bottom: 1px solid var(--gray-100);
    transition: all var(--transition-fast);
}

.dropdown-menu a:hover {
    background: var(--gray-50);
    color: var(--secondary);
    padding-right: var(--space-6);
}

.dropdown-menu a:last-child {
    border-bottom: none;
}

/* ============================================
   Banner Slider - اسلایدر بنر
   ============================================ */
.banner-slider {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
    margin: var(--space-6) 0;
    box-shadow: var(--shadow-md);
    width: 100%;
    max-width: 1290px;
    margin-left: auto;
    margin-right: auto;
}

.banner-track {
    display: flex;
    transition: transform 0.5s cubic-bezier(0.25, 0.1, 0.25, 1);
    will-change: transform;
}

.banner-slide {
    min-width: 100%;
    width: 100%;
    height: 180px;
    position: relative;
    overflow: hidden;
    background: var(--gray-100);
    flex-shrink: 0;
}

.banner-slide img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    object-position: center;
    display: block;
}

@media (min-width: 640px) {
    .banner-slide,
    .banner-slide img {
        height: 240px;
    }
}

@media (min-width: 768px) {
    .banner-slide,
    .banner-slide img {
        height: 300px;
    }
}

@media (min-width: 1024px) {
    .banner-slide,
    .banner-slide img {
        height: 340px;
    }
}

@media (min-width: 1280px) {
    .banner-slide {
        max-width: 1290px;
    }

    .banner-slide,
    .banner-slide img {
        height: 400px;
    }
}

.banner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0,0,0,0.3), rgba(0,0,0,0.1));
    pointer-events: none;
}

.banner-content {
    position: absolute;
    bottom: 0;
    right: 0;
    left: 0;
    padding: var(--space-8);
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    color: white;
}

.banner-title {
    font-size: var(--font-size-3xl);
    margin-bottom: var(--space-2);
}

.banner-controls {
    position: absolute;
    bottom: var(--space-4);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: var(--space-2);
}

.banner-dot {
    width: 12px;
    height: 12px;
    background: rgba(255, 255, 255, 0.5);
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.banner-dot.active {
    background: white;
    width: 30px;
}

.banner-arrows {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    padding: 0 var(--space-4);
    pointer-events: none;
}

.banner-arrow {
    width: 40px;
    height: 40px;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    pointer-events: all;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow);
}

@media (min-width: 768px) {
    .banner-arrow {
        display: flex;
        width: 50px;
        height: 50px;
    }
}

.banner-arrow:hover {
    background: white;
    transform: scale(1.1);
}

/* ============================================
   Product Card - کارت محصول
   ============================================ */
.product-card {
    position: relative;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: all var(--transition);
}

.product-card:hover {
    transform: none;
    box-shadow: var(--shadow);
}

@media (min-width: 768px) {
    .product-card:hover {
        transform: translateY(-8px);
        box-shadow: var(--shadow-xl);
    }
}

.product-image {
    position: relative;
    height: 130px;
    overflow: hidden;
}

@media (min-width: 480px) {
    .product-image {
        height: 150px;
    }
}

@media (min-width: 768px) {
    .product-image {
        height: 190px;
    }
}

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

.product-card:hover .product-image img {
    transform: none;
}

@media (min-width: 768px) {
    .product-card:hover .product-image img {
        transform: scale(1.1);
    }
}

/* Floating Badges */
.product-badges {
    position: absolute;
    top: var(--space-3);
    right: var(--space-3);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.product-badge {
    padding: var(--space-1) var(--space-3);
    font-size: var(--font-size-xs);
    font-weight: 700;
    border-radius: var(--radius);
    backdrop-filter: blur(10px);
}

.product-badge.discount {
    background: var(--accent);
    color: white;
}

.product-badge.model {
    background: rgba(30, 58, 95, 0.9);
    color: white;
}

/* Stock Badge - always visible on mobile */
.stock-badge {
    position: absolute;
    bottom: var(--space-3);
    right: var(--space-3);
    padding: var(--space-1) var(--space-3);
    font-size: var(--font-size-xs);
    font-weight: 600;
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--radius);
    opacity: 1;
    transform: translateY(0);
    transition: all var(--transition-fast);
}

@media (min-width: 768px) {
    .stock-badge {
        opacity: 0;
        transform: translateY(10px);
    }

    .product-card:hover .stock-badge {
        opacity: 1;
        transform: translateY(0);
    }
}

.stock-badge.in-stock {
    color: var(--success);
}

.stock-badge.out-of-stock {
    color: var(--accent);
}

/* Product Actions in Card - always visible on mobile */
.product-card .product-actions {
    position: absolute;
    top: var(--space-3);
    left: var(--space-3);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    opacity: 1;
    transform: translateX(0);
    transition: all var(--transition-fast);
}

@media (min-width: 768px) {
    .product-card .product-actions {
        opacity: 0;
        transform: translateX(-10px);
    }

    .product-card:hover .product-actions {
        opacity: 1;
        transform: translateX(0);
    }
}

.product-action-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow);
    font-size: 13px;
}

@media (min-width: 768px) {
    .product-action-btn {
        width: 40px;
        height: 40px;
    }
}

.product-action-btn:hover {
    background: var(--secondary);
    color: white;
}

.product-action-btn.active {
    background: var(--accent);
    color: white;
}

/* Product Info */
.product-info {
    padding: 10px;
}

@media (min-width: 768px) {
    .product-info {
        padding: var(--space-4);
    }
}

.product-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.5;
    margin-bottom: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@media (min-width: 768px) {
    .product-name {
        font-size: var(--font-size-sm);
    }
}

.product-name-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
    margin-bottom: var(--space-2);
}

.product-name-row .product-name {
    margin-bottom: 0;
}

.product-rating-inline {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    flex-shrink: 0;
    color: var(--warning);
    font-size: 11px;
    white-space: nowrap;
}

.product-rating-inline .stars {
    color: #f59e0b;
    font-size: 11px;
    letter-spacing: 0;
    direction: ltr;
}

.product-rating-inline .rating-value {
    font-size: 10px;
    color: var(--text-secondary);
    font-weight: 500;
    direction: ltr;
}

.product-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: var(--space-2);
}

.product-tag {
    display: inline-block;
    padding: 2px 8px;
    font-size: 10px;
    font-weight: 500;
    color: var(--secondary);
    background: rgba(52, 152, 219, 0.1);
    border-radius: var(--radius-full);
    white-space: nowrap;
}

.product-brand {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: var(--space-1);
}

.product-brand-logo {
    width: 24px;
    height: 24px;
    object-fit: contain;
    border-radius: 4px;
}

.product-brand-name {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 500;
}

.product-brand-logo-badge {
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 80px;
    background: transparent;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    padding: 0;
    border: none;
    transition: transform 0.2s ease;
}

.product-brand-logo-badge:hover {
    transform: translateX(-50%) scale(1.1);
}

.product-brand-logo-badge img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.35));
}

.product-price {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-wrap: wrap;
}

.price-current {
    font-size: 13px;
    font-weight: 700;
    color: var(--success);
}

@media (min-width: 768px) {
    .price-current {
        font-size: var(--font-size-lg);
    }
}

.price-old {
    font-size: var(--font-size-sm);
    color: var(--text-light);
    text-decoration: line-through;
}

.price-contact {
    font-size: var(--font-size-sm);
    color: var(--secondary);
    font-weight: 600;
}

.price-contact.call-for-price {
    color: var(--accent);
    font-weight: 700;
}

.product-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: var(--space-3);
    padding-top: var(--space-3);
    border-top: 1px solid var(--gray-100);
}

.product-rating {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    color: var(--warning);
    font-size: var(--font-size-sm);
}

.add-to-cart-btn {
    padding: 6px 10px;
    background: linear-gradient(135deg, var(--secondary), var(--secondary-dark));
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

@media (min-width: 768px) {
    .add-to-cart-btn {
        padding: var(--space-2) var(--space-4);
        font-size: var(--font-size-sm);
        min-height: 36px;
    }
}

.add-to-cart-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.4);
}

.product-divider {
    height: 1px;
    background: var(--gray-200);
    margin: var(--space-2) 0;
}

.product-rating .stars {
    color: #f59e0b;
    font-size: 12px;
    letter-spacing: 1px;
}

.product-rating .rating-value {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 500;
}

.stock-status {
    font-size: 11px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

.stock-status.in {
    color: var(--success);
}

.stock-status.out {
    color: var(--accent);
}

/* ============================================
   Section Headers - عنوان بخش‌ها
   ============================================ */
.section {
    padding: 20px 0;
}

@media (min-width: 768px) {
    .section {
        padding: var(--space-12) 0;
    }
}

.section-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 16px;
}

@media (min-width: 768px) {
    .section-header {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        margin-bottom: var(--space-8);
        gap: var(--space-3);
    }
}

.section-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    position: relative;
    padding-right: 12px;
}

@media (min-width: 768px) {
    .section-title {
        font-size: var(--font-size-2xl);
        padding-right: var(--space-4);
    }
}

.section-title::before {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(to bottom, var(--secondary), var(--accent));
    border-radius: var(--radius);
}

.section-link {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--secondary);
    font-weight: 600;
}

.section-link:hover {
    gap: var(--space-3);
}

/* ============================================
   Products Grid - گرید محصولات (5 ستون در دسکتاپ)
   ============================================ */
.products-slider {
    position: relative;
}

.products-track {
    /* موبایل: 2 ستون */
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    overflow-x: visible;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 4px 0;
}

.products-track::-webkit-scrollbar {
    display: none;
}

.products-track .product-card {
    min-width: unset;
}

/* تبلت: 3 ستون */
@media (min-width: 480px) {
    .products-track {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }
}

/* دسکتاپ کوچک: 4 ستون */
@media (min-width: 768px) {
    .products-track {
        grid-template-columns: repeat(4, 1fr);
        gap: var(--space-4);
        padding: var(--space-2);
    }
}

/* دسکتاپ بزرگ: 5 ستون */
@media (min-width: 1024px) {
    .products-track {
        grid-template-columns: repeat(5, 1fr);
        gap: var(--space-4);
    }
}

.more-card {
    min-width: unset;
    grid-column: span 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-4);
    background: linear-gradient(135deg, var(--gray-50), var(--gray-100));
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition);
    padding: var(--space-6);
}

@media (min-width: 768px) {
    .more-card {
        padding: var(--space-8);
    }
}

.more-card:hover {
    border-color: var(--secondary);
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.05), rgba(52, 152, 219, 0.1));
}

.more-card i {
    font-size: 2.5rem;
    color: var(--secondary);
}

@media (min-width: 768px) {
    .more-card i {
        font-size: 3rem;
    }
}

.more-card span {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 13px;
}

@media (min-width: 768px) {
    .more-card span {
        font-size: var(--font-size-base);
    }
}
