/* Saree catalogue, inventory and procurement pages - mobile first adjustments. */

/* Product imagery keeps its aspect ratio: show the whole saree, never crop or stretch. */
.product-image-preview {
    width: 72px;
    height: 72px;
    object-fit: contain;
    border-radius: .375rem;
    border: 1px solid var(--bs-border-color);
    background: var(--bs-tertiary-bg);
}

.product-catalog-image {
    width: 56px;
    height: 56px;
    object-fit: contain;
    border-radius: .375rem;
    background: var(--bs-tertiary-bg);
}

.product-catalog-image-cell {
    width: 80px;
}

/* Fixed-size frame for larger product images (details pages, catalogue cards). */
.product-image-frame {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: var(--bs-tertiary-bg);
    border-radius: .375rem;
}

.product-image-frame > img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.product-image-frame-sm {
    height: 240px;
}

.product-image-frame-lg {
    width: 100%;
    aspect-ratio: 4 / 5;
    max-height: 560px;
}

.product-card-image {
    width: 100%;
    height: 260px;
}

#productCatalogModal .modal-body {
    max-height: 70vh;
}

#productCatalogSearch {
    position: sticky;
    top: 0;
    z-index: 2;
}

@media (max-width: 767.98px) {
    .product-catalog-image {
        width: 44px;
        height: 44px;
    }

    .product-catalog-image-cell {
        width: 64px;
    }
}

/* Management tables collapse into stacked cards on phones. */
@media (max-width: 575.98px) {
    .table-stack thead {
        display: none;
    }

    .table-stack,
    .table-stack tbody,
    .table-stack tr,
    .table-stack td {
        display: block;
        width: 100%;
    }

    .table-stack tr {
        border: 1px solid var(--bs-border-color);
        border-radius: .5rem;
        margin-bottom: .75rem;
        padding: .35rem .25rem;
        background: var(--bs-body-bg);
    }

    .table-stack td {
        border: 0;
        padding: .3rem .6rem;
        display: flex;
        gap: .5rem;
        justify-content: space-between;
        align-items: baseline;
    }

    .table-stack td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--bs-secondary-color);
        flex: 0 0 auto;
    }

    .table-stack td > * {
        text-align: right;
    }
}
