:root {
    --primary: #0088cc;
    --bg: #f5f5f5;
    --card-bg: #ffffff;
    --text: #333333;
    --radius: 12px;
}

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding-bottom: 80px; /* Mobil menyu joyi */
}

/* --- TUGMALAR --- */
.btn-add {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px;
    cursor: pointer;
    font-weight: 500;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 15px;
}
.btn-add:active { transform: scale(0.98); }

/* --- HOME SAHIFASI (GRID) --- */
.product-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 10px;
}
.product-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.product-img-wrapper {
    position: relative;
    padding-top: 100%; /* 1:1 Kvadrat */
    overflow: hidden;
}
.product-img-wrapper img {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    object-fit: contain; background: white;
}
.product-info { padding: 10px; }
.product-title {
    font-size: 14px; font-weight: 500; margin-bottom: 5px; height: 38px; overflow: hidden;
}
.product-price { font-weight: 700; color: var(--primary); font-size: 15px; }

/* --- PRODUCT DETAIL (YANGI QISM) --- */

/* 1. Slider (Rasm) */
.detail-slider {
    background: white;
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    height: 350px;
}
.detail-slider::-webkit-scrollbar { display: none; }
.detail-slide {
    flex: 0 0 100%;
    scroll-snap-align: center;
    display: flex; justify-content: center; align-items: center;
}
.detail-slide img {
    max-width: 100%; max-height: 100%; object-fit: contain;
}

/* 2. Info Box */
.detail-info {
    background: white;
    padding: 20px;
    border-radius: 20px 20px 0 0;
    margin-top: -20px;
    position: relative;
    min-height: 300px;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.02);
}

/* 3. Sticky Footer (Mobil) */
.detail-footer {
    position: fixed; bottom: 0; left: 0; width: 100%;
    background: white; padding: 15px;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    display: flex; justify-content: space-between; align-items: center;
    z-index: 99;
}

/* 4. Desktop versiya (Yashirin elementlar) */
.desktop-only { display: none; }

/* --- RESPONSIVE (KOMPYUTER UCHUN) --- */
@media (min-width: 768px) {
    /* Home Grid 4 talik bo'ladi */
    .product-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 20px; padding: 20px;
    }

    /* Product Detail 2 ustun bo'ladi */
    .detail-container {
        display: flex; gap: 30px;
        max-width: 1100px; margin: 30px auto; padding: 0 20px;
    }
    
    .detail-slider {
        flex: 1; border-radius: 15px;
        height: 500px; /* Katta ekran uchun baland */
        box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    }
    
    .detail-info {
        flex: 1; margin-top: 0;
        border-radius: 15px;
        height: auto;
        box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    }

    /* Sticky Footer yo'qoladi, o'rniga oddiy tugma chiqadi */
    .detail-footer { display: none; }
    .desktop-only { display: block; margin-top: 20px; padding-top: 20px; border-top: 1px solid #eee; }
    
    .btn-add { padding: 15px; font-size: 16px; }
}