/* ===================================
   CATALOG PAGE - ASOSIY STILLAR
   =================================== */

.portfolio.section {
    padding: 60px 0;
    background-color: #f8f9fa;
}

/* Search & Filter Controls */
.catalog-controls {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    margin-bottom: 30px;
}

.catalog-controls .input-group {
    border: 2px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.catalog-controls .input-group:focus-within {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.catalog-controls .input-group-text {
    border: none;
    background: white;
    color: #007bff;
}

.catalog-controls input.form-control {
    border: none;
    padding: 12px 15px;
    font-size: 15px;
}

.catalog-controls input.form-control:focus {
    border: none;
    box-shadow: none;
    outline: none;
}

.catalog-controls .form-select {
    border: 2px solid #e9ecef;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.catalog-controls .form-select:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.catalog-controls .btn-primary {
    padding: 11px 20px;
    font-weight: 600;
    border-radius: 10px;
    border: none;
    transition: all 0.3s ease;
}

.catalog-controls .btn-primary:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

/* Results Info */
.results-info {
    background: linear-gradient(135deg, #f0f7ff 0%, #fff 100%);
    padding: 18px 20px;
    border-radius: 10px;
    border-left: 4px solid #007bff;
}

/* Sidebar Styles */
.categories-sidebar {
    background: white;
    padding: 30px 20px;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 80px;
}

.categories-sidebar h5 {
    color: #333;
    font-weight: 700;
    margin-bottom: 20px;
    font-size: 18px;
    border-bottom: 2px solid #007bff;
    padding-bottom: 12px;
}

.list-group-item {
    border: none;
    border-left: 3px solid transparent;
    color: #666;
    padding: 12px 15px;
    margin-bottom: 8px;
    border-radius: 10px;
    transition: all 0.3s ease;
    font-size: 15px;
    background: transparent;
}

.list-group-item:hover {
    background-color: #f0f7ff;
    border-left-color: #007bff;
    color: #007bff;
    transform: translateX(5px);
}

.list-group-item.active {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    border-left-color: white;
    font-weight: 600;
}

.list-group-item .badge {
    font-size: 12px;
    font-weight: 700;
    padding: 4px 8px;
}

/* Products Grid - DESKTOP (3 card) */
.products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    margin-bottom: 40px;
}

.product-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    cursor: pointer;
}

.product-card:hover {
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
    transform: translateY(-8px);
}

.product-image-wrapper {
    position: relative;
    overflow: hidden;
    height: 300px;
    background: #f0f0f0;
}

.product-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.product-card:hover .product-image-wrapper img {
    transform: scale(1.1);
}

.product-info {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-name {
    font-size: 16px;
    font-weight: 700;
    color: #333;
    margin-bottom: 8px;
    line-height: 1.3;
    min-height: 45px;
}

.product-sku {
    font-size: 12px;
    color: #999;
    margin-bottom: 10px;
}

.product-description {
    font-size: 14px;
    color: #666;
    margin-bottom: 12px;
    flex-grow: 1;
    line-height: 1.5;
}

.product-price {
    font-size: 18px;
    font-weight: 700;
    color: #007bff;
    margin: 12px 0 0 0;
}

/* Product Detail Styles */
.product-detail-image {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    background: #f8f9fa;
    aspect-ratio: 1;
    margin-bottom: 20px;
}

.product-detail-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.product-details {
    padding-right: 0;
}

.detail-item {
    padding-bottom: 20px;
    border-bottom: 1px solid #e9ecef;
}

.detail-item:last-child {
    border-bottom: none;
}

.detail-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 8px;
}

.detail-value {
    font-size: 15px;
    color: #333;
    margin: 0;
    line-height: 1.6;
}

.detail-value.price-highlight {
    font-size: 26px;
    font-weight: 700;
    color: white;
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    padding: 12px 16px;
    border-radius: 8px;
    border: none;
}

.detail-value.text-muted {
    color: #999;
}

.detail-value .badge {
    font-size: 12px;
    padding: 6px 12px;
    font-weight: 600;
}

/* Action Buttons */
.detail-actions {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #f0f0f0;
}

.detail-actions .btn {
    padding: 12px 20px;
    font-weight: 600;
    font-size: 15px;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.detail-actions .btn-primary {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    border: none;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.detail-actions .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 123, 255, 0.4);
}

.detail-actions .btn-outline-primary {
    border: 2px solid #007bff;
    color: #007bff;
    transition: all 0.3s ease;
}

.detail-actions .btn-outline-primary:hover {
    background-color: #007bff;
    color: white;
    transform: translateY(-2px);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.pagination .page-link {
    border-radius: 6px;
    border: 1px solid #dee2e6;
    color: #007bff;
    padding: 8px 12px;
    transition: all 0.3s ease;
    font-size: 14px;
}

.pagination .page-link:hover {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
    transform: translateY(-2px);
}

.pagination .page-item.active .page-link {
    background-color: #007bff;
    border-color: #007bff;
    color: white;
}

.pagination .page-item.disabled .page-link {
    color: #999;
    cursor: not-allowed;
    background-color: #f8f9fa;
}

/* Empty State */
.alert-info {
    border-radius: 10px;
    border: 2px dashed #bee5eb;
    background-color: #cfe2ff;
    color: #084298;
    padding: 50px 20px;
    text-align: center;
    font-size: 16px;
}

/* ===================================
   RESPONSIVE DESIGN
   =================================== */

/* TABLET (992px va kichik) - 2 ta card */
@media (max-width: 992px) {
    .categories-sidebar {
        margin-bottom: 30px;
        position: relative;
        top: auto;
    }

    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .modal-drawer {
        max-width: 90%;
    }

    .product-image-wrapper {
        height: 250px;
    }
}

/* MEDIUM DEVICES (768px - 991px) - 2 ta card */
@media (max-width: 768px) {
    .portfolio.section {
        padding: 40px 0;
    }

    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .product-image-wrapper {
        height: 180px;
    }

    .product-name {
        font-size: 14px;
        min-height: 40px;
    }

    .product-price {
        font-size: 16px;
    }

    .catalog-controls {
        padding: 15px;
    }

    .catalog-controls .row .col-md-5,
    .catalog-controls .row .col-md-4,
    .catalog-controls .row .col-md-3 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .modal-drawer .modal-body {
        padding: 1.5rem 1rem;
    }

    .modal-drawer .row > .col-md-5,
    .modal-drawer .row > .col-md-7 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* MOBILE (576px - 767px) - 1 ta card */
@media (max-width: 576px) {
    .products-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .product-info {
        padding: 15px;
    }

    .product-name {
        font-size: 13px;
        min-height: 35px;
    }

    .product-description {
        font-size: 12px;
        margin-bottom: 8px;
    }

    .product-image-wrapper {
        height: 320px;
    }

    .pagination .page-link {
        padding: 6px 10px;
        font-size: 12px;
    }

    .catalog-controls {
        padding: 12px;
    }

    .modal-drawer {
        max-width: 100%;
    }

    .modal-drawer .modal-header {
        padding: 1rem;
    }

    .modal-drawer .modal-title {
        font-size: 1.1rem;
    }

    .product-detail-image {
        margin-bottom: 15px;
    }

    .detail-value.price-highlight {
        font-size: 22px;
    }

    .detail-actions .btn {
        padding: 10px 15px;
        font-size: 13px;
    }
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-card {
    animation: fadeIn 0.5s ease-out;
}

/* Scrollbar Styling */
.modal-drawer .modal-body::-webkit-scrollbar {
    width: 6px;
}

.modal-drawer .modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.modal-drawer .modal-body::-webkit-scrollbar-thumb {
    background: #007bff;
    border-radius: 3px;
}

.modal-drawer .modal-body::-webkit-scrollbar-thumb:hover {
    background: #0056b3;
}

/* Utility Classes */
.transition {
    transition: all 0.3s ease !important;
}

/* Accessibility */
.btn-close:focus {
    box-shadow: 0 0 0 0.25rem rgba(0, 100, 255, 0.25);
}

.btn:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}
