/* Global helpers */
:root {
    --primary-blue: #0f4d88;
    --primary-cta: #4399d3;
    --accent-yellow: #ffc107;
    --card-border: #dedfdf;
}

#products-module {
    zoom: 0.9;
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
}

/* Card layout */
.product-card {
    border-radius: 1rem;
    border: 1px solid var(--card-border);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
    background: #fff;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 280px;
}

.product-card .card-header {
    background: var(--primary-blue);
    color: #fff;
    padding: 0.75rem 1rem;
    min-height: 50px;
}

.product-card-column-left,
.product-card-column-center,
.product-card-column-right {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    box-sizing: border-box;
}

.product-card .card-body {
    padding: 0.85rem;
    flex: 1;
}

.card-layout-row {
    display: flex;
    gap: 1rem;
}
.product-card-column-left {
    flex: 0 0 33.3333%;
    max-width: 33.3333%;
}

.product-card-column-center {
    flex: 0 0 33.3333%;
    max-width: 33.3333%;
    align-items: center;
    justify-content: center;
}

.product-card-column-right {
    flex: 0 0 33.3333%;
    max-width: 33.3333%;
}

.product-card-column-center .product-image-center-wrapper {
    width: 96px;
    height: 96px;
    border-radius: 0.75rem;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem;
    overflow: hidden;
    transform: translateX(-16px);
}

.product-card-column-center .product-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.service-badge {
    font-size: 0.85rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    padding: 0.35rem 0.95rem;
    border-radius: 0.65rem;
    background: linear-gradient(135deg, #ffecb3, #ffc107, #f39c12);
    color: #1f1f1f;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.25), inset 0 -3px 6px rgba(255, 255, 255, 0.5);
    transform: rotate(-1.2deg) skew(-6deg);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.service-badge::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: inset 0 0 6px rgba(255, 255, 255, 0.4);
    pointer-events: none;
}

#products-list-container.product-card-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 1.5rem;
    width: 100%;
}

.card-grid-item {
    display: flex;
}

@media (max-width: 1600px) {
    #products-list-container.product-card-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 1300px) {
    #products-list-container.product-card-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 992px) {
    #products-list-container.product-card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    #products-list-container.product-card-grid {
        grid-template-columns: repeat(1, minmax(0, 1fr));
    }
}

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

.product-triangle-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--accent-yellow);
    color: #212529;
    padding: 0.25rem 0.6rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.product-id-badge {
    background: var(--accent-yellow);
    padding: 0.2rem 0.65rem;
    border-radius: 10rem;
    font-size: 0.75rem;
    font-weight: 700;
}

.product-detail-text {
    font-size: 0.8rem;
    line-height: 1.3;
    color: #666;
}

.list-view-table .stock-zero,
.list-view-table .stock-low,
.list-view-table .stock-ok {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 34px;
    border-radius: 0.75rem;
    font-weight: 700;
    font-size: 0.85rem;
    color: #fff;
}

.list-view-table .stock-zero {
    background: #212529;
}
.list-view-table .stock-low {
    background: #dc3545;
}
.list-view-table .stock-ok {
    background: #0dcaf0;
    color: #000;
}

.list-view-table .stock-zero,
.list-view-table .stock-low,
.list-view-table .stock-ok {
    box-shadow: 0 6px 18px rgba(15, 77, 136, 0.25), inset 0 -4px 8px rgba(0, 0, 0, 0.25);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.list-view-table .stock-zero:hover,
.list-view-table .stock-low:hover,
.list-view-table .stock-ok:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(15, 77, 136, 0.35), inset 0 -4px 8px rgba(0, 0, 0, 0.15);
}

/* List layout */
.list-view-table {
    margin-top: 1rem;
}

.list-view-table .table-responsive {
    margin-top: 0.5rem;
}

.list-view-table .table {
    border-collapse: separate;
    border-spacing: 0 0.9rem;
    width: 100%;
    margin-bottom: 0;
}

.list-view-table .table colgroup col.col-id {
    width: 70px;
}

.list-view-table .table colgroup col.col-image {
    width: 80px;
}

.list-view-table .table colgroup col.col-category {
    width: 150px;
}

.list-view-table .table colgroup col.col-name {
    width: 260px;
}

.list-view-table .table colgroup col.col-expiration {
    width: 130px;
}

.list-view-table .table colgroup col.col-stock {
    width: 120px;
}

.list-view-table .table colgroup col.col-prices {
    width: 180px;
}

.list-view-table .table colgroup col.col-actions {
    width: 110px;
}

.list-view-table .expiration-column,
.list-view-table .stock-column {
    text-align: center;
}

.list-view-table .expiration-column .product-vencimiento-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.3rem 0.9rem;
    border-radius: 0.6rem;
    background: #eef5ff;
    color: #0f4d88;
    font-weight: 700;
    font-size: 0.9rem;
    border: 1px solid rgba(15, 77, 136, 0.2);
    min-height: 40px;
}

.list-view-table .expiration-column .min-display {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #5a5f65;
    margin-bottom: 0.4rem;
}

.list-view-table .location-text {
    margin-top: 0.25rem;
    color: #5a5f65;
}

.list-view-table .expiration-column .product-vencimiento-label.venc-default {
    background: #f1f3f5;
    color: #6c757d;
    border-color: rgba(108, 117, 125, 0.3);
}

.list-view-table .expiration-column .product-vencimiento-label.venc-pasado {
    background: #0a0a0a;
    color: #fff;
    border-color: rgba(0, 0, 0, 0.6);
}

.list-view-table .expiration-column .product-vencimiento-label.venc-cercano {
    background: #dc3545;
    color: #fff;
    border-color: rgba(220, 53, 69, 0.6);
}

.list-view-table .expiration-column .product-vencimiento-label.venc-medio {
    background: #fd7e14;
    color: #000;
    border-color: rgba(253, 126, 20, 0.6);
}

.list-view-table .expiration-column .product-vencimiento-label.venc-lejano {
    background: #0dcaf0;
    color: #000;
    border-color: rgba(13, 202, 240, 0.6);
}

.list-view-table .expiration-column .product-vencimiento-label.venc-default,
.list-view-table .expiration-column .product-vencimiento-label.venc-pasado,
.list-view-table .expiration-column .product-vencimiento-label.venc-cercano,
.list-view-table .expiration-column .product-vencimiento-label.venc-medio,
.list-view-table .expiration-column .product-vencimiento-label.venc-lejano {
    box-shadow: 0 8px 18px rgba(15, 77, 136, 0.25), inset 0 -3px 8px rgba(255, 255, 255, 0.35);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.list-view-table .expiration-column .product-vencimiento-label:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 24px rgba(15, 77, 136, 0.35), inset 0 -3px 6px rgba(0, 0, 0, 0.2);
}

.list-view-table .stock-column .small {
    margin-top: 0.2rem;
    color: #5a5f65;
}

.list-view-table .table th,
.list-view-table .table td {
    padding: 0.65rem 0.85rem;
    vertical-align: middle;
}

.list-view-table .table thead th {
    background: var(--primary-blue);
    color: #fff;
    border: 0;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.08em;
}

.list-view-table .table tbody tr {
    background: #fff;
    border-radius: 0.85rem;
    box-shadow: 0 10px 25px rgba(15, 77, 136, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
}

.list-view-table .table tbody tr:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 30px rgba(15, 77, 136, 0.18);
    background: transparent !important;
}

.list-view-table .table tbody tr td {
    border: none;
    background: transparent;
}

.list-view-table .category-column {
    transform: rotate(-5deg);
    padding: 0.1rem 0.3rem;
}

.list-view-table .category-column .category-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.4rem 1rem;
    border-radius: 0.35rem;
    background: linear-gradient(135deg, #ff4f4f, #c82333);
    color: #fff;
    font-weight: 200;
    letter-spacing: 0.15em;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4), inset 0 -3px 6px rgba(255, 255, 255, 0.35);
}

.list-view-table .id-column {
    position: relative;
    padding: 0;
}

.list-view-table .id-column::before {
    content: attr(data-product-id);
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%) rotate(-12deg);
    background: linear-gradient(135deg, #ff4f4f, #c30000);
    padding: 0.35rem 1.1rem;
    border-radius: 1rem;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
    font-weight: 700;
    color: #fff;
    font-size: 0.75rem;
}

.list-view-table .id-column .visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    border: 0;
}

.list-view-table .image-column {
    padding-top: 0.35rem;
    padding-bottom: 0.35rem;
}

.product-table-img {
    width: 58px;
    height: 58px;
    object-fit: contain;
    background: #fff;
    border: 1px solid #e2e5ea;
    border-radius: 0.5rem;
    padding: 0.35rem;
}

.list-view-table .actions-column {
    padding-right: 1.25rem;
}

.list-view-table .table-dark {
    background: var(--primary-blue);
    border-color: var(--primary-blue);
}

/* # Helper utilities */
.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* Utility */
.d-none {
    display: none !important;
}
