/* =========================================
   SISTEMA DE DESCUENTOS - GALERÍA ZARAGUATE
   ========================================= */

/* Badge de descuento con animación */
.discount-badge {
    font-size: 0.65em !important;
    font-weight: bold;
    animation: pulse-discount 2s infinite;
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

@keyframes pulse-discount {
    0% { 
        opacity: 1; 
        transform: scale(1);
    }
    50% { 
        opacity: 0.8; 
        transform: scale(1.05);
    }
    100% { 
        opacity: 1; 
        transform: scale(1);
    }
}

/* Precio con descuento */
.price-with-discount {
    position: relative;
}

.price-with-discount .original-price {
    font-size: 0.9em;
    opacity: 0.7;
    text-decoration: line-through !important;
    color: #6c757d !important;
}

.price-with-discount .discounted-price {
    color: #dc3545 !important;
    font-weight: bold !important;
    text-shadow: 0 1px 2px rgba(220, 53, 69, 0.1);
}

/* Sección de descuento en tarjetas */
.price-section {
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
    border-radius: 6px;
    padding: 8px;
    border-left: 3px solid #dc3545;
}

.price-section .price-with-discount {
    margin: 0;
}

/* Badge de descuento posicionado */
.artwork-image-container .discount-badge {
    z-index: 10;
    font-size: 0.6em;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
}

/* Sección de descuento en vista detallada */
.discount-price-section {
    background: linear-gradient(135deg, #fff5f5 0%, #ffe6e6 100%);
    border: 2px solid #dc3545 !important;
    position: relative;
    overflow: hidden;
}

.discount-price-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #dc3545, #ff6b6b, #dc3545);
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0% { opacity: 0.5; }
    50% { opacity: 1; }
    100% { opacity: 0.5; }
}

.pulse-animation {
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0% { 
        box-shadow: 0 0 5px rgba(220, 53, 69, 0.4);
        transform: scale(1);
    }
    50% { 
        box-shadow: 0 0 15px rgba(220, 53, 69, 0.6);
        transform: scale(1.02);
    }
    100% { 
        box-shadow: 0 0 5px rgba(220, 53, 69, 0.4);
        transform: scale(1);
    }
}

/* Información de descuento para compras */
.discount-purchase-info {
    background: linear-gradient(135deg, #f8fff8 0%, #e8f5e8 100%) !important;
    border: 2px solid #28a745 !important;
    position: relative;
}

.discount-purchase-info::before {
    content: '🎉';
    position: absolute;
    top: -8px;
    right: 10px;
    background: #28a745;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8em;
}

/* Breakdown de precios */
.price-breakdown {
    font-size: 0.95em;
    line-height: 1.6;
}

.price-breakdown hr {
    border-top: 2px solid #28a745;
    opacity: 0.3;
}

/* Validez del descuento */
.discount-validity {
    background: rgba(255, 193, 7, 0.1);
    border-left: 3px solid #ffc107;
    padding: 8px 12px;
    border-radius: 4px;
}

/* Estados de descuento */
.discount-status-active {
    color: #28a745 !important;
    font-weight: bold;
}

.discount-status-inactive {
    color: #ffc107 !important;
    font-style: italic;
}

.discount-status-expired {
    color: #6c757d !important;
    text-decoration: line-through;
}

/* Hover effects para tarjetas con descuento */
.artwork-card:has(.discount-badge) {
    transition: all 0.3s ease;
    border: 1px solid rgba(220, 53, 69, 0.2) !important;
}

.artwork-card:has(.discount-badge):hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(220, 53, 69, 0.15) !important;
    border-color: #dc3545 !important;
}

/* Formulario de descuentos */
.discount-form-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    border-radius: 8px;
}

.discount-form-section .card-header {
    background: linear-gradient(135deg, #495057 0%, #6c757d 100%);
    color: white;
    font-weight: bold;
}

/* Indicadores visuales */
.discount-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.3);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .discount-badge {
        font-size: 0.55em !important;
        padding: 0.2rem 0.4rem;
    }
    
    .price-with-discount .discounted-price {
        font-size: 1.1em;
    }
    
    .discount-price-section {
        padding: 1rem !important;
    }
    
    .artwork-card:has(.discount-badge):hover {
        transform: none;
    }
}

/* Dark mode support (si se implementa en el futuro) */
@media (prefers-color-scheme: dark) {
    .price-section {
        background: linear-gradient(135deg, #2d3748 0%, #4a5568 100%);
        border-left-color: #fc8181;
    }
    
    .discount-price-section {
        background: linear-gradient(135deg, #4a1a1a 0%, #5a2121 100%);
        border-color: #fc8181 !important;
    }
    
    .discount-purchase-info {
        background: linear-gradient(135deg, #1a3d1a 0%, #2d5a2d 100%) !important;
        border-color: #68d391 !important;
    }
}

/* Animación de entrada */
.discount-badge, .price-with-discount {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Estados de loading (para futuras mejoras AJAX) */
.discount-loading {
    position: relative;
    opacity: 0.6;
}

.discount-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #dc3545;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Utilidades adicionales */
.discount-text-success {
    color: #28a745 !important;
    font-weight: 600;
}

.discount-text-warning {
    color: #ffc107 !important;
    font-weight: 500;
}

.discount-bg-light {
    background: rgba(248, 249, 250, 0.8) !important;
}

/* Print styles (para facturas/recibos) */
@media print {
    .discount-badge,
    .pulse-animation {
        animation: none !important;
    }
    
    .discount-price-section::before {
        display: none;
    }
    
    .price-with-discount .discounted-price {
        color: #000 !important;
        text-shadow: none;
    }
}