/* Cambiar el color del botón de comprar */
  	.action.primary.tocart,
  	.action-primary-tocart {
        background: #E00D2E !important;
        color: #ffffff;
		border: 0px;
      	border-radius:8px;
      	width: 100%; 
      	transition: background 0.3s ease !important;
  	}

/* Efecto hover */
.action.primary.tocart:hover,
.action-primary-tocart:hover {
background: #C90B29 !important;
   	color: #ffffff !important;
}

/* Estilos para el mensaje de sección vacía */
.empty-section-message {
    text-align: center;
    padding: 20px;
    font-size: 16px;
    border: 1px solid #f0f0f0; 
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    margin: 20px 0;
    display: none;
}

.empty-section-message .normal-message {
    display: block;
}


.message.notice {
    text-align: center;
    padding: 20px;
    font-size: 16px;
    border: 1px solid #f0f0f0; 
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    margin: 20px 0;
    /* Si quieres que se oculte por defecto, agrega display: none; */
    /* display: none; */
}


/* COLOCACIÓN DE LOS ELEMENTOS */

/* Contenedor principal de productos */
.products.list.items.product-items {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    align-items: stretch;
    gap: 20px;
    padding: 0;
    margin: 0;
    width: 100%;
}

/* Estilo para cada item de producto */
.product-item {
    flex: 0 0 calc(20% - 17px);
    min-width: 200px;
    box-sizing: border-box;
    padding: 15px;
    margin: 0;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* Contenedor interno del producto */
.product-item-inner {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* Estilos para elementos internos */
.product-item .product-image-container,
.product-item .product-item-details,
.product-item .product-item-actions {
    width: 100%;
    max-width: 100%;
}

/* Asegurar que botones e inputs no sobresalgan */
.product-item button,
.product-item input,
.product-item select {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* Media queries para responsividad */
@media (max-width: 1200px) {
    .product-item {
        flex: 0 0 calc(25% - 15px); /* 4 por fila */
    }
}

@media (max-width: 992px) {
    .product-item {
        flex: 0 0 calc(33.333% - 14px); /* 3 por fila */
    }
}

@media (max-width: 768px) {
    .product-item {
        flex: 0 0 calc(50% - 10px); /* 2 por fila */
    }
}

@media (max-width: 640px) {
    .products.list.items.product-items {
        display: block;
        gap: 0;
    }
    
    .product-item {
        flex: none;
        width: 100%;
        min-width: 100%;
        max-width: 100%;
        padding: 0 0 20px 0;
        margin: 0;
    }
    
    .product-item-inner {
        padding: 15px;
    }
    
    /* Reset de márgenes para elementos pares/impares */
    .product-item:nth-child(odd),
    .product-item:nth-child(even) {
        margin-left: 0;
        margin-right: 0;
    }
}

.product-item-info {
    border: 2px solid #f0f0f0;
    padding: 15px; 
    border-radius: 5px; 
    box-shadow: 2px 2px 10px rgba(240, 240, 240, 0.3); 
    box-sizing: border-box; 
    transition: border-color 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}

.product-item-info:hover,
.products-grid .product-item-info.active {
    border: 2px solid #E00D2E !important; 
    box-shadow: 2px 2px 10px rgba(224, 13, 46, 0.3) !important;
}

/* Corregimos el hover en .products-grid para evitar movimientos */
.products-grid .product-item-info:hover,
.products-grid .product-item-info.active {
    background: #ffffff;
    margin: 0 !important; 
    padding: 15px !important; 
    position: relative;
    z-index: 9;
}


/* Asegurar que todo se mantenga centrado */
.product-item-info {
    align-items: center;
    text-align: center;
}


/* Estilos base para los productos */
.products.list.items.product-items .product-item {
    display: none; 
}

.products.list.items.product-items .product-item.visible {
    display: block; 
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}


/* Estilo para la categoría del producto */
.product-category {
    font-size: 14px;
    font-weight: bold;
    color: #555;
    margin-bottom: 8px; 
    text-transform: uppercase; 
}

/* Estilo para el nombre del producto */
.product-item-name {
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

/* Estilo para el precio del producto */
.product-price-container {
    font-size: 16px;
    color: #FF5733;
}

/* Estilo para el texto "/Unidad" */
.product-unit-text {
    font-size: 14px;
    color: #777;
}

/* Estilo para el input de la cantidad */
.product-qty-input {
    width: 70px;
    padding: 5px;
    font-size: 14px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* Estilo para el botón de añadir al carrito */
.product-add-button {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    border-radius: 4px;
}

.product-add-button:hover {
    background-color: #45a049;
}

/* CATEGORÍA */
.custom-product-category {
    color: #777;
    font-size: .8rem;
    opacity: .9;
    line-height: 1.2em;
    text-align: center;
    margin: 3px 0 5px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
}

/* NOMBRE PRODUCTO - Ahora con 2 líneas fijas */
.custom-product-name {
    color: #575757 !important;
    font-size: 1.7rem;
    font-weight: 600 !important;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 5px 0;
    line-height: 1.3;
    min-height: 4.42rem; /* (1.7rem * 1.3) * 2 */
    text-align: center;
}

/* Cambiar a rojo cuando se hace hover en el contenedor del producto */
.product-item-info:hover .custom-product-name,
.product-item-info.active .custom-product-name {
    text-decoration: none !important; 
}

/* PRECIO Y UNIDAD - Mejor alineación */
.custom-product-price-wrapper {
    margin: 8px 0;
}

.custom-price-container {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    justify-content: center;
    width: 100%;
}

.custom-price-container .price {
    color: #e74c3c;
    font-size: 20px;
    font-weight: bold;
    line-height: 1;
}

.custom-price-container .old-price .price {
    font-size: 16px;
}

.custom-price-unit {
    color: #777;
    font-size: 12px;
    position: relative;
    top: -1px;
}

/* FORMULARIO AÑADIR AL CARRITO - Input sin flechas */
.product-item-actions .actions-primary form[data-role="tocart-form"] {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.custom-qty-input {
    width: 50px !important;
    height: 40px;
    padding: 5px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    flex-shrink: 0;
    -moz-appearance: textfield;
}

.custom-qty-input:focus {
    border-color: #c2c2c2 !important;  
    box-shadow: none !important;    
    outline: none !important;
}

.custom-qty-input::-webkit-outer-spin-button,
.custom-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.custom-add-to-cart {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 0 15px;
    height: 40px;
    border-radius: 4px;
    font-weight: bold;
    flex-grow: 1;
    white-space: nowrap;
    transition: background-color 0.3s;
}



/* Asegurar que la fuente está cargada */
@font-face {
    font-family: 'luma-icons';
    src: url('data:application/font-woff2;charset=utf-8;base64,d09GMgABAAAA...') format('woff2');
    font-weight: normal;
    font-style: normal;
}

.custom-add-to-cart {
    position: relative;
    padding-left: 35px !important;
}

.custom-add-to-cart::before {
    content: '\e611';
    font-family: 'luma-icons';
    position: absolute;
  	font-weight: 100;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    line-height: 1;
    speak: none;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}



.custom-add-to-cart:hover {
    background-color: #2980b9;
}

/* NUEVO: Evita que los productos se corten entre columnas */
.product-item {
    break-inside: avoid;
    page-break-inside: avoid;
}

/* Modo list oculto */
.mode-list {
    display: none !important;
}

/* Modo grid icono personalizado */
.toolbar .modes-mode.active.mode-grid {
    border: 1px solid #cccccc !important;
    border-radius: 4px !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05) !important;
    transition: all 0.3s ease !important;
    background-color: #f0f0f0 !important;
}




.products {
  margin: 0px !important;
}

@media (min-width: 769px), print {
  .page-layout-1column.page-with-filter .column.main {
    padding-top: 0 !important;
  }
}