/* Required height of parents of the Half Page Carousel for proper displaying carousel itself */
html,
body,
.view {
  height: 100%;
  background-color: #212121!important;
}

table.table td,
table.table th {
  vertical-align: middle;
}
/* Half Page Carousel itself*/
.carousel {
  height: 50%;
}
.carousel .carousel-inner {
  height: 100%;
}
.carousel .carousel-inner .carousel-item,
.carousel .carousel-inner .active {
  height: 100%;
}

/* Adjustment for mobile devices*/
@media (max-width: 776px) {
  .carousel {
    height: 100%;
  }
}

/* Footer color for sake of consistency with Navbar */
.page-footer {
  background-color: #000;
}

.cart-number {
  position: absolute;
  top: 0;
  padding-top: 6px;
}

main.error {
  height: 100%;
  display: grid;
  place-items: center;
}

main.error h1 {
  text-align: center;
}
/* Estilos para el layout en filas uniforme */
.product-row {
    border: 1px solid #444;
    transition: all 0.3s ease;
    min-height: 120px;
    display: flex;
    align-items: stretch;
}

.product-row:hover {
    background-color: #333 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

/* Columnas uniformes */
.product-column {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 0.75rem 0.5rem;
    border-right: 1px solid #555;
    min-height: 100px;
}

.product-column:last-child {
    border-right: none;
}

.column-content {
    width: 100%;
    text-align: left;
}

.product-column.text-center .column-content {
    text-align: center;
}

/* Títulos de columnas */
.column-title {
    font-size: 0.7rem !important;
    font-weight: 600 !important;
    color: #c32420 !important;
    margin-bottom: 0.5rem !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Datos de columnas */
.column-data {
    font-size: 0.75rem !important;
    color: white !important;
    margin-bottom: 0 !important;
    word-wrap: break-word;
}

.price-data {
    font-weight: bold !important;
    color: #28a745 !important;
}

/* Imagen del producto */
.product-image {
    max-height: 70px;
    max-width: 70px;
    object-fit: cover;
    transition: transform 0.3s ease;
    border: 2px solid #555;
}

.product-row:hover .product-image {
    transform: scale(1.1);
    border-color: #c32420;
}

/* Nombre del producto y OE */
.product-name {
    font-size: 0.8rem !important;
    color: white !important;
    font-weight: 500 !important;
    margin-bottom: 0.25rem !important;
    line-height: 1.2;
}

.product-oe {
    font-size: 0.7rem !important;
    color: #aaa !important;
    margin-bottom: 0 !important;
}

/* Botones de acción */
.action-buttons {
    display: flex;
    justify-content: center;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.action-btn {
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.action-btn i {
    font-size: 0.75rem;
}

/* Header de productos */
.products-header {
    background-color: #c32420 !important;
    color: white;
    font-weight: 700;
    padding: 1rem 0;
    margin-bottom: 1rem;
    border-radius: 0.25rem;
    min-height: 60px;
    display: flex;
    align-items: center;
}

.products-header > div {
    text-align: center;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    border-right: 1px solid rgba(255,255,255,0.2);
}

.products-header > div:last-child {
    border-right: none;
}

/* Responsividad mejorada */
@media (max-width: 1200px) {
    .column-title {
        font-size: 0.65rem !important;
    }
    
    .column-data, .product-name {
        font-size: 0.7rem !important;
    }
    
    .product-oe {
        font-size: 0.65rem !important;
    }
}

@media (max-width: 992px) {
    .product-row {
        min-height: auto;
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .product-column {
        border-right: none;
        border-bottom: 1px solid #555;
        min-height: 80px;
        padding: 0.5rem;
    }
    
    .product-column:last-child {
        border-bottom: none;
    }
    
    .product-image {
        max-height: 60px;
        max-width: 60px;
    }
}

@media (max-width: 768px) {
    .product-row {
        margin-bottom: 1rem;
        padding: 1rem !important;
    }
    
    .product-column {
        padding: 0.75rem 0.5rem;
        min-height: 70px;
    }
    
    .column-title {
        font-size: 0.7rem !important;
        margin-bottom: 0.25rem !important;
    }
    
    .column-data, .product-name {
        font-size: 0.75rem !important;
    }
    
    .action-buttons {
        margin-top: 0.5rem;
    }
    
    .action-btn {
        width: 36px;
        height: 36px;
    }
}

@media (max-width: 576px) {
    .product-column {
        min-height: 60px;
        padding: 0.5rem 0.25rem;
    }
    
    .product-image {
        max-height: 50px;
        max-width: 50px;
    }
}

/* Contenedor principal de la tabla de productos */
.products-table-container {
    width: 100%;
    margin-top: 1rem;
}

/* Header de la tabla */
.products-header {
    display: flex;
    background-color: #c32420 !important;
    color: white;
    font-weight: 700;
    border-radius: 0.25rem 0.25rem 0 0;
    min-height: 50px;
    align-items: center;
    margin-bottom: 0;
}

.header-col {
    padding: 1rem 0.75rem;
    text-align: center;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    border-right: 1px solid rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-col:last-child {
    border-right: none;
}

/* Anchos específicos para las columnas del header */
.header-col-codigo { flex: 0 0 15%; }
.header-col-imagen { flex: 0 0 12%; }
.header-col-detalle { flex: 0 0 30%; }
.header-col-automotriz { flex: 0 0 18%; }
.header-col-precio { flex: 0 0 15%; }
.header-col-acciones { flex: 0 0 10%; }

/* Lista de productos */
.products-list {
    border: 1px solid #444;
    border-top: none;
    border-radius: 0 0 0.25rem 0.25rem;
    overflow: hidden;
}

/* Contenedor de cada fila de producto */
.product-row-container {
    width: 100%;
    border-bottom: 1px solid #555;
}

.product-row-container:last-child {
    border-bottom: none;
}

/* Fila de producto */
.product-row {
    display: flex;
    min-height: 100px;
    transition: all 0.3s ease;
    align-items: center;
    padding: 0;
    margin: 0;
    background-color: #2d2d2d !important;
}

.product-row:hover {
    background-color: #333 !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* Columnas de producto */
.product-col {
    padding: 0.75rem;
    border-right: 1px solid #555;
    display: flex;
    align-items: flex-start;
    min-height: 100px;
}

.product-col:last-child {
    border-right: none;
}

/* Anchos específicos para las columnas de producto */
.product-col-codigo { flex: 0 0 15%; }
.product-col-imagen { flex: 0 0 12%; }
.product-col-detalle { flex: 0 0 30%; }
.product-col-automotriz { flex: 0 0 18%; }
.product-col-precio { flex: 0 0 15%; }
.product-col-acciones { flex: 0 0 10%; }

/* Contenido de columna */
.column-content {
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

/* Títulos de columna (solo en móvil) */
.column-title {
    font-size: 0.7rem !important;
    font-weight: 600 !important;
    color: #c32420 !important;
    margin-bottom: 0.5rem !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Datos de columnas */
.column-data {
    font-size: 0.75rem !important;
    color: white !important;
    margin-bottom: 0 !important;
    word-wrap: break-word;
    line-height: 1.3;
}

.price-data {
    font-weight: bold !important;
    color: #28a745 !important;
    font-size: 0.85rem !important;
}

/* Imagen del producto */
.product-image {
    max-height: 70px;
    max-width: 70px;
    width: 70px;
    height: 70px;
    object-fit: cover;
    transition: transform 0.3s ease;
    border: 2px solid #555;
    display: block;
    margin: 0 auto;
}

.product-row:hover .product-image {
    transform: scale(1.1);
    border-color: #c32420;
}

/* Nombre del producto y OE */
.product-name {
    font-size: 0.8rem !important;
    color: white !important;
    font-weight: 500 !important;
    margin-bottom: 0.25rem !important;
    line-height: 1.2;
}

.product-oe {
    font-size: 0.7rem !important;
    color: #aaa !important;
    margin-bottom: 0 !important;
}

/* Botones de acción */
.action-buttons {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    align-items: center;
}

.action-btn {
    width: 35px;
    height: 35px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: none;
    transition: all 0.3s ease;
}

.action-btn i {
    font-size: 0.8rem;
}

.action-btn:hover {
    transform: scale(1.1);
}

/* Responsividad */
@media (max-width: 992px) {
    /* Ocultar header en pantallas pequeñas */
    .products-header {
        display: none !important;
    }
    
    /* Cambiar a layout vertical en móvil */
    .product-row {
        flex-direction: column;
        min-height: auto;
        padding: 1rem;
    }
    
    .product-col {
        flex: none !important;
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #555;
        padding: 0.5rem 0;
        min-height: auto;
    }
    
    .product-col:last-child {
        border-bottom: none;
    }
    
    /* Mostrar títulos en móvil */
    .column-title {
        display: block !important;
    }
    
    /* Layout horizontal para imagen y contenido en móvil */
    .product-col-imagen .column-content,
    .product-col-codigo .column-content,
    .product-col-automotriz .column-content,
    .product-col-precio .column-content {
        flex-direction: row;
        align-items: center;
        gap: 1rem;
    }
    
    .product-col-imagen .column-title,
    .product-col-codigo .column-title,
    .product-col-automotriz .column-title,
    .product-col-precio .column-title {
        margin-bottom: 0 !important;
        flex: 0 0 100px;
    }
    
    .product-image {
        max-height: 60px;
        max-width: 60px;
        width: 60px;
        height: 60px;
    }
}

@media (max-width: 576px) {
    .product-row {
        padding: 0.75rem;
    }
    
    .product-col {
        padding: 0.4rem 0;
    }
    
    .column-title {
        font-size: 0.65rem !important;
    }
    
    .column-data, .product-name {
        font-size: 0.7rem !important;
    }
    
    .product-oe {
        font-size: 0.65rem !important;
    }
    
    .product-image {
        max-height: 50px;
        max-width: 50px;
        width: 50px;
        height: 50px;
    }
    
    .action-btn {
        width: 32px;
        height: 32px;
    }
}

/* Mensaje cuando no hay productos */
.text-center h4 {
    color: #c32420 !important;
}

/* Ajustes para el badge "Nuevo" */
.badge.primary-color {
    background-color: #c32420 !important;
    font-size: 0.65rem;
    padding: 0.25rem 0.5rem;
}