/* ===== ASOSIY STILLAR ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --dark: #1f2937;
    --gray: #6b7280;
    --light: #f3f4f6;
    --white: #ffffff;
    --shadow: 0 2px 15px rgba(0,0,0,0.08);
    --radius: 12px;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--light);
    color: var(--dark);
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* ===== HEADER ===== */
.header {
    background: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-top {
    background: var(--primary);
    color: var(--white);
    padding: 8px 0;
    font-size: 14px;
}

.header-top .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-main {
    padding: 15px 0;
}

.header-main .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.logo {
    font-size: 28px;
    font-weight: 800;
    color: var(--primary);
}

.logo span {
    color: var(--secondary);
}

/* Қидирув */
.search-box {
    flex: 1;
    max-width: 500px;
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 12px 45px 12px 20px;
    border: 2px solid #e5e7eb;
    border-radius: 25px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.3s;
}

.search-box input:focus {
    border-color: var(--primary);
}

.search-box button {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary);
    color: var(--white);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
}

/* Хедер иконкалар */
.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-actions a {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--dark);
    transition: color 0.3s;
}

.header-actions a:hover {
    color: var(--primary);
}

.cart-badge {
    position: relative;
}

.cart-badge .badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--danger);
    color: var(--white);
    font-size: 11px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

/* ===== НАВИГАЦИЯ ===== */
.nav {
    background: var(--white);
    border-top: 1px solid #e5e7eb;
}

.nav ul {
    list-style: none;
    display: flex;
    gap: 5px;
    padding: 10px 0;
    overflow-x: auto;
}

.nav ul li a {
    display: block;
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.3s;
}

.nav ul li a:hover,
.nav ul li a.active {
    background: var(--primary);
    color: var(--white);
}

/* ===== СЛАЙДЕР ===== */
.hero-slider {
    margin: 20px 0;
    border-radius: var(--radius);
    overflow: hidden;
}

.hero-slider img {
    width: 100%;
    height: 350px;
    object-fit: cover;
}

.hero-banner {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--white);
    padding: 60px 40px;
    border-radius: var(--radius);
    margin: 20px 0;
}

.hero-banner h1 {
    font-size: 36px;
    margin-bottom: 15px;
}

.hero-banner p {
    font-size: 18px;
    opacity: 0.9;
    margin-bottom: 25px;
}

/* ===== МАҲСУЛОТЛАР ===== */
.section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 30px 0 20px;
}

.section-title h2 {
    font-size: 24px;
    font-weight: 700;
}

.section-title a {
    color: var(--primary);
    font-size: 14px;
    font-weight: 600;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.product-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

.product-card .badge-discount {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--danger);
    color: var(--white);
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 700;
}

.product-card .badge-new {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--secondary);
    color: var(--white);
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 700;
}

.product-card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.product-card .product-info {
    padding: 15px;
}

.product-card .product-category {
    font-size: 12px;
    color: var(--gray);
    margin-bottom: 5px;
}

.product-card .product-name {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card .product-price {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.product-card .current-price {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
}

.product-card .old-price {
    font-size: 14px;
    color: var(--gray);
    text-decoration: line-through;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-success {
    background: var(--secondary);
    color: var(--white);
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
}

.add-to-cart {
    width: 100%;
    padding: 10px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.add-to-cart:hover {
    background: var(--primary-dark);
}

/* ===== КАТЕГОРИЯ СЕТКА ===== */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.category-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 25px 15px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: all 0.3s;
}

.category-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.category-card .icon {
    font-size: 40px;
    margin-bottom: 10px;
}

.category-card h3 {
    font-size: 15px;
    font-weight: 600;
}

/* ===== МАҲСУЛОТ САҲИФАСИ ===== */
.product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    background: var(--white);
    border-radius: var(--radius);
    padding: 30px;
    margin: 20px 0;
    box-shadow: var(--shadow);
}

.product-detail .product-images img {
    width: 100%;
    border-radius: var(--radius);
}

.product-detail .product-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 15px;
}

.product-detail .product-price-block {
    margin: 20px 0;
}

.product-detail .price-current {
    font-size: 32px;
    font-weight: 800;
    color: var(--primary);
}

.product-detail .price-old {
    font-size: 20px;
    color: var(--gray);
    text-decoration: line-through;
    margin-left: 15px;
}

.quantity-selector {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 20px 0;
}

.quantity-selector button {
    width: 40px;
    height: 40px;
    border: 2px solid #e5e7eb;
    background: var(--white);
    border-radius: 8px;
    font-size: 18px;
    cursor: pointer;
}

.quantity-selector input {
    width: 60px;
    height: 40px;
    text-align: center;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 16px;
}

/* ===== САВАТЧА ===== */
.cart-page {
    margin: 20px 0;
}

.cart-table {
    width: 100%;
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.cart-table th {
    background: var(--light);
    padding: 15px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
}

.cart-table td {
    padding: 15px;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: middle;
}

.cart-table .cart-product {
    display: flex;
    align-items: center;
    gap: 15px;
}

.cart-table .cart-product img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 8px;
}

.cart-summary {
    background: var(--white);
    border-radius: var(--radius);
    padding: 25px;
    box-shadow: var(--shadow);
    margin-top: 20px;
}

.cart-summary .summary-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #e5e7eb;
}

.cart-summary .summary-total {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
}

/* ===== БУЮРТМА ФОРМАСИ ===== */
.checkout-form {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 30px;
    margin: 20px 0;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 14px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--primary);
}

/* ===== FOOTER ===== */
.footer {
    background: var(--dark);
    color: var(--white);
    padding: 50px 0 20px;
    margin-top: 40px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    margin-bottom: 30px;
}

.footer-col h3 {
    font-size: 18px;
    margin-bottom: 15px;
}

.footer-col ul {
    list-style: none;
}

.footer-col ul li {
    margin-bottom: 8px;
}

.footer-col ul li a {
    color: #9ca3af;
    transition: color 0.3s;
    font-size: 14px;
}

.footer-col ul li a:hover {
    color: var(--white);
}

.footer-bottom {
    border-top: 1px solid #374151;
    padding-top: 20px;
    text-align: center;
    color: #9ca3af;
    font-size: 14px;
}

/* ===== МОБИЛ ===== */
@media (max-width: 768px) {
    .header-main .container {
        flex-wrap: wrap;
    }
    
    .search-box {
        order: 3;
        max-width: 100%;
        width: 100%;
        margin-top: 10px;
    }
    
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .product-detail {
        grid-template-columns: 1fr;
    }
    
    .checkout-form {
        grid-template-columns: 1fr;
    }
    
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .hero-banner h1 {
        font-size: 24px;
    }
    
    .nav ul {
        padding: 8px 0;
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .product-card img {
        height: 160px;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== ALERT ===== */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}

/* ===== ПАГИНАЦИЯ ===== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin: 30px 0;
}

.pagination a, .pagination span {
    padding: 8px 15px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
}

.pagination a {
    background: var(--white);
    box-shadow: var(--shadow);
}

.pagination a:hover {
    background: var(--primary);
    color: var(--white);
}

.pagination .current {
    background: var(--primary);
    color: var(--white);
}

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state .icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 22px;
    margin-bottom: 10px;
}

.empty-state p {
    color: var(--gray);
    margin-bottom: 20px;
}

# 🔄 MinimAll.uz — Бошидан тўлиқ яратиш

## 📋 Қадам 1: Базани тозалаш ва яратиш

### phpMyAdmin → SQL:

```sql
-- =============================================
-- БАРЧАСИНИ ТОЗАЛАШ
-- =============================================
SET FOREIGN_KEY_CHECKS = 0;
DROP TABLE IF EXISTS order_items;
DROP TABLE IF EXISTS orders;
DROP TABLE IF EXISTS products;
DROP TABLE IF EXISTS categories;
DROP TABLE IF EXISTS admins;
DROP TABLE IF EXISTS sliders;
DROP TABLE IF EXISTS settings;
SET FOREIGN_KEY_CHECKS = 1;

-- =============================================
-- ЖАДВАЛЛАР ЯРАТИШ
-- =============================================

CREATE TABLE categories (
    id INT AUTO_INCREMENT PRIMARY KEY,
    name VARCHAR(255) NOT NULL,
    slug VARCHAR(255) NOT NULL,
    icon VARCHAR(100) DEFAULT NULL,
    image VARCHAR(255) DEFAULT NULL,
    parent_id INT DEFAULT 0,
    sort_order INT DEFAULT 0,
    status TINYINT(1) DEFAULT 1,
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

CREATE TABLE products (
    id INT AUTO_INCREMENT PRIMARY KEY,
    category_id INT NOT NULL,
    name VARCHAR(255) NOT NULL,
    slug VARCHAR(255) NOT NULL,
    description TEXT,
    price DECIMAL(12,2) NOT NULL,
    old_price DECIMAL(12,2) DEFAULT NULL,
    image VARCHAR(255) DEFAULT NULL,
    images TEXT DEFAULT NULL,
    stock INT DEFAULT 0,
    views INT DEFAULT 0,
    featured TINYINT(1) DEFAULT 0,
    status TINYINT(1) DEFAULT 1,
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    FOREIGN KEY (category_id) REFERENCES categories(id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

CREATE TABLE orders (
    id INT AUTO_INCREMENT PRIMARY KEY,
    order_number VARCHAR(50) NOT NULL,
    customer_name VARCHAR(255) NOT NULL,
    customer_phone VARCHAR(20) NOT NULL,
    customer_address TEXT,
    customer_comment TEXT,
    total_amount DECIMAL(12,2) NOT NULL,
    delivery_type ENUM('delivery','pickup') DEFAULT 'delivery',
    payment_type ENUM('cash','card','click','payme') DEFAULT 'cash',
    status ENUM('new','processing','shipped','delivered','cancelled') DEFAULT 'new',
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

CREATE TABLE order_items (
    id INT AUTO_INCREMENT PRIMARY KEY,
    order_id INT NOT NULL,
    product_id INT NOT NULL,
    product_name VARCHAR(255) NOT NULL,
    price DECIMAL(12,2) NOT NULL,
    quantity INT NOT NULL,
    total DECIMAL(12,2) NOT NULL,
    FOREIGN KEY (order_id) REFERENCES orders(id),
    FOREIGN KEY (product_id) REFERENCES products(id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

CREATE TABLE admins (
    id INT AUTO_INCREMENT PRIMARY KEY,
    username VARCHAR(100) NOT NULL,
    password VARCHAR(255) NOT NULL,
    name VARCHAR(255) NOT NULL,
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

CREATE TABLE sliders (
    id INT AUTO_INCREMENT PRIMARY KEY,
    title VARCHAR(255),
    image VARCHAR(255) NOT NULL,
    link VARCHAR(255),
    sort_order INT DEFAULT 0,
    status TINYINT(1) DEFAULT 1
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

CREATE TABLE settings (
    id INT AUTO_INCREMENT PRIMARY KEY,
    setting_key VARCHAR(100) NOT NULL UNIQUE,
    setting_value TEXT
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;


-- =============================================
-- АДМИН (логин: admin, парол: admin123)
-- =============================================
INSERT INTO admins (username, password, name) VALUES 
('admin', '$2y$10$N9qo8uLOickgx2ZMRZoMyeIjZAgcfl7p92ldGxad68LJZdL17lhWy', 'Administrator');


-- =============================================
-- СОЗЛАМАЛАР
-- =============================================
INSERT INTO settings (setting_key, setting_value) VALUES
('site_name', 'MinimAll.uz'),
('site_phone', '+998 90 123 45 67'),
('site_phone2', '+998 91 234 56 78'),
('site_email', 'info@minimall.uz'),
('site_address', 'Тошкент шаҳри, Чилонзор тумани'),
('telegram_bot_token', ''),
('telegram_chat_id', ''),
('telegram_channel', '@minimalluz'),
('instagram', 'minimalluz'),
('delivery_price', '0'),
('min_order_amount', '100000'),
('currency', 'сўм'),
('working_hours', '09:00 — 21:00');


-- =============================================
-- КАТЕГОРИЯЛАР
-- =============================================
INSERT INTO categories (id, name, slug, icon, parent_id, sort_order, status) VALUES

-- АСОСИЙ КАТЕГОРИЯЛАР
(1,   'Тренажорлар',             'trenajorlar',           'fas fa-dumbbell',          0,  1,  1),
(2,   'Кардио тренажорлар',      'kardio-trenajorlar',    'fas fa-heartbeat',         0,  2,  1),
(3,   'Эркин оғирликлар',        'erkin-ogirliklar',      'fas fa-weight-hanging',    0,  3,  1),
(4,   'Спорт озиқланиш',         'sport-oziqlanish',      'fas fa-blender',           0,  4,  1),
(5,   'Аксессуарлар',            'aksessuarlar',          'fas fa-toolbox',           0,  5,  1),
(6,   'Спорт кийимлар',          'sport-kiyimlar',        'fas fa-tshirt',            0,  6,  1),
(7,   'Единоборствалар',         'edinoborstvalar',       'fas fa-fist-raised',       0,  7,  1),
(8,   'Йога ва фитнес',          'yoga-fitnes',           'fas fa-spa',               0,  8,  1),
(9,   'Уй спорт заллари',        'uy-sport-zallari',      'fas fa-home',              0,  9,  1),
(10,  'Профессионал жиҳозлар',   'professional-jihozlar', 'fas fa-warehouse',         0,  10, 1),

-- ТРЕНАЖОРЛАР ИЧКИ (parent_id = 1)
(11,  'Кўкрак тренажорлари',     'kokrak-trenajor',       'fas fa-expand-arrows-alt', 1, 1, 1),
(12,  'Елка тренажорлари',       'yelka-trenajor',        'fas fa-arrows-alt',        1, 2, 1),
(13,  'Орқа тренажорлари',       'orqa-trenajor',         'fas fa-compress-arrows-alt',1, 3, 1),
(14,  'Оёқ тренажорлари',        'oyoq-trenajor',         'fas fa-shoe-prints',       1, 4, 1),
(15,  'Қўл тренажорлари',        'qol-trenajor',          'fas fa-hand-rock',         1, 5, 1),
(16,  'Пресс тренажорлари',      'press-trenajor',        'fas fa-stream',            1, 6, 1),
(17,  'Мультистанция',           'multistansiya',         'fas fa-th',                1, 7, 1),
(18,  'Кроссовер',               'krossover',             'fas fa-exchange-alt',      1, 8, 1),
(19,  'Смит машинаси',           'smit-mashinasi',        'fas fa-grip-lines-vertical',1, 9, 1),
(20,  'Блок тренажорлар',        'blok-trenajor',         'fas fa-cube',              1, 10, 1),
(21,  'Комбо тренажорлар',       'combo-trenajor',        'fas fa-layer-group',       1, 11, 1),

-- КАРДИО ИЧКИ (parent_id = 2)
(22,  'Югуриш йўлкаси',          'yugurish-yolkasi',      'fas fa-running',           2, 1, 1),
(23,  'Велотренажор',             'velotrenajor',          'fas fa-biking',            2, 2, 1),
(24,  'Эллиптик тренажор',       'elliptik-trenajor',     'fas fa-sync-alt',          2, 3, 1),
(25,  'Гребной тренажор',        'grebnoy-trenajor',      'fas fa-water',             2, 4, 1),
(26,  'Степпер',                  'stepper',               'fas fa-sort-amount-up',    2, 5, 1),
(27,  'Спин-байк',                'spin-bayk',             'fas fa-compact-disc',      2, 6, 1),
(28,  'Орбитрек',                 'orbitrek',              'fas fa-circle-notch',      2, 7, 1),
(29,  'Климбер',                  'klimber',               'fas fa-mountain',          2, 8, 1),

-- ЭРКИН ОҒИРЛИКЛАР ИЧКИ (parent_id = 3)
(30,  'Штангалар',                'shtangalar',            'fas fa-grip-lines',        3, 1, 1),
(31,  'Гантеллар',                'gantellar',             'fas fa-dumbbell',          3, 2, 1),
(32,  'Гиря (Кеттлбелл)',        'girya-kettlbell',       'fas fa-bowling-ball',      3, 3, 1),
(33,  'Блинлар (диск)',           'blinlar-disk',          'fas fa-circle',            3, 4, 1),
(34,  'Олимпик штанга',           'olimpik-shtanga',       'fas fa-medal',             3, 5, 1),
(35,  'EZ штанга',                'ez-shtanga',            'fas fa-wave-square',       3, 6, 1),
(36,  'Штанга стойкалар',         'shtanga-stoykalar',     'fas fa-columns',           3, 7, 1),
(37,  'Гантель стойкалар',        'gantel-stoykalar',      'fas fa-server',            3, 8, 1),
(38,  'Пауэр рэк',               'power-rek',             'fas fa-border-all',        3, 9, 1),
(39,  'Скамейкалар',              'skameykalar',           'fas fa-couch',             3, 10, 1),

-- СПОРТ ОЗИҚЛАНИШ ИЧКИ (parent_id = 4)
(40,  'Протеин',                  'protein',               'fas fa-flask',             4, 1, 1),
(41,  'Гейнер',                   'geyner',                'fas fa-weight-hanging',    4, 2, 1),
(42,  'BCAA / Аминокислоталар',   'bcaa-amino',            'fas fa-atom',              4, 3, 1),
(43,  'Креатин',                  'kreatin',               'fas fa-bolt',              4, 4, 1),
(44,  'Витаминлар',               'vitaminlar',            'fas fa-capsules',          4, 5, 1),
(45,  'Ёғ ёқувчилар',             'yog-yoquvchilar',       'fas fa-fire-alt',          4, 6, 1),
(46,  'Предтреник',               'predtrenik',            'fas fa-rocket',            4, 7, 1),

-- АКСЕССУАРЛАР ИЧКИ (parent_id = 5)
(47,  'Шейкерлар',                'sheykerlar',            'fas fa-blender',           5, 1, 1),
(48,  'Спорт қўлқоплар',          'sport-qolqoplar',       'fas fa-mitten',            5, 2, 1),
(49,  'Атлетик камарлар',         'atletik-kamarlar',      'fas fa-ring',              5, 3, 1),
(50,  'Фитнес резинкалар',        'fitnes-rezinkalar',     'fas fa-circle-notch',      5, 4, 1),
(51,  'Эспандерлар',              'espanderlar',           'fas fa-grip-lines',        5, 5, 1),
(52,  'Скакалкалар',              'skakalka',              'fas fa-wave-square',       5, 6, 1),
(53,  'Турник ва брусья',         'turnik-brusya',         'fas fa-grip-lines-vertical',5, 7, 1),
(54,  'Массаж роликлар',          'massaj-roliklar',       'fas fa-basketball-ball',   5, 8, 1),
(55,  'Спорт сумкалар',           'sport-sumkalar',        'fas fa-bag-shopping',      5, 9, 1),

-- СПОРТ КИЙИМЛАР ИЧКИ (parent_id = 6)
(56,  'Футболкалар',              'futbolkalar',           'fas fa-tshirt',            6, 1, 1),
(57,  'Шортлар',                  'shortlar',              'fas fa-running',           6, 2, 1),
(58,  'Спорт шимлар',             'sport-shimlar',         'fas fa-male',              6, 3, 1),
(59,  'Толстовка / Худи',         'tolstovka-xudi',        'fas fa-vest',              6, 4, 1),
(60,  'Спорт пойабзаллар',        'sport-poyabzallar',     'fas fa-shoe-prints',       6, 5, 1),

-- ЕДИНОБОРСТВАЛАР ИЧКИ (parent_id = 7)
(61,  'Бокс қўлқоплари',          'boks-qolqoplari',       'fas fa-hand-rock',         7, 1, 1),
(62,  'Бокс грушаси',             'boks-grushasi',         'fas fa-bullseye',          7, 2, 1),
(63,  'Кимоно',                   'kimono',                'fas fa-user-ninja',        7, 3, 1),
(64,  'Шлемлар',                  'shlemlar',              'fas fa-hard-hat',          7, 4, 1),

-- ЙОГА ВА ФИТНЕС ИЧКИ (parent_id = 8)
(65,  'Йога коврик',              'yoga-kovrik',           'fas fa-pray',              8, 1, 1),
(66,  'Фитбол',                   'fitbol',                'fas fa-futbol',            8, 2, 1),
(67,  'Медбол',                   'medbol',                'fas fa-bowling-ball',      8, 3, 1),
(68,  'TRX / Петлялар',           'trx-petlyalar',         'fas fa-link',              8, 4, 1),

-- УЙ СПОРТ ЗАЛЛАРИ ИЧКИ (parent_id = 9)
(69,  'Уй тренировка тўплами',   'uy-trenirovka-toplami', 'fas fa-box-open',          9, 1, 1),
(70,  'Мини тренажорлар',         'mini-trenajorlar',      'fas fa-compress-alt',      9, 2, 1),
(71,  'Уй кардио жиҳозлари',     'uy-kardio',             'fas fa-heartbeat',         9, 3, 1),

-- ПРОФЕССИОНАЛ ИЧКИ (parent_id = 10)
(72,  'Hammer Strength',          'hammer-strength',       'fas fa-hammer',            10, 1, 1),
(73,  'Plate Loaded',             'plate-loaded',          'fas fa-circle',            10, 2, 1),
(74,  'Кабелли тренажорлар',     'kabelli-trenajorlar',   'fas fa-link',              10, 3, 1),
(75,  'Функционал тренинг',      'funktsional-trening',   'fas fa-project-diagram',   10, 4, 1),
(76,  'Зал лойиҳалаш',           'zal-loyihalash',        'fas fa-drafting-compass',  10, 5, 1);
```

---

## 📋 Қадам 2: Файл структураси

Хостингда шу файлларни яратинг:

```
minimall.uz/
├── config.php
├── index.php
├── product.php
├── product-card.php
├── cart.php
├── checkout.php
├── admin/
│   ├── login.php
│   ├── index.php
│   ├── products.php
│   ├── orders.php
│   ├── categories.php
│   ├── settings.php
│   ├── export.php
│   └── logout.php
├── css/
│   └── style.css
├── js/
│   └── main.js
└── uploads/
    └── no-image.jpg
```

---

## 📋 Қадам 3: `config.php`

```php
<?php
session_start();

define('DB_HOST', 'localhost');
define('DB_NAME', '6a0c37093dd48_minimalluz');
define('DB_USER', '6a0c37093dd48_minimalluz');
define('DB_PASS', 'ПАРОЛИНГИЗНИ_ЁЗИНГ');

define('SITE_URL', 'https://minimall.uz');
define('UPLOAD_DIR', __DIR__ . '/uploads/');

try {
    $db = new PDO(
        "mysql:host=" . DB_HOST . ";dbname=" . DB_NAME . ";charset=utf8mb4",
        DB_USER, DB_PASS,
        [PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
         PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC]
    );
} catch (PDOException $e) {
    die("Хатолик: " . $e->getMessage());
}

function getSetting($key) {
    global $db;
    $stmt = $db->prepare("SELECT setting_value FROM settings WHERE setting_key = ?");
    $stmt->execute([$key]);
    $row = $stmt->fetch();
    return $row ? $row['setting_value'] : '';
}

function formatPrice($price) {
    return number_format($price, 0, '', ' ') . ' сўм';
}

function createSlug($text) {
    $map = ['а'=>'a','б'=>'b','в'=>'v','г'=>'g','д'=>'d','е'=>'e','ё'=>'yo','ж'=>'zh','з'=>'z','и'=>'i','й'=>'y','к'=>'k','л'=>'l','м'=>'m','н'=>'n','о'=>'o','п'=>'p','р'=>'r','с'=>'s','т'=>'t','у'=>'u','ф'=>'f','х'=>'kh','ц'=>'ts','ч'=>'ch','ш'=>'sh','щ'=>'shch','ъ'=>'','ы'=>'y','ь'=>'','э'=>'e','ю'=>'yu','я'=>'ya','ў'=>'o','қ'=>'q','ғ'=>'g','ҳ'=>'h'];
    $text = mb_strtolower($text, 'UTF-8');
    $text = strtr($text, $map);
    $text = preg_replace('/[^a-z0-9\s-]/', '', $text);
    $text = preg_replace('/[\s-]+/', '-', $text);
    return trim($text, '-');
}

function getCart() { return $_SESSION['cart'] ?? []; }

function getCartTotal() {
    $total = 0;
    foreach (getCart() as $item) $total += $item['price'] * $item['quantity'];
    return $total;
}

function getCartCount() {
    $count = 0;
    foreach (getCart() as $item) $count += $item['quantity'];
    return $count;
}

function getSubCategories($db, $parentId) {
    $stmt = $db->prepare("SELECT * FROM categories WHERE parent_id = ? AND status = 1 ORDER BY sort_order");
    $stmt->execute([$parentId]);
    return $stmt->fetchAll();
}

function getCatProductCount($db, $catId) {
    $stmt = $db->prepare("SELECT COUNT(*) FROM products WHERE status = 1 AND (category_id = ? OR category_id IN (SELECT id FROM categories WHERE parent_id = ?))");
    $stmt->execute([$catId, $catId]);
    return $stmt->fetchColumn();
}

function sendTelegram($message) {
    $token = getSetting('telegram_bot_token');
    $chatId = getSetting('telegram_chat_id');
    if (empty($token) || empty($chatId)) return false;
    $url = "https://api.telegram.org/bot{$token}/sendMessage";
    $ch = curl_init();
    curl_setopt_array($ch, [CURLOPT_URL => $url, CURLOPT_POST => true, CURLOPT_POSTFIELDS => ['chat_id' => $chatId, 'text' => $message, 'parse_mode' => 'HTML'], CURLOPT_RETURNTRANSFER => true]);
    $result = curl_exec($ch);
    curl_close($ch);
    return $result;
}
?>
```

---

## 📋 Қадам 4: `css/style.css`

```css
*{margin:0;padding:0;box-sizing:border-box}
:root{
    --primary:#2563eb;--primary-dark:#1d4ed8;--secondary:#10b981;
    --danger:#ef4444;--warning:#f59e0b;--dark:#1f2937;--gray:#6b7280;
    --light:#f3f4f6;--white:#fff;--shadow:0 2px 15px rgba(0,0,0,0.08);--radius:12px;
}
body{font-family:'Segoe UI',Tahoma,sans-serif;background:var(--light);color:var(--dark);line-height:1.6}
a{text-decoration:none;color:inherit}
img{max-width:100%}
.container{max-width:1200px;margin:0 auto;padding:0 15px}

/* HEADER */
.header{background:var(--white);box-shadow:var(--shadow);position:sticky;top:0;z-index:1000}
.header-top{background:linear-gradient(135deg,#1e3a5f,#0f172a);color:var(--white);padding:8px 0;font-size:13px}
.header-top .container{display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:10px}
.header-top a{color:var(--white);margin-left:15px;transition:opacity .3s}
.header-top a:hover{opacity:.8}
.header-main{padding:12px 0}
.header-main .container{display:flex;justify-content:space-between;align-items:center;gap:15px}
.logo{font-size:26px;font-weight:800;color:var(--primary);white-space:nowrap}
.logo span{color:var(--secondary)}

/* Каталог тугма */
.catalog-btn{display:flex;align-items:center;gap:8px;padding:11px 22px;background:var(--primary);color:var(--white);border:none;border-radius:10px;font-size:14px;font-weight:600;cursor:pointer;transition:background .3s;white-space:nowrap}
.catalog-btn:hover{background:var(--primary-dark)}
.catalog-btn .hamburger{display:flex;flex-direction:column;gap:3px}
.catalog-btn .hamburger span{display:block;width:16px;height:2px;background:var(--white);border-radius:2px;transition:all .3s}

/* Қидирув */
.search-box{flex:1;max-width:500px;position:relative}
.search-box input{width:100%;padding:11px 45px 11px 18px;border:2px solid #e5e7eb;border-radius:25px;font-size:14px;outline:none;transition:border-color .3s}
.search-box input:focus{border-color:var(--primary)}
.search-box button{position:absolute;right:4px;top:50%;transform:translateY(-50%);background:var(--primary);color:var(--white);border:none;width:34px;height:34px;border-radius:50%;cursor:pointer;font-size:14px}

/* Хедер амаллар */
.header-actions{display:flex;align-items:center;gap:18px}
.header-actions a{display:flex;align-items:center;gap:6px;font-size:13px;color:var(--dark);transition:color .3s;white-space:nowrap}
.header-actions a:hover{color:var(--primary)}
.cart-badge{position:relative}
.cart-badge .badge{position:absolute;top:-8px;right:-8px;background:var(--danger);color:var(--white);font-size:11px;width:20px;height:20px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-weight:700}

/* МЕГА МЕНЮ */
.mega-wrap{position:relative}
.mega-menu{position:absolute;top:calc(100% + 5px);left:0;width:850px;background:var(--white);border-radius:0 14px 14px 14px;box-shadow:0 15px 40px rgba(0,0,0,.15);display:none;z-index:999;overflow:hidden}
.mega-menu.active{display:flex}
.mega-left{width:260px;background:#f8fafc;border-right:1px solid #e5e7eb;max-height:480px;overflow-y:auto}
.mega-left a{display:flex;align-items:center;gap:10px;padding:13px 18px;font-size:13px;font-weight:500;color:var(--dark);transition:all .2s;border-left:3px solid transparent}
.mega-left a:hover,.mega-left a.active{background:var(--white);color:var(--primary);border-left-color:var(--primary)}
.mega-left a i{width:18px;text-align:center;font-size:15px;color:var(--primary)}
.mega-left a .arr{margin-left:auto;font-size:11px;color:#ccc}
.mega-right{flex:1;padding:22px;display:none}
.mega-right.active{display:block}
.mega-right h4{font-size:15px;margin-bottom:12px;padding-bottom:8px;border-bottom:2px solid var(--primary);color:var(--primary)}
.mega-sub{display:grid;grid-template-columns:repeat(2,1fr);gap:6px}
.mega-sub a{display:flex;align-items:center;gap:7px;padding:9px 12px;border-radius:7px;font-size:13px;color:var(--dark);transition:all .2s}
.mega-sub a:hover{background:#f0f7ff;color:var(--primary)}
.mega-sub a i{color:var(--primary);font-size:13px;width:16px;text-align:center}

/* ГЕРО СЕКЦИЯ */
.hero{display:grid;grid-template-columns:250px 1fr;gap:18px;margin:18px 0}
.hero-cats{background:var(--white);border-radius:14px;box-shadow:var(--shadow);overflow:hidden}
.hero-cats h3{padding:14px 16px;font-size:14px;font-weight:700;background:var(--primary);color:var(--white);display:flex;align-items:center;gap:8px}
.hero-cats ul{list-style:none;padding:4px 0}
.hero-cats ul li a{display:flex;align-items:center;gap:9px;padding:10px 16px;font-size:13px;color:var(--dark);transition:all .2s}
.hero-cats ul li a:hover{background:#f0f7ff;color:var(--primary);padding-left:20px}
.hero-cats ul li a i{width:18px;text-align:center;color:var(--primary);font-size:14px}
.hero-banner{border-radius:14px;overflow:hidden;background:linear-gradient(135deg,#1e3a5f,#0f172a);display:flex;align-items:center;padding:40px 45px;min-height:370px}
.hero-content{max-width:480px;color:var(--white)}
.hero-label{display:inline-block;background:var(--danger);padding:4px 14px;border-radius:18px;font-size:12px;font-weight:700;margin-bottom:12px}
.hero-content h1{font-size:32px;font-weight:800;line-height:1.2;margin-bottom:12px}
.hero-content p{font-size:15px;opacity:.85;margin-bottom:22px;line-height:1.6}

/* УСТУНЛИКЛАР */
.advs{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin:22px 0}
.adv-card{background:var(--white);padding:16px;border-radius:10px;display:flex;align-items:center;gap:12px;box-shadow:var(--shadow)}
.adv-icon{width:44px;height:44px;background:linear-gradient(135deg,#eff6ff,#dbeafe);border-radius:10px;display:flex;align-items:center;justify-content:center;font-size:18px;color:var(--primary);flex-shrink:0}
.adv-card h4{font-size:13px;margin-bottom:1px}
.adv-card p{font-size:11px;color:var(--gray)}

/* КАТЕГОРИЯ СКРОЛЛ */
.cat-scroll{display:flex;gap:10px;overflow-x:auto;padding:18px 0;scrollbar-width:none}
.cat-scroll::-webkit-scrollbar{display:none}
.cat-card{min-width:120px;background:var(--white);border-radius:14px;padding:18px 12px;text-align:center;box-shadow:var(--shadow);transition:all .3s;cursor:pointer;border:2px solid transparent}
.cat-card:hover,.cat-card.active{border-color:var(--primary);transform:translateY(-3px);box-shadow:0 8px 25px rgba(37,99,235,.15)}
.cat-icon{width:50px;height:50px;background:linear-gradient(135deg,#eff6ff,#dbeafe);border-radius:12px;display:flex;align-items:center;justify-content:center;margin:0 auto 8px;font-size:20px;color:var(--primary)}
.cat-card:hover .cat-icon{background:linear-gradient(135deg,var(--primary),var(--primary-dark));color:var(--white)}
.cat-card h4{font-size:12px;font-weight:600;line-height:1.3}
.cat-card .cat-cnt{font-size:10px;color:var(--gray);margin-top:3px}

/* СЕКЦИЯ САРЛАВҲА */
.sec-title{display:flex;justify-content:space-between;align-items:center;margin:28px 0 16px}
.sec-title h2{font-size:22px;font-weight:700}
.sec-title a{color:var(--primary);font-size:13px;font-weight:600}

/* МАҲСУЛОТ ГРИД */
.products-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:16px;margin-bottom:28px}
.product-card{background:var(--white);border-radius:var(--radius);overflow:hidden;box-shadow:var(--shadow);transition:transform .3s,box-shadow .3s;position:relative}
.product-card:hover{transform:translateY(-4px);box-shadow:0 8px 25px rgba(0,0,0,.1)}
.product-card .badge-disc{position:absolute;top:8px;left:8px;background:var(--danger);color:var(--white);padding:3px 9px;border-radius:12px;font-size:11px;font-weight:700}
.product-card img{width:100%;height:200px;object-fit:cover}
.product-card .p-info{padding:12px}
.product-card .p-cat{font-size:11px;color:var(--gray);margin-bottom:4px}
.product-card .p-name{font-size:13px;font-weight:600;margin-bottom:8px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;min-height:36px}
.product-card .p-price{display:flex;align-items:center;gap:8px;margin-bottom:10px}
.product-card .cur-price{font-size:16px;font-weight:700;color:var(--primary)}
.product-card .old-price{font-size:12px;color:var(--gray);text-decoration:line-through}
.add-cart-btn{width:100%;padding:9px;background:var(--primary);color:var(--white);border:none;border-radius:7px;font-size:13px;font-weight:600;cursor:pointer;transition:background .3s}
.add-cart-btn:hover{background:var(--primary-dark)}

/* САЙДБАР LAYOUT */
.page-sidebar{display:grid;grid-template-columns:250px 1fr;gap:22px;margin:18px 0}
.sidebar{position:sticky;top:90px;align-self:start}
.sb-card{background:var(--white);border-radius:14px;box-shadow:var(--shadow);overflow:hidden;margin-bottom:18px}
.sb-card h3{padding:14px 18px;font-size:15px;background:var(--primary);color:var(--white);margin:0}
.sb-card ul{list-style:none;padding:6px 0}
.sb-card ul li a{display:flex;align-items:center;gap:9px;padding:10px 18px;font-size:13px;color:var(--dark);transition:all .2s;border-left:3px solid transparent}
.sb-card ul li a:hover,.sb-card ul li a.active{background:#f0f7ff;color:var(--primary);border-left-color:var(--primary)}
.sb-card ul li a i{width:16px;text-align:center;color:var(--primary);font-size:13px}
.sb-card ul li a .cnt{margin-left:auto;font-size:11px;color:var(--gray)}
.sb-card ul li.sub a{padding-left:36px;font-size:12px}

/* МАҲСУЛОТ САҲИФА */
.p-detail{display:grid;grid-template-columns:1fr 1fr;gap:35px;background:var(--white);border-radius:var(--radius);padding:28px;margin:18px 0;box-shadow:var(--shadow)}
.p-detail img{width:100%;border-radius:var(--radius)}
.p-detail .p-title{font-size:26px;font-weight:700;margin-bottom:12px}
.p-detail .price-cur{font-size:30px;font-weight:800;color:var(--primary)}
.p-detail .price-old{font-size:18px;color:var(--gray);text-decoration:line-through;margin-left:12px}
.qty-sel{display:flex;align-items:center;gap:12px;margin:18px 0}
.qty-sel button{width:38px;height:38px;border:2px solid #e5e7eb;background:var(--white);border-radius:8px;font-size:16px;cursor:pointer}
.qty-sel input{width:55px;height:38px;text-align:center;border:2px solid #e5e7eb;border-radius:8px;font-size:15px}

/* КНОПКИ */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:7px;padding:10px 18px;border:none;border-radius:8px;font-size:13px;font-weight:600;cursor:pointer;transition:all .3s}
.btn-primary{background:var(--primary);color:var(--white)}
.btn-primary:hover{background:var(--primary-dark)}
.btn-success{background:var(--secondary);color:var(--white)}
.btn-danger{background:var(--danger);color:var(--white)}
.btn-outline{background:transparent;border:2px solid var(--primary);color:var(--primary)}
.btn-block{width:100%}
.btn-sm{padding:6px 11px;font-size:12px}
.btn-lg{padding:13px 26px;font-size:15px}

/* САВАТЧА */
.cart-table{width:100%;background:var(--white);border-radius:var(--radius);overflow:hidden;box-shadow:var(--shadow)}
.cart-table th{background:var(--light);padding:12px;text-align:left;font-weight:600;font-size:13px}
.cart-table td{padding:12px;border-bottom:1px solid #e5e7eb;vertical-align:middle;font-size:13px}
.cart-table .cart-prod{display:flex;align-items:center;gap:12px}
.cart-table .cart-prod img{width:60px;height:60px;object-fit:cover;border-radius:8px}
.cart-sum{background:var(--white);border-radius:var(--radius);padding:22px;box-shadow:var(--shadow);margin-top:18px}
.cart-sum .sum-row{display:flex;justify-content:space-between;padding:8px 0;border-bottom:1px solid #e5e7eb}
.cart-sum .sum-total{font-size:20px;font-weight:700;color:var(--primary)}

/* ФОРМА */
.form-group{margin-bottom:16px}
.form-group label{display:block;margin-bottom:5px;font-weight:600;font-size:13px}
.form-group input,.form-group textarea,.form-group select{width:100%;padding:10px 14px;border:2px solid #e5e7eb;border-radius:8px;font-size:14px;outline:none;transition:border-color .3s}
.form-group input:focus,.form-group textarea:focus,.form-group select:focus{border-color:var(--primary)}
.checkout-form{display:grid;grid-template-columns:1.4fr 1fr;gap:25px;margin:18px 0}

/* ФУТЕР */
.footer{background:var(--dark);color:var(--white);padding:45px 0 18px;margin-top:35px}
.footer-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:28px;margin-bottom:28px}
.footer-col h3{font-size:16px;margin-bottom:14px}
.footer-col ul{list-style:none}
.footer-col ul li{margin-bottom:7px}
.footer-col ul li a{color:#9ca3af;font-size:13px;transition:color .3s}
.footer-col ul li a:hover{color:var(--white)}
.footer-bottom{border-top:1px solid #374151;padding-top:18px;text-align:center;color:#9ca3af;font-size:13px}
.social-links{display:flex;gap:8px;margin-top:12px}
.social-links a{width:34px;height:34px;background:#374151;border-radius:8px;display:flex;align-items:center;justify-content:center;color:#fff;transition:background .3s}
.social-links a:hover{background:var(--primary)}

/* ALERT */
.alert{padding:14px 18px;border-radius:8px;margin-bottom:18px;font-size:13px}
.alert-success{background:#d1fae5;color:#065f46;border:1px solid #6ee7b7}
.alert-error{background:#fee2e2;color:#991b1b;border:1px solid #fca5a5}

/* EMPTY */
.empty-state{text-align:center;padding:50px 18px}
.empty-state .icon{font-size:56px;margin-bottom:16px}
.empty-state h3{font-size:20px;margin-bottom:8px}
.empty-state p{color:var(--gray);margin-bottom:18px}

/* МОБИЛ */
@media(max-width:768px){
    .header-main .container{flex-wrap:wrap}
    .search-box{order:3;max-width:100%;width:100%;margin-top:8px}
    .products-grid{grid-template-columns:repeat(2,1fr);gap:8px}
    .product-card img{height:150px}
    .hero{grid-template-columns:1fr}
    .hero-cats{display:none}
    .page-sidebar{grid-template-columns:1fr}
    .sidebar{display:none}
    .p-detail{grid-template-columns:1fr;padding:18px}
    .checkout-form{grid-template-columns:1fr}
    .footer-grid{grid-template-columns:repeat(2,1fr)}
    .advs{grid-template-columns:repeat(2,1fr)}
    .hero-banner{padding:25px;min-height:230px}
    .hero-content h1{font-size:22px}
    .mega-menu{width:100%;left:-100px}
    .catalog-btn{padding:9px 14px;font-size:13px}
}
@media(max-width:480px){
    .products-grid{grid-template-columns:repeat(2,1fr);gap:6px}
    .product-card img{height:130px}
    .footer-grid{grid-template-columns:1fr}
    .advs{grid-template-columns:1fr}
}
```

---

## 📋 Қадам 5: `index.php`

```php
<?php
require_once 'config.php';

$mainCats = $db->query("SELECT * FROM categories WHERE status=1 AND parent_id=0 ORDER BY sort_order")->fetchAll();
$allCats = $db->query("SELECT * FROM categories WHERE status=1 ORDER BY sort_order")->fetchAll();
$subCats = [];
foreach($allCats as $c) if($c['parent_id']>0) $subCats[$c['parent_id']][] = $c;

$featured = $db->query("SELECT p.*,c.name as category_name FROM products p LEFT JOIN categories c ON p.category_id=c.id WHERE p.status=1 AND p.featured=1 ORDER BY p.created_at DESC LIMIT 8")->fetchAll();
$newest = $db->query("SELECT p.*,c.name as category_name FROM products p LEFT JOIN categories c ON p.category_id=c.id WHERE p.status=1 ORDER BY p.created_at DESC LIMIT 12")->fetchAll();
$discounted = $db->query("SELECT p.*,c.name as category_name FROM products p LEFT JOIN categories c ON p.category_id=c.id WHERE p.status=1 AND p.old_price>0 AND p.old_price>p.price ORDER BY p.created_at DESC LIMIT 8")->fetchAll();

$cat_id = isset($_GET['category']) ? (int)$_GET['category'] : 0;
$search = isset($_GET['q']) ? trim($_GET['q']) : '';
$products = []; $curCat = null;

if($cat_id > 0){
    $ids = [$cat_id];
    $s = $db->prepare("SELECT id FROM categories WHERE parent_id=?"); $s->execute([$cat_id]);
    while($r=$s->fetch()) $ids[]=$r['id'];
    $ph = implode(',', array_fill(0,count($ids),'?'));
    $st = $db->prepare("SELECT p.*,c.name as category_name FROM products p LEFT JOIN categories c ON p.category_id=c.id WHERE p.status=1 AND p.category_id IN ($ph) ORDER BY p.created_at DESC");
    $st->execute($ids); $products=$st->fetchAll();
    $cs=$db->prepare("SELECT * FROM categories WHERE id=?"); $cs->execute([$cat_id]); $curCat=$cs->fetch();
} elseif(!empty($search)){
    $st=$db->prepare("SELECT p.*,c.name as category_name FROM products p LEFT JOIN categories c ON p.category_id=c.id WHERE p.status=1 AND (p.name LIKE ? OR p.description LIKE ?) ORDER BY p.created_at DESC");
    $st->execute(["%$search%","%$search%"]); $products=$st->fetchAll();
}

$siteName=getSetting('site_name'); $sitePhone=getSetting('site_phone');
?>
<!DOCTYPE html>
<html lang="uz">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<title><?=$siteName?> — Тренажорлар ва спорт жиҳозлари</title>
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.0/css/all.min.css">
</head>
<body>

<header class="header">
    <div class="header-top">
        <div class="container">
            <span><i class="fas fa-truck"></i> Тошкент бўйлаб бепул доставка</span>
            <div>
                <a href="https://t.me/<?=getSetting('telegram_channel')?>"><i class="fab fa-telegram"></i> Telegram</a>
                <a href="https://instagram.com/<?=getSetting('instagram')?>"><i class="fab fa-instagram"></i> Instagram</a>
                <a href="tel:<?=$sitePhone?>"><i class="fas fa-phone"></i> <?=$sitePhone?></a>
            </div>
        </div>
    </div>
    <div class="header-main">
        <div class="container">
            <a href="/" class="logo"><i class="fas fa-bolt" style="color:var(--secondary)"></i> Minim<span>All</span></a>
            
            <div class="mega-wrap">
                <button class="catalog-btn" onclick="toggleMega()">
                    <div class="hamburger"><span></span><span></span><span></span></div> Каталог
                </button>
                <div class="mega-menu" id="megaMenu">
                    <div class="mega-left">
                        <?php foreach($mainCats as $i=>$mc): ?>
                        <a href="?category=<?=$mc['id']?>" onmouseenter="showSub(<?=$mc['id']?>)" class="<?=$i===0?'active':''?>">
                            <i class="<?=$mc['icon']?>"></i> <?=htmlspecialchars($mc['name'])?>
                            <?php if(isset($subCats[$mc['id']])): ?><span class="arr"><i class="fas fa-chevron-right"></i></span><?php endif;?>
                        </a>
                        <?php endforeach;?>
                    </div>
                    <?php foreach($mainCats as $i=>$mc): if(isset($subCats[$mc['id']])): ?>
                    <div class="mega-right <?=$i===0?'active':''?>" id="sub-<?=$mc['id']?>">
                        <h4><i class="<?=$mc['icon']?>"></i> <?=htmlspecialchars($mc['name'])?></h4>
                        <div class="mega-sub">
                            <a href="?category=<?=$mc['id']?>"><i class="fas fa-th-large"></i> Барчаси</a>
                            <?php foreach($subCats[$mc['id']] as $sc): ?>
                            <a href="?category=<?=$sc['id']?>"><i class="<?=$sc['icon']?>"></i> <?=htmlspecialchars($sc['name'])?></a>
                            <?php endforeach;?>
                        </div>
                    </div>
                    <?php endif; endforeach;?>
                </div>
            </div>
            
            <form class="search-box" action="/" method="GET">
                <input type="text" name="q" placeholder="Маҳсулот қидириш..." value="<?=htmlspecialchars($search)?>">
                <button type="submit"><i class="fas fa-search"></i></button>
            </form>
            
            <div class="header-actions">
                <a href="tel:<?=$sitePhone?>"><i class="fas fa-phone" style="font-size:18px"></i></a>
                <a href="cart.php" class="cart-badge">
                    <i class="fas fa-shopping-cart" style="font-size:20px"></i>
                    <?php if(getCartCount()>0):?><div class="badge"><?=getCartCount()?></div><?php endif;?>
                </a>
            </div>
        </div>
    </div>
</header>

<main class="container">
<?php if(!$cat_id && empty($search)): ?>

<div class="hero">
    <div class="hero-cats">
        <h3><i class="fas fa-bars"></i> Категориялар</h3>
        <ul>
        <?php foreach($mainCats as $mc): ?>
            <li><a href="?category=<?=$mc['id']?>"><i class="<?=$mc['icon']?>"></i> <?=htmlspecialchars($mc['name'])?></a></li>
        <?php endforeach;?>
        </ul>
    </div>
    <div class="hero-banner">
        <div class="hero-content">
            <span class="hero-label">🔥 ЯНГИ КОЛЛЕКЦИЯ</span>
            <h1>Тренажорлар ва спорт жиҳозлари</h1>
            <p>Оригинал маҳсулотлар, тезкор доставка ва кафолат. Уйингизга ёки залингизга — ҳамма нарса бизда!</p>
            <a href="?category=1" class="btn btn-lg" style="background:#fff;color:var(--primary)">Каталогни кўриш →</a>
        </div>
    </div>
</div>

<div class="advs">
    <div class="adv-card"><div class="adv-icon"><i class="fas fa-truck"></i></div><div><h4>Бепул доставка</h4><p>Тошкент бўйлаб</p></div></div>
    <div class="adv-card"><div class="adv-icon"><i class="fas fa-certificate"></i></div><div><h4>Оригинал</h4><p>Кафолатли маҳсулот</p></div></div>
    <div class="adv-card"><div class="adv-icon"><i class="fas fa-tools"></i></div><div><h4>Ўрнатиш</h4><p>Бепул йиғиб берамиз</p></div></div>
    <div class="adv-card"><div class="adv-icon"><i class="fas fa-headset"></i></div><div><h4>Қўллаб-қувватлаш</h4><p>24/7 алоқада</p></div></div>
</div>

<div class="sec-title"><h2>📂 Категориялар</h2></div>
<div class="cat-scroll">
    <?php foreach($mainCats as $mc): ?>
    <a href="?category=<?=$mc['id']?>" class="cat-card">
        <div class="cat-icon"><i class="<?=$mc['icon']?>"></i></div>
        <h4><?=htmlspecialchars($mc['name'])?></h4>
        <div class="cat-cnt"><?=getCatProductCount($db,$mc['id'])?> та</div>
    </a>
    <?php endforeach;?>
</div>

<?php if(count($discounted)>0): ?>
<div class="sec-title"><h2>🔥 Чегирмалар</h2></div>
<div class="products-grid">
    <?php foreach($discounted as $product): ?><?php include 'product-card.php';?><?php endforeach;?>
</div>
<?php endif;?>

<?php if(count($featured)>0): ?>
<div class="sec-title"><h2>⭐ Танланган</h2></div>
<div class="products-grid">
    <?php foreach($featured as $product): ?><?php include 'product-card.php';?><?php endforeach;?>
</div>
<?php endif;?>

<?php if(count($newest)>0): ?>
<div class="sec-title"><h2>🆕 Янги маҳсулотлар</h2></div>
<div class="products-grid">
    <?php foreach($newest as $product): ?><?php include 'product-card.php';?><?php endforeach;?>
</div>
<?php endif;?>

<?php else: ?>

<div class="page-sidebar">
    <aside class="sidebar">
        <div class="sb-card">
            <h3><i class="fas fa-bars"></i> Категориялар</h3>
            <ul>
                <li><a href="/" class="<?=!$cat_id?'active':''?>"><i class="fas fa-th-large"></i> Барчаси</a></li>
                <?php foreach($mainCats as $mc): ?>
                <li><a href="?category=<?=$mc['id']?>" class="<?=$cat_id==$mc['id']?'active':''?>">
                    <i class="<?=$mc['icon']?>"></i> <?=htmlspecialchars($mc['name'])?> <span class="cnt"><?=getCatProductCount($db,$mc['id'])?></span>
                </a></li>
                <?php if(isset($subCats[$mc['id']])): foreach($subCats[$mc['id']] as $sc): ?>
                <li class="sub"><a href="?category=<?=$sc['id']?>" class="<?=$cat_id==$sc['id']?'active':''?>">
                    <i class="<?=$sc['icon']?>"></i> <?=htmlspecialchars($sc['name'])?>
                </a></li>
                <?php endforeach; endif; endforeach;?>
            </ul>
        </div>
    </aside>
    <div>
        <div style="padding:8px 0;font-size:13px;color:var(--gray)">
            <a href="/" style="color:var(--primary)">🏠 Бош саҳифа</a>
            <?php if($curCat):?>
                <?php if($curCat['parent_id']>0): $ps=$db->prepare("SELECT * FROM categories WHERE id=?");$ps->execute([$curCat['parent_id']]);$pc=$ps->fetch();?>
                → <a href="?category=<?=$pc['id']?>" style="color:var(--primary)"><?=htmlspecialchars($pc['name'])?></a>
                <?php endif;?>
                → <?=htmlspecialchars($curCat['name'])?>
            <?php elseif(!empty($search)):?> → "<?=htmlspecialchars($search)?>"<?php endif;?>
        </div>
        
        <div class="sec-title">
            <h2><?php if($curCat):?><i class="<?=$curCat['icon']?>" style="color:var(--primary)"></i> <?=htmlspecialchars($curCat['name'])?><?php elseif(!empty($search)):?>🔍 "<?=htmlspecialchars($search)?>"<?php endif;?></h2>
            <span style="color:var(--gray);font-size:13px"><?=count($products)?> маҳсулот</span>
        </div>
        
        <?php if($curCat && isset($subCats[$curCat['id']])): ?>
        <div class="cat-scroll" style="margin-bottom:12px">
            <a href="?category=<?=$curCat['id']?>" class="cat-card active"><div class="cat-icon"><i class="fas fa-th-large"></i></div><h4>Барчаси</h4></a>
            <?php foreach($subCats[$curCat['id']] as $sc): ?>
            <a href="?category=<?=$sc['id']?>" class="cat-card <?=$cat_id==$sc['id']?'active':''?>"><div class="cat-icon"><i class="<?=$sc['icon']?>"></i></div><h4><?=htmlspecialchars($sc['name'])?></h4></a>
            <?php endforeach;?>
        </div>
        <?php endif;?>
        
        <?php if(empty($products)): ?>
        <div class="empty-state"><div class="icon">🔍</div><h3>Маҳсулот топилмади</h3><p>Бошқа категорияни танланг</p><a href="/" class="btn btn-primary">Бош саҳифага</a></div>
        <?php else: ?>
        <div class="products-grid">
            <?php foreach($products as $product): ?><?php include 'product-card.php';?><?php endforeach;?>
        </div>
        <?php endif;?>
    </div>
</div>
<?php endif;?>
</main>

<footer class="footer">
    <div class="container">
        <div class="footer-grid">
            <div class="footer-col">
                <h3><i class="fas fa-bolt" style="color:var(--secondary)"></i> MinimAll</h3>
                <p style="color:#9ca3af;font-size:13px;margin-top:8px;line-height:1.7">Тренажорлар ва спорт жиҳозлари. Оригинал ва кафолатли.</p>
                <div class="social-links">
                    <a href="#"><i class="fab fa-telegram"></i></a>
                    <a href="#"><i class="fab fa-instagram"></i></a>
                    <a href="#"><i class="fab fa-youtube"></i></a>
                </div>
            </div>
            <div class="footer-col"><h3>Категориялар</h3><ul><?php foreach(array_slice($mainCats,0,6) as $mc):?><li><a href="?category=<?=$mc['id']?>"><?=htmlspecialchars($mc['name'])?></a></li><?php endforeach;?></ul></div>
            <div class="footer-col"><h3>Маълумот</h3><ul><li><a href="#">Биз ҳақимизда</a></li><li><a href="#">Доставка</a></li><li><a href="#">Тўлов</a></li><li><a href="#">Кафолат</a></li><li><a href="#">Алоқа</a></li></ul></div>
            <div class="footer-col"><h3>Алоқа</h3><ul><li><a href="tel:<?=$sitePhone?>"><i class="fas fa-phone"></i> <?=$sitePhone?></a></li><li><a href="#"><i class="fas fa-envelope"></i> <?=getSetting('site_email')?></a></li><li><a href="#"><i class="fas fa-map-marker-alt"></i> <?=getSetting('site_address')?></a></li><li><a href="#"><i class="fas fa-clock"></i> <?=getSetting('working_hours')?></a></li></ul></div>
        </div>
        <div class="footer-bottom">&copy; <?=date('Y')?> <?=$siteName?>. Барча ҳуқуқлар ҳимояланган.</div>
    </div>
</footer>

<script>
function toggleMega(){document.getElementById('megaMenu').classList.toggle('active')}
function showSub(id){
    document.querySelectorAll('.mega-left a').forEach(a=>a.classList.remove('active'));
    event.target.closest('a').classList.add('active');
    document.querySelectorAll('.mega-right').forEach(d=>d.classList.remove('active'));
    const s=document.getElementById('sub-'+id);if(s)s.classList.add('active');
}
document.addEventListener('click',e=>{if(!document.querySelector('.mega-wrap').contains(e.target))document.getElementById('megaMenu').classList.remove('active')});
</script>
<script src="js/main.js"></script>
</body>
</html>
```

---

## 📋 Қадам 6: `product-card.php`

```php
<div class="product-card">
    <?php if($product['old_price'] && $product['old_price']>$product['price']):
        $disc=round(($product['old_price']-$product['price'])/$product['old_price']*100);?>
        <span class="badge-disc">-<?=$disc?>%</span>
    <?php endif;?>
    <a href="product.php?id=<?=$product['id']?>">
        <img src="uploads/<?=$product['image']?:'no-image.jpg'?>" alt="<?=htmlspecialchars($product['name'])?>">
    </a>
    <div class="p-info">
        <div class="p-cat"><?=htmlspecialchars($product['category_name']??'')?></div>
        <a href="product.php?id=<?=$product['id']?>"><div class="p-name"><?=htmlspecialchars($product['name'])?></div></a>
        <div class="p-price">
            <span class="cur-price"><?=formatPrice($product['price'])?></span>
            <?php if($product['old_price'] && $product['old_price']>$product['price']):?>
            <span class="old-price"><?=formatPrice($product['old_price'])?></span>
            <?php endif;?>
        </div>
        <button class="add-cart-btn" onclick="addToCart(<?=$product['id']?>)"><i class="fas fa-cart-plus"></i> Саватчага</button>
    </div>
</div>
```

---

## 📋 Қадам 7: `js/main.js`

```javascript
function addToCart(id,qty=1){
    fetch('cart.php',{method:'POST',headers:{'Content-Type':'application/x-www-form-urlencoded'},body:`action=add&product_id=${id}&quantity=${qty}`})
    .then(r=>r.json()).then(d=>{
        if(d.success){updateBadge(d.count);showNotif(d.message,'success')}
        else showNotif(d.message,'error');
    });
}
function updateCart(id,qty){
    if(qty<1){removeFromCart(id);return}
    fetch('cart.php',{method:'POST',headers:{'Content-Type':'application/x-www-form-urlencoded'},body:`action=update&product_id=${id}&quantity=${qty}`})
    .then(r=>r.json()).then(d=>{if(d.success)location.reload()});
}
function removeFromCart(id){
    if(!confirm('Ўчирмоқчимисиз?'))return;
    fetch('cart.php',{method:'POST',headers:{'Content-Type':'application/x-www-form-urlencoded'},body:`action=remove&product_id=${id}`})
    .then(r=>r.json()).then(d=>{if(d.success)location.reload()});
}
function updateBadge(c){
    let b=document.querySelector('.cart-badge .badge');
    if(c>0){if(!b){b=document.createElement('div');b.className='badge';document.querySelector('.cart-badge').appendChild(b)}b.textContent=c}
    else if(b)b.remove();
}
function showNotif(msg,type='success'){
    const n=document.createElement('div');
    n.style.cssText=`position:fixed;top:20px;right:20px;padding:14px 22px;border-radius:10px;color:#fff;font-weight:600;font-size:13px;z-index:10000;box-shadow:0 5px 20px rgba(0,0,0,.2);background:${type==='success'?'#10b981':'#ef4444'};animation:slideIn .3s ease`;
    n.textContent=msg;document.body.appendChild(n);
    setTimeout(()=>{n.style.animation='slideOut .3s ease';setTimeout(()=>n.remove(),300)},3000);
}
const st=document.createElement('style');
st.textContent='@keyframes slideIn{from{transform:translateX(100%);opacity:0}to{transform:translateX(0);opacity:1}}@keyframes slideOut{from{transform:translateX(0);opacity:1}to{transform:translateX(100%);opacity:0}}';
document.head.appendChild(st);
```

---

## 📋 Қадам 8: Админ парolini тўғрилаш

`reset_password.php` файлини яратинг:

```php
<?php
$db = new PDO("mysql:host=localhost;dbname=6a0c37093dd48_minimalluz;charset=utf8mb4","6a0c37093dd48_minimalluz","ПАРОЛИНГИЗ");
$db->prepare("UPDATE admins SET password=? WHERE username='admin'")->execute([password_hash('admin123',PASSWORD_DEFAULT)]);
echo "✅ Тайёр! Логин: admin / Парол: admin123";
echo "<br><a href='admin/login.php'>Кириш →</a>";
echo "<br><b style='color:red'>⚠️ Бу файлни ўчиринг!</b>";
?>
```

---

## 📋 Қадам 9: `uploads/` папкага `no-image.jpg`

Бу файлни яратинг — расм йўқ маҳсулотлар учун placeholder бўлади.

---

## ✅ Барча файллар рўйхати

```
✅ config.php          — Созламалар
✅ index.php           — Бош саҳифа
✅ product.php         — Маҳсулот саҳифаси (олдинги жавобдан)
✅ product-card.php    — Маҳсулот карточка
✅ cart.php            — Саватча (олдинги жавобдан)
✅ checkout.php        — Буюртма бериш (олдинги жавобдан)
✅ css/style.css       — Дизайн
✅ js/main.js          — JavaScript
✅ admin/login.php     — Кириш (олдинги жавобдан)
✅ admin/index.php     — Бош саҳифа (олдинги жавобдан)
✅ admin/products.php  — Маҳсулотлар (олдинги жавобдан)
✅ admin/orders.php    — Буюртмалар (олдинги жавобдан)
✅ admin/categories.php — Категориялар (олдинги жавобдан)
✅ admin/settings.php  — Созламалар (олдинги жавобдан)
✅ admin/export.php    — Бекап (олдинги жавобдан)
✅ admin/logout.php    — Чиқиш (олдинги жавобдан)
✅ reset_password.php  — Парол тўғрилаш (ўчиринг!)
```

Тайёр! Қайси қадамда ёрдам керак? 🚀