/* Umumiy sozlamalar */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    background-color: #f6f6f6;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Navigatsiya */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
    padding: 10px 5%;
    gap: 20px;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: #7f00ff;
    text-decoration: none;
}

.catalog-btn {
    background: #ebeeff;
    color: #7f00ff;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-container {
    flex-grow: 1;
    max-width: 600px;
}

.search-container input {
    width: 100%;
    padding: 12px 20px;
    border: 1px solid #e2e5eb;
    border-radius: 8px;
    outline: none;
}

.nav-links {
    list-style: none;
    display: flex;
}

.nav-links li {
    margin-left: 25px;
}

.nav-links a {
    color: #333;
    text-decoration: none;
    transition: 0.3s;
    font-size: 0.85rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.lang-switcher {
    display: flex;
    gap: 5px;
    background: #f2f4f7;
    padding: 5px;
    border-radius: 8px;
}

.lang-btn {
    border: none;
    background: none;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 5px;
    transition: 0.3s;
}

.lang-btn.active {
    background: #7f00ff;
    color: white;
}

.nav-links a:hover {
    color: #7f00ff;
}

/* Banner Section */
.banner {
    width: 100%;
    height: 350px;
    margin-top: 20px;
    border-radius: 20px;
    background: linear-gradient(135deg, #7f00ff, #e100ff);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-align: left;
    padding: 0 50px;
}

.banner h1 {
    font-size: clamp(1.5rem, 5vw, 2.2rem); /* Dinamik o'lcham */
    max-width: 500px;
    line-height: 1.2;
}

/* Mahsulotlar bo'limi */
.section-title {
    text-align: center;
    margin: 40px 0;
    font-size: clamp(1.3rem, 4vw, 1.8rem);
    color: #2c3e50;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 15px;
}

@media (min-width: 768px) {
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 20px;
    }
}

/* Mahsulot kartochkasi */
.product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
    position: relative;
    cursor: pointer;
}

.wishlist-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: white;
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    z-index: 10;
    transition: 0.3s;
    font-size: 1.2rem;
    color: #ccc;
}

.wishlist-btn.active {
    color: #e74c3c;
}

.product-card:hover {
    transform: translateY(-10px);
}

.product-image img {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

.product-info {
    padding: 20px;
    text-align: left; /* Marketplace uslubida chapga tekislash */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 160px;
}

.product-info h3 {
    font-size: 0.95rem; /* Biroz kichraytirildi */
    font-weight: 600; /* Nom ko'rinishi uchun qalinroq qilamiz */
    color: #2c3e50;
    min-height: 38px; 
    overflow: hidden;
    margin-bottom: 4px; /* Masofa qisqartirildi */
    line-height: 1.2;
}

.product-desc {
    font-size: 0.75rem; /* Tavsif kichraytirildi */
    color: #7f8c8d;
    height: 35px;
    overflow: hidden;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.price-container {
    margin: 10px 0;
}

.installment-badge {
    background: #ffeb3b;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 5px;
}

.old-price {
    text-decoration: line-through;
    color: #95a5a6;
    font-size: 0.9rem;
    margin-right: 10px;
}

.promo-price {
    font-size: 1.1rem;
    font-weight: bold;
    color: #e74c3c;
    display: block;
}

.features-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 25px 0;
}

.badge {
    border: 1px solid #bdc3c7;
    padding: 8px 15px;
    border-radius: 8px;
    font-size: 0.85rem;
    background-color: #f9f9f9;
    color: #2c3e50;
    font-weight: 500;
}

.uzum-btn {
    display: inline-block;
    background: #7000ff;
    color: white;
    padding: 12px 30px;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    width: 100%;
    text-align: center;
    margin-top: 15px;
}

.uzum-btn:hover {
    background: #5a00cc;
}

/* Bottom Navigation for Mobile */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 1001;
    justify-content: space-around;
    padding: 10px 0;
}

.bottom-nav a {
    text-decoration: none;
    color: #333;
    font-size: 0.75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.bottom-nav i, .bottom-nav span.icon {
    font-size: 1.2rem;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .navbar {
        padding: 10px;
        flex-wrap: wrap;
    }

    .search-container {
        order: 3;
        max-width: 100%;
        margin-top: 5px;
    }

    .nav-links {
        display: none; /* Desktop nav links yashiriladi */
    }

    .bottom-nav {
        display: flex;
    }

    body {
        padding-bottom: 70px; /* Bottom nav uchun joy */
    }

    .banner {
        height: 180px;
        padding: 20px;
        margin-top: 10px;
    }

    .banner h1 {
        font-size: 1.3rem;
    }

    .section-title {
        font-size: 1.2rem;
        margin: 20px 0;
    }

    .detail-container {
        flex-direction: column;
        gap: 20px;
        padding: 15px;
        margin: 10px;
    }

    .detail-image, .detail-info {
        min-width: 100%;
    }

    .product-info {
        padding: 10px;
    }

    .product-info h3 {
        font-size: 0.85rem;
        min-height: 32px;
    }

    .product-desc {
        font-size: 0.7rem;
    }
}

/* Kartochka pastki qismi */
.card-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.details-link {
    display: inline-block;
    background: #f0e6ff;
    color: #7f00ff;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.details-link:hover {
    background: #7f00ff;
    color: white;
    box-shadow: 0 4px 12px rgba(127, 0, 255, 0.2);
}

.cart-add-btn {
    background: transparent;
    border: 1px solid #e2e5eb;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.2s;
}

.cart-add-btn:hover {
    background: #f2f4f7;
    border-color: #7f00ff;
}

/* Tugma dizayni */
.buy-btn {
    display: inline-block;
    background: #7f00ff;
    color: white;
    padding: 10px 25px;
    text-decoration: none;
    border-radius: 8px;
    transition: background 0.3s ease;
}

.buy-btn:hover {
    background: #6600cc;
}

/* Footer */
footer {
    background: #2c3e50;
    color: white;
    text-align: center;
    padding: 20px 0;
    margin-top: 50px;
}

/* Mahsulot tafsilotlari sahifasi uchun qo'shimcha dizayn */
.detail-container {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    margin: 50px auto;
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    max-width: 1000px;
}

.detail-image {
    flex: 1;
    min-width: 300px;
}

.detail-image img {
    width: 100%;
    border-radius: 15px;
    transition: 0.3s;
}

.thumbnail-container {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.thumbnail {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: 0.2s;
}

.thumbnail:hover, .thumbnail.active {
    border-color: #7f00ff;
}

.detail-info {
    flex: 1;
    min-width: 300px;
}

/* Mahsulot tavsifi qisqartirish stili */
.description-container {
    margin: 20px 0;
}

#detail-title {
    font-size: clamp(1.2rem, 4vw, 1.8rem);
    font-weight: 600;
    color: #2c3e50;
}

#detail-desc {
    font-size: 0.95rem;
    max-height: 80px; 
    overflow: hidden;
    transition: max-height 0.3s ease;
    line-height: 1.6;
    color: #555;
}

#detail-desc.expanded {
    max-height: 1500px; /* To'liq ko'rsatish uchun yetarli balandlik */
}

.toggle-desc {
    display: none;
    align-items: center;
    gap: 5px;
    color: #7f00ff;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    margin-top: 8px;
}

.back-btn {
    display: inline-block;
    margin-top: 20px;
    color: #3498db;
    text-decoration: none;
    font-weight: 600;
}

.back-btn:hover {
    text-decoration: underline;
}

/* Admin Dashboard Layout */
.admin-body {
    display: flex;
    min-height: 100vh;
    background: #f0f2f5;
}

.admin-sidebar {
    width: 260px;
    background: #2c3e50;
    color: white;
    padding: 20px 0;
    position: fixed;
    height: 100%;
}

.admin-sidebar h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #7f00ff;
}

.admin-nav-item {
    padding: 15px 25px;
    cursor: pointer;
    display: block;
    color: #bdc3c7;
    text-decoration: none;
    transition: 0.3s;
}

.admin-nav-item:hover, .admin-nav-item.active {
    background: #34495e;
    color: white;
    border-left: 4px solid #7f00ff;
}

.admin-main {
    margin-left: 260px;
    flex-grow: 1;
    padding: 30px;
}

.admin-section {
    display: none;
}

.admin-section.active {
    display: block;
}

/* Stats Table */
.stats-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    margin-top: 20px;
}

.stats-table th, .stats-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.stats-table th {
    background: #f8f9fa;
    font-weight: 600;
}

/* Login va Admin Form dizayni */
.form-container {
    max-width: 400px;
    margin: 50px auto;
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.form-container h2 {
    margin-bottom: 20px;
    text-align: center;
    color: #7f00ff;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.form-group input, .form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    outline: none;
}

.admin-btn {
    width: 100%;
    background: #7f00ff;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}

/* Admin mahsulotlar ro'yxati */
.admin-product-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #eee;
    background: #fff;
    margin-bottom: 10px;
    border-radius: 8px;
}

.admin-product-img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
}

.delete-btn {
    background: #ff4d4d;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    margin-left: 5px;
}

.edit-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 6px;
    cursor: pointer;
}

.delete-btn:hover {
    background: #cc0000;
}
