/* ========================================
   PRODUCTOS - DISEÑO MODERNO CON PALETA TERROSO Y FRESCO
   ======================================== */

/* Contenedor principal */
.container-fluid {
    background: linear-gradient(135deg, #f8f7f7 0%, #ffffff 100%);
    min-height: 100vh;
    padding: 2rem 0;
}

/* Título de la página */
.products-page-title {
    color: var(--color-charcoal);
    font-weight: 700;
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 2rem;
    font-family: 'Merriweather', serif;
    text-shadow: 0 2px 4px rgba(60, 60, 60, 0.1);
}

.products-page-title i {
    color: var(--color-herb);
    margin: 0 1rem;
    font-size: 2rem;
}

/* Banner de estado de pedidos */
.alert {
    border-radius: 16px;
    border: none;
    font-weight: 500;
    padding: 1.5rem;
}

.alert-success {
    background: linear-gradient(135deg, var(--color-herb) 0%, #7a8a7a 100%);
    color: white;
    box-shadow: 0 8px 25px rgba(98, 110, 96, 0.2);
}

.alert-warning {
    background: linear-gradient(135deg, var(--color-chilli) 0%, #8c372e 100%);
    color: white;
    box-shadow: 0 8px 25px rgba(175, 71, 60, 0.2);
}

.alert i {
    font-size: 1.2rem;
}

/* Barra de búsqueda */
.search-container {
    position: relative;
}

.search-group {
    border-radius: 50px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    background: white;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.search-group:focus-within {
    border-color: var(--color-herb);
    box-shadow: 0 12px 35px rgba(98, 110, 96, 0.15);
    transform: translateY(-2px);
}

.search-icon {
    background: transparent;
    color: var(--color-herb);
    font-size: 1.2rem;
    padding: 1rem 1.5rem;
}

.search-input {
    border: none;
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
    background: transparent;
    color: var(--color-charcoal);
}

.search-input:focus {
    box-shadow: none;
    outline: none;
}

.search-input::placeholder {
    color: #999;
    font-weight: 400;
}

.search-btn {
    background: linear-gradient(135deg, var(--color-terracotta) 0%, #a66d70 100%);
    color: white;
    border: none;
    padding: 1rem 2rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.search-btn:hover {
    background: linear-gradient(135deg, #7a484b 0%, var(--color-terracotta) 100%);
    color: white;
    transform: scale(1.05);
}

/* Grid de productos */
#contenedor-productos {
    margin-top: 2rem;
}

/* Cards de productos */
.product-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(148, 93, 96, 0.1);
    transition: all 0.4s ease;
    height: 100%;
    position: relative;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08);
    border-color: var(--color-herb);
}

/* Contenedor de imagen */
.product-image-container {
    position: relative;
    height: 200px;
    overflow: hidden;
    background: linear-gradient(135deg, #f8f7f7 0%, #ffffff 100%);
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.4s ease;
}

/* Estilo para imagen por defecto */
.product-image[src*="sin-imagen.jpg"] {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    position: relative;
}

.product-image-container::after {
    content: '🌱';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
    color: #6c757d;
    opacity: 0.3;
    z-index: 1;
    display: none;
}

.product-image-container:has(img[src*="sin-imagen.jpg"])::after,
.product-image-container:has(img[src=""])::after {
    display: block;
}

.product-card:hover .product-image {
    transform: scale(1.05);
}

/* Badge de producto */
.product-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: linear-gradient(135deg, var(--color-herb) 0%, #7a8a7a 100%);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    box-shadow: 0 4px 12px rgba(98, 110, 96, 0.3);
}

/* Información del producto */
.product-info {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    height: calc(100% - 200px);
}

.product-header {
    margin-bottom: 1rem;
}

.product-title {
    color: var(--color-charcoal);
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    line-height: 1.3;
    font-family: 'Merriweather', serif;
}

.product-description {
    color: var(--color-charcoal);
    font-size: 0.9rem;
    opacity: 0.8;
    margin: 0;
    font-weight: 400;
}

/* Contenedor de precio */
.product-price-container {
    background: #f8f7f7;
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    margin-bottom: 1rem;
    border: 1px solid rgba(148, 93, 96, 0.1);
}

.product-price {
    color: var(--color-terracotta);
    font-weight: 700;
    font-size: 1.3rem;
    margin-bottom: 0.25rem;
}

.product-unit {
    color: var(--color-charcoal);
    font-size: 0.8rem;
    opacity: 0.7;
    font-weight: 500;
}

/* Sección de cantidad */
.quantity-section {
    margin-bottom: 1rem;
}

.quantity-label {
    color: var(--color-charcoal);
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    display: block;
}

.quantity-input {
    border: 2px solid #e8e6e6;
    border-radius: 12px;
    padding: 0.75rem 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    background: white;
}

.quantity-input:focus {
    border-color: var(--color-herb);
    box-shadow: 0 0 0 3px rgba(98, 110, 96, 0.1);
    outline: none;
}

/* Controles de cantidad */
.quantity-stepper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: #f8f7f7;
    border-radius: 12px;
    padding: 0.5rem;
    border: 1px solid rgba(148, 93, 96, 0.1);
}

.stepper-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--color-herb);
    background: white;
    color: var(--color-herb);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
    padding: 0;
}

.stepper-btn:hover {
    background: var(--color-herb);
    color: white;
    transform: scale(1.1);
}

.quantity-display {
    min-width: 40px;
    text-align: center;
    font-weight: 600;
    color: var(--color-charcoal);
    padding: 0.5rem;
    background: white;
    border-radius: 8px;
    border: 1px solid rgba(148, 93, 96, 0.1);
}

/* Acciones del producto */
.product-actions {
    margin-top: auto;
}

.add-to-cart-btn {
    background: linear-gradient(135deg, var(--color-herb) 0%, #7a8a7a 100%);
    border: none;
    border-radius: 12px;
    padding: 1rem;
    font-weight: 600;
    color: white;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(98, 110, 96, 0.2);
}

.add-to-cart-btn:hover {
    background: linear-gradient(135deg, #4e574d 0%, var(--color-herb) 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(98, 110, 96, 0.3);
    color: white;
}

.remove-from-cart-btn {
    background: linear-gradient(135deg, var(--color-chilli) 0%, #8c372e 100%);
    border: none;
    border-radius: 12px;
    padding: 1rem;
    font-weight: 600;
    color: white;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(175, 71, 60, 0.2);
}

.remove-from-cart-btn:hover {
    background: linear-gradient(135deg, #8c372e 0%, var(--color-chilli) 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(175, 71, 60, 0.3);
    color: white;
}

/* Estados especiales */
.text-success {
    color: var(--color-herb) !important;
}

/* Animaciones */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.8s ease-out;
}

.animate-fade-in {
    animation: fadeIn 1s ease-out;
}

/* Efectos de hover adicionales */
.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, var(--color-terracotta) 0%, var(--color-herb) 100%);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.product-card:hover::before {
    transform: scaleX(1);
}

/* Loading states */
.product-card.loading {
    opacity: 0.7;
    pointer-events: none;
}

.product-card.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: loading-shimmer 1.5s infinite;
}

@keyframes loading-shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Responsive Design */
@media (max-width: 1200px) {
    .products-page-title {
        font-size: 2.2rem;
    }
    
    .product-card {
        margin-bottom: 1.5rem;
    }
}

@media (max-width: 768px) {
    .products-page-title {
        font-size: 2rem;
    }
    
    .products-page-title i {
        font-size: 1.5rem;
        margin: 0 0.5rem;
    }
    
    .alert {
        padding: 1rem;
    }
    
    .search-group {
        border-radius: 25px;
    }
    
    .search-input {
        font-size: 1rem;
        padding: 0.875rem 1.25rem;
    }
    
    .search-btn {
        padding: 0.875rem 1.5rem;
    }
    
    .product-info {
        padding: 1.25rem;
    }
    
    .product-title {
        font-size: 1rem;
    }
    
    .product-price {
        font-size: 1.2rem;
    }
}

@media (max-width: 576px) {
    .products-page-title {
        font-size: 1.75rem;
    }
    
    .products-page-title i {
        font-size: 1.25rem;
        margin: 0 0.25rem;
    }
    
    .container-fluid {
        padding: 1rem 0;
    }
    
    .search-group {
        border-radius: 20px;
    }
    
    .search-input {
        font-size: 0.9rem;
        padding: 0.75rem 1rem;
    }
    
    .search-btn {
        padding: 0.75rem 1.25rem;
    }
    
    .product-info {
        padding: 1rem;
    }
    
    .product-title {
        font-size: 0.95rem;
    }
    
    .product-price {
        font-size: 1.1rem;
    }
    
    .add-to-cart-btn,
    .remove-from-cart-btn {
        padding: 0.875rem;
        font-size: 0.9rem;
    }
}

/* Optimizaciones para pantallas muy pequeñas */
@media (max-width: 480px) {
    .col-12.col-sm-6.col-md-4.col-lg-3.col-xl-3 {
        padding: 0 0.5rem;
    }
    
    .product-card {
        border-radius: 16px;
    }
    
    .product-image-container {
        height: 180px;
    }
    
    .product-info {
        padding: 0.875rem;
    }
    
    .product-price-container {
        padding: 0.75rem;
    }
    
    .quantity-stepper {
        padding: 0.375rem;
    }
    
    .stepper-btn {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }
}

/* Mejoras de accesibilidad */
.product-card:focus-within {
    outline: 2px solid var(--color-herb);
    outline-offset: 2px;
}

.stepper-btn:focus {
    outline: 2px solid var(--color-herb);
    outline-offset: 2px;
}

.search-input:focus {
    outline: none;
}

/* Estados de carga */
.product-card.loading .product-image {
    opacity: 0.5;
}

.product-card.loading .product-info {
    opacity: 0.7;
} 