/* ==================== MODERN UI SPECIFICATION & VARIABLES ==================== */
:root {
    /* Rəng Palitrası */
    --primary: #0077b6;
    --primary-light: #0594b1;
    --primary-gradient: linear-gradient(135deg, #0077b6, #0594b1);
    --secondary: #2563eb;
    --secondary-glow: rgba(37, 99, 235, 0.15);

    /* Neytral Rənglər */
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-light: #e2e8f0;
    --border-focus: #cbd5e1;

    /* İnteraktiv effektlər */
    --shadow-sm: 0 4px 12px rgba(15, 23, 42, 0.03);
    --shadow-md: 0 12px 34px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 20px 40px rgba(15, 23, 42, 0.12);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    /* Kənarların Yuvarlaqlığı */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

/* Global Səhifə Tənzimləməsi */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==================== GLOBAL SECTION SETUP ==================== */
section,
.products-section {
    /* 🔥 MAKSİMUM SIXLIQ: Üst və alt boşluqlar minimuma endirildi */
    padding: 10px 0;
    position: relative;
}

/* ==================== HERO PAGE TITLE SECTION ==================== */
.page-title {
    position: relative;
    text-align: center;
    /* 🔥 MAKSİMUM SIXLIQ: Başlıq sahəsi tamamilə yuxarı sıxıldı */
    padding: 10px 0 5px 0;
    margin: 30px 0;
}

/* BREADCRUMB (Naviqasiya Zənciri) */
.page-title .breadcrumb {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
}

.page-title .breadcrumb a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.25s ease;
}

.page-title .breadcrumb a:hover,
.page-title .breadcrumb a.active {
    color: var(--primary);
}

.page-title .breadcrumb span {
    font-size: 10px;
    opacity: 0.5;
    color: var(--text-muted);
}

/* ƏSAS BAŞLIQ */
.page-title h1 {
    font-size: clamp(28px, 4vw, 36px);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.03em;
    margin: 0 auto 5px auto;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

.page-title h1::after {
    content: "";
    display: block;
    width: 40px;
    height: 3px;
    background: var(--primary-gradient);
    border-radius: 10px;
    margin: 6px auto 0 auto;
    transition: width 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.page-title:hover h1::after {
    width: 70px;
    /* Hover effekti bərpa olundu */
}

/* ALT AÇIQLAMA MƏTNİ */
.page-title p {
    color: var(--text-muted);
    font-size: clamp(14px, 1.5vw, 16px);
    font-weight: 400;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.5;
}

/* ==================== ULTRA-MODERN SEARCH BAR ==================== */
.search-section {
    padding: 8px 0;
}

.search-wrapper {
    position: relative;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 16px;
    pointer-events: none;
    transition: var(--transition);
}

.search-box {
    width: 100%;
    padding: 12px 20px 12px 44px;
    border-radius: 100px;
    border: 1px solid var(--border-light);
    background-color: var(--bg-card);
    box-shadow: var(--shadow-sm);
    font-size: 15px;
    color: var(--text-main);
    outline: none;
    transition: var(--transition);
}

.search-box:focus {
    border-color: var(--secondary);
    box-shadow: 0 0 0 4px var(--secondary-glow);
    transform: translateY(-1px);
}

.search-wrapper:focus-within .search-icon {
    color: var(--secondary);
    /* Hover/Focus effekti bərpa olundu */
}

/* ==================== PREMIUM SEGMENTED FILTERS ==================== */
.filter-section {
    margin-bottom: 12px;
    /* Məhsullara maksimum yaxın mövqe */
    padding: 4px 0;
}

.filter-buttons {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 0 20px;
}

.filter-btn,
.firma-btn {
    padding: 8px 16px;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid var(--border-light);
    background-color: var(--bg-card);
    color: var(--text-muted);
    box-shadow: var(--shadow-sm);
}

.filter-btn:hover,
.firma-btn:hover {
    color: var(--text-main);
    border-color: var(--border-focus);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    /* Hover bərpa olundu */
}

.filter-btn.active,
.firma-btn.active {
    background: var(--secondary);
    color: #ffffff !important;
    border-color: var(--secondary);
    box-shadow: 0 4px 14px var(--secondary-glow);
    transform: translateY(0);
}

/* ==================== COMPACT PRODUCTS GRID ==================== */
#product-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
    /* Kartlar arası boşluq daha da yığcamlaşdırıldı */
    padding: 0 20px;
    position: relative;
    z-index: 2;
}

/* ==================== PREMIUM PRODUCT CARD UI ==================== */
.product-card {
    height: 400px;
    box-sizing: border-box;
    /* Ölçülərin dəqiq 400px qalması üçün */
    margin-top: 0;
    background: var(--bg-card);
    padding: 15px;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(15, 23, 42, 0.06);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.product-card:hover {
    transform: translateY(-6px);
    /* Premium hover animasiyası bərpa olundu */
    border-color: rgba(0, 119, 182, 0.2);
    box-shadow: var(--shadow-md);
}

/* Professional Şəkil Sahəsi */
.product-image-wrapper {
    height: 200px;
    /* Kart daxilində şəkilə ayrılan net sahə stabilləşdirildi */
    width: 100%;
    background: white;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
    /* Şəklin sıxılmasının qarşısını alır */
}

.product-image-wrapper img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    transition: var(--transition);
}

.product-card:hover .product-image-wrapper img {
    transform: scale(1.05);
    /* Şəkil böyümə hoveri bərpa olundu */
}

/* Məhsul İnformasiya Bloku */
.product-info {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    /* Daxili elementləri yuxarıdan aşağıya bərabər paylayır */
    flex-grow: 1;
    margin-top: 12px;
    overflow: hidden;
}

/* 🔥 BREND STİLİ: Silinmiş brend dizaynı tam bərpa olundu */
.product-brand {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--primary);
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    display: block;
    line-height: 1.2;
}

/* Məhsul Başlığı */
.product-card h3,
.product-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-main);
    margin: 0 0 8px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 38px;
    /* Sətir sayından asılı olmayaraq başlıq sahəsi sabitləndi */
    transition: color var(--transition);
}

.product-card:hover h3,
.product-card:hover .product-title {
    color: var(--primary);
    /* Başlığın rəng dəyişmə hoveri bərpa olundu */
}

/* Qiymət Sahəsi */
.product-price {
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    margin: auto 0 8px 0;
    /* Boşluğu yuxarıdan avtomatik götürüb aşağıda sabit qalır */
    letter-spacing: -0.01em;
    line-height: 1.2;
}

/* Səbətə At Düyməsi */
.add-to-cart-btn {
    width: 100%;
    padding: 11px 14px;
    border-radius: var(--radius-md);
    border: none;
    background: var(--primary);
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    /* Düymənin sıxılmasını tamamilə bloklayır */
}

.add-to-cart-btn:hover {
    background: #0f172a;
    /* Düymə hover rəngi bərpa olundu */
    box-shadow: 0 6px 20px rgba(0, 119, 182, 0.25);
}

/* ==================== OUT OF STOCK STATE ==================== */
.product-card.out-of-stock {
    opacity: 0.65;
    filter: grayscale(60%);
}

.badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: #ef4444;
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    z-index: 3;
}

.product-card.out-of-stock .add-to-cart-btn {
    background: #64748b;
    color: #ffffff;
    cursor: not-allowed;
    box-shadow: none !important;
}

/* ==================== SƏBƏT SAHƏSİ LAYOUT (DAXİLİ) ==================== */
.cart-layout {
    display: grid;
    grid-template-columns: 2.5fr 1fr;
    gap: 32px;
    padding: 0 20px;
}

.cart-item {
    display: flex;
    gap: 20px;
    padding: 20px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    margin-bottom: 16px;
    align-items: center;
    box-shadow: var(--shadow-sm);
}

.cart-summary {
    background: #0f172a;
    color: #ffffff;
    padding: 30px;
    border-radius: var(--radius-lg);
    height: fit-content;
    box-shadow: var(--shadow-md);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 16px;
    color: #94a3b8;
    font-size: 14px;
}

.summary-row.total {
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
    border-top: 1px solid #334155;
    padding-top: 16px;
    margin-top: 16px;
}

/* ==================== FIXED & DYNAMIC PAGINATION UI ==================== */
#pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin: 30px 0;
    flex-wrap: wrap;
}

#pagination button {
    padding: 8px 14px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #0f172a;
    font-weight: 600;
    font-size: 14px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

#pagination button:hover:not(:disabled) {
    background: #0f172a;
    color: white;
    border-color: #0f172a;
}

#pagination button.active {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

#pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f1f5f9;
}

.discount-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: red;
    color: white;
    padding: 4px 8px;
    font-size: 12px;
    border-radius: 6px;
    font-weight: bold;
    z-index: 3;
}

/* ==================== RESPONSIVE TƏNZİMLƏMƏLƏR ==================== */
@media (max-width: 1200px) {
    #product-list {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 902px) {
    .cart-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    #product-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .product-card {
        padding: 12px;
        height: 380px;
        /* Mobil cihazlarda daha yaxşı görünüş üçün bir qədər yığcamlaşdırıldı */
    }

    .product-image-wrapper {
        height: 180px;
        padding: 4px;
    }

    .product-card h3,
    .product-title {
        font-size: 13px;
        height: 36px;
    }
}

@media (max-width: 600px) {
    .filter-buttons {
        justify-content: flex-start;
        overflow-x: auto;
        white-space: nowrap;
        padding: 4px 20px 12px 20px;
        margin: 0 -20px;
        -webkit-overflow-scrolling: touch;
    }

    .filter-buttons::-webkit-scrollbar {
        display: none;
    }

    .filter-btn,
    .firma-btn {
        font-size: 12px;
        padding: 8px 16px;
        flex-shrink: 0;
    }
}

@media (max-width: 400px) {
    #product-list {
        grid-template-columns: 1fr;
    }

    .product-card {
        height: 400px;
        /* Tək sətirli tam kart görünüşü üçün yenidən 400px */
    }
}