/* ===================================
   CATALOG PAGE - ASOSIY STILLAR
   Dizayn tizimi tokenlaridan foydalanadi: var(--radius-md), var(--accent-color), etc.
   =================================== */

.portfolio.section {
    padding: var(--section-padding);
    background-color: color-mix(in srgb, var(--background-color), #f8f9fa 30%);
}

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

.catalog-controls .input-group {
    border: 2px solid color-mix(in srgb, var(--default-color), transparent 88%);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: all 0.3s ease;
}

.catalog-controls .input-group:focus-within {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-color), transparent 85%);
}

.catalog-controls .input-group-text {
    border: none;
    background: var(--surface-color);
    color: var(--accent-color);
}

.catalog-controls input.form-control {
    border: none;
    padding: 12px 15px;
    font-size: 15px;
    background: var(--surface-color);
    color: var(--default-color);
}

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

.catalog-controls .form-select {
    border: 2px solid color-mix(in srgb, var(--default-color), transparent 88%);
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    transition: all 0.3s ease;
    background-color: var(--surface-color);
    color: var(--default-color);
}

.catalog-controls .form-select:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-color), transparent 85%);
}

.catalog-controls .btn-primary {
    padding: 11px 20px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: none;
    background-color: var(--accent-color);
    color: var(--contrast-color);
    transition: all 0.3s ease;
}

.catalog-controls .btn-primary:hover {
    background-color: color-mix(in srgb, var(--accent-color), black 15%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px color-mix(in srgb, var(--accent-color), transparent 70%);
}

/* Results Info */
.results-info {
    background: color-mix(in srgb, var(--accent-color), transparent 95%);
    padding: 18px 20px;
    border-radius: var(--radius-md);
    border-left: 4px solid var(--accent-color);
}

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

.categories-sidebar h5 {
    color: var(--heading-color);
    font-weight: 600;
    margin-bottom: 20px;
    font-size: 18px;
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 12px;
}

.list-group-item {
    border: none;
    border-left: 3px solid transparent;
    color: color-mix(in srgb, var(--default-color), transparent 20%);
    padding: 12px 15px;
    margin-bottom: 8px;
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
    font-size: 15px;
    background: transparent;
}

.list-group-item:hover {
    background-color: color-mix(in srgb, var(--accent-color), transparent 93%);
    border-left-color: var(--accent-color);
    color: var(--accent-color);
    transform: translateX(5px);
}

.list-group-item.active {
    background: linear-gradient(135deg, var(--accent-color) 0%, color-mix(in srgb, var(--accent-color), black 20%) 100%);
    color: var(--contrast-color);
    border-left-color: var(--contrast-color);
    font-weight: 600;
}

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

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

.product-card {
    background: var(--surface-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    cursor: pointer;
    animation: fadeIn 0.5s ease-out;
}

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

.product-image-wrapper {
    position: relative;
    overflow: hidden;
    width: 100%;
    aspect-ratio: 1 / 1;
    background: color-mix(in srgb, var(--background-color), #f0f0f0 50%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 24px;
}

.product-info {
    padding: var(--card-padding-sm);
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--heading-color);
    margin-bottom: 8px;
    line-height: 1.3;
    min-height: 45px;
}

.product-sku {
    font-size: 12px;
    color: color-mix(in srgb, var(--default-color), transparent 50%);
    margin-bottom: 10px;
}

.product-card-volumes {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.volume-tag {
    display: inline-block;
    padding: 2px 10px;
    border: 1.5px solid var(--accent-color);
    color: var(--accent-color);
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.product-description {
    font-size: 14px;
    color: color-mix(in srgb, var(--default-color), transparent 25%);
    margin-bottom: 12px;
    flex-grow: 1;
    line-height: 1.5;
}

.product-price {
    font-size: 18px;
    font-weight: 600;
    color: var(--accent-color);
    margin: 12px 0 0 0;
}

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

.pagination .page-link {
    border-radius: var(--radius-sm);
    border: 1px solid color-mix(in srgb, var(--default-color), transparent 80%);
    color: var(--accent-color);
    padding: 8px 12px;
    transition: all 0.3s ease;
    font-size: 14px;
    background: var(--surface-color);
}

.pagination .page-link:hover {
    background-color: var(--accent-color);
    color: var(--contrast-color);
    border-color: var(--accent-color);
    transform: translateY(-2px);
}

.pagination .page-item.active .page-link {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    color: var(--contrast-color);
}

.pagination .page-item.disabled .page-link {
    color: color-mix(in srgb, var(--default-color), transparent 50%);
    cursor: not-allowed;
    background-color: color-mix(in srgb, var(--background-color), #f8f9fa 30%);
}

/* Empty State */
.alert-info {
    border-radius: var(--radius-md);
    border: 2px dashed color-mix(in srgb, var(--accent-color), transparent 60%);
    background-color: color-mix(in srgb, var(--accent-color), transparent 95%);
    color: var(--heading-color);
    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: var(--gap-md);
    }

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

/* 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: var(--gap-sm);
    }

    .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: var(--gap-sm);
    }

    .product-info {
        padding: 15px;
    }

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

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

    .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;
    }

}

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

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

.modal-drawer .modal-body::-webkit-scrollbar-track {
    background: color-mix(in srgb, var(--background-color), #f1f1f1 50%);
}

.modal-drawer .modal-body::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 3px;
}

.modal-drawer .modal-body::-webkit-scrollbar-thumb:hover {
    background: color-mix(in srgb, var(--accent-color), black 15%);
}

/* Modal Drawer */
.modal-drawer {
    position: fixed;
    right: 0;
    top: 0;
    width: 100%;
    max-width: 500px;
    height: 100vh;
    margin: 0;
    z-index: 1050;
}

.modal-drawer .modal-dialog {
    height: 100vh;
    margin: 0;
    display: flex;
    flex-direction: column;
}

.modal-drawer .modal-content {
    height: 100vh;
    border-radius: 0;
    border: none;
    display: flex;
    flex-direction: column;
}

.modal-drawer .modal-header {
    flex-shrink: 0;
    padding: 1.5rem;
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    position: sticky;
    top: 0;
    z-index: 10;
}

.modal-drawer .modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 2rem 1.5rem;
}

.modal.fade .modal-drawer {
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal.show .modal-drawer {
    transform: translateX(0);
}

/* Modal Product Image */
.modal-product-image-wrapper {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #f8f8f8;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.modal-product-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 24px;
}

/* Volume Badges */
.product-volumes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.volume-badge {
    display: inline-block;
    padding: 4px 12px;
    border: 1.5px solid var(--accent-color);
    color: var(--accent-color);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

/* Accessibility */
.btn-close:focus {
    box-shadow: 0 0 0 0.25rem color-mix(in srgb, var(--accent-color), transparent 75%);
}

.btn:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}


/* ===================================
   PRODUCT CARD — anchor tag fix
   =================================== */
a.product-card {
    display: block;
    text-decoration: none;
    color: inherit;
}

a.product-card:hover {
    color: inherit;
}

/* ===================================
   PRODUCT DETAIL PAGE
   =================================== */
.product-detail.section {
    padding: var(--section-padding);
}

.product-detail-image-wrapper {
    border-radius: var(--radius-md);
    overflow: hidden;
    background: color-mix(in srgb, var(--background-color), #f0f0f0 40%);
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-detail-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 20px;
}

.product-detail-placeholder {
    font-size: 5rem;
    color: #ccc;
}

.product-detail-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--heading-color);
}

.product-detail-sku,
.product-detail-category {
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.product-detail-volumes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 16px 0;
}

.product-detail-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-color);
    margin: 16px 0 24px;
}

.product-detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
}

.btn-uzum {
    background-color: #7B2FFF;
    border-color: #7B2FFF;
    color: #fff;
    font-weight: 600;
    padding: 10px 24px;
    border-radius: var(--radius-sm);
    transition: background 0.2s ease, border-color 0.2s ease;
}

.btn-uzum:hover {
    background-color: #6a24e0;
    border-color: #6a24e0;
    color: #fff;
}

.product-detail-description {
    padding: 0;
}

.product-detail-description h4 {
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--heading-color);
}

.product-detail-description p {
    line-height: 1.8;
    color: var(--default-color);
}

@media (max-width: 768px) {
    .product-detail-actions {
        flex-direction: column;
    }

    .product-detail-actions .btn {
        width: 100%;
        text-align: center;
    }
}
