/* Estilos para modales y mensajes emergentes */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-container {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 450px;
    padding: 25px;
    transform: translateY(-50px);
    transition: transform 0.4s ease;
}

.modal-overlay.active .modal-container {
    transform: translateY(0);
}

.modal-header {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.modal-header h2 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.5rem;
}

.modal-body {
    margin-bottom: 25px;
    text-align: center;
    font-size: 1.1rem;
    line-height: 1.5;
}

.modal-footer {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.modal-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}

.modal-btn.confirm {
    background-color: #e74c3c;
    color: white;
}

.modal-btn.confirm:hover {
    background-color: #c0392b;
}

.modal-btn.cancel {
    background-color: #ecf0f1;
    color: #7f8c8d;
}

.modal-btn.cancel:hover {
    background-color: #bdc3c7;
}

/* Estilos para mensajes de éxito/error en modales */
.modal-success .modal-header {
    background-color: #27ae60;
    color: white;
}

.modal-success .modal-header h2 {
    color: white;
}

.modal-success .modal-btn.confirm {
    background-color: #27ae60;
}

.modal-success .modal-btn.confirm:hover {
    background-color: #219653;
}

.modal-error .modal-header {
    background-color: #e74c3c;
    color: white;
}

.modal-error .modal-header h2 {
    color: white;
}

.modal-error .modal-btn.confirm {
    background-color: #e74c3c;
    color: white;
}

.modal-error .modal-btn.confirm:hover {
    background-color: #c0392b;
}

.modal-warning .modal-header {
    background-color: #f39c12;
    color: white;
}

.modal-warning .modal-header h2 {
    color: white;
}

.modal-warning .modal-btn.confirm {
    background-color: #f39c12;
    color: white;
}

.modal-warning .modal-btn.confirm:hover {
    background-color: #e67e22;
}

/* Estilos para imágenes marcadas para eliminación */
.preview-item.to-remove {
    opacity: 0.5;
    border: 2px solid #e74c3c !important;
    position: relative;
}

.preview-item.to-remove::after {
    content: "Eliminada";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #e74c3c;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 12px;
}

/* Estilos para modales de información */
.modal-info .modal-header {
    background-color: #3498db;
    color: white;
}

.modal-info .modal-header h2 {
    color: white;
}

.modal-info .modal-btn.confirm {
    background-color: #3498db;
    color: white;
}

.modal-info .modal-btn.confirm:hover {
    background-color: #2980b9;
}

/* Estilos para modales de confirmación */
.modal-confirm .modal-header {
    background-color: #f39c12;
    color: white;
}

.modal-confirm .modal-header h2 {
    color: white;
}

.modal-confirm .modal-btn.confirm {
    background-color: #f39c12;
    color: white;
}

.modal-confirm .modal-btn.confirm:hover {
    background-color: #e67e22;
}

/* Estilos responsivos para modales */
@media (max-width: 768px) {
    .modal-container {
        width: 95%;
        padding: 15px;
    }
    
    .modal-header h2 {
        font-size: 1.3rem;
    }
    
    .modal-body {
        font-size: 1rem;
    }
    
    .modal-footer {
        flex-direction: column;
        gap: 10px;
    }
    
    .modal-btn {
        width: 100%;
    }
}

/* Animaciones para modales */
@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-container {
    animation: modalSlideIn 0.3s ease-out;
}

/* Estilos para el contenido de modales con listas */
.modal-list {
    text-align: left;
    max-height: 200px;
    overflow-y: auto;
    margin: 15px 0;
    padding: 10px;
    border: 1px solid #eee;
    border-radius: 5px;
}

.modal-list ul {
    margin: 0;
    padding-left: 20px;
}

.modal-list li {
    margin-bottom: 8px;
    line-height: 1.4;
}

/* Estilos para modales con formularios */
.modal-form .form-group {
    margin-bottom: 15px;
    text-align: left;
}

.modal-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.modal-form input,
.modal-form textarea,
.modal-form select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.modal-form input:focus,
.modal-form textarea:focus,
.modal-form select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

/* Estilos específicos para el modal de ofertas */
.offer-modal .modal-container {
    max-width: 900px;
    padding: 0;
    overflow: hidden;
}

.offer-modal-header {
    position: relative;
    height: 300px;
    overflow: hidden;
}

.offer-modal-carousel {
    position: relative;
    height: 100%;
}

.offer-modal-carousel .carousel-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.6s ease-in-out;
}

.offer-modal-carousel .carousel-item.active {
    opacity: 1;
}

.offer-modal-carousel img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.offer-modal-carousel-controls {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    transform: translateY(-50%);
    z-index: 10;
}

.offer-modal-carousel-controls button {
    background: rgba(255, 255, 255, 0.8);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.offer-modal-carousel-controls button:hover {
    background: var(--gold);
    color: white;
    transform: scale(1.1);
}

.offer-modal-carousel-indicators {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 10px;
    z-index: 10;
}

.offer-modal-carousel-indicators .indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
}

.offer-modal-carousel-indicators .indicator.active {
    background: var(--gold);
    transform: scale(1.2);
}

.offer-modal-content {
    padding: 30px;
}

.offer-modal-title {
    color: var(--brown);
    margin-bottom: 15px;
    font-size: 1.8rem;
}

.offer-modal-price {
    color: var(--gold);
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 20px;
    display: block;
}

.offer-modal-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
    padding-bottom: 25px;
    border-bottom: 1px solid #eee;
}

.offer-modal-meta-item {
    display: flex;
    align-items: center;
}

.offer-modal-meta-item i {
    font-size: 1.2rem;
    color: var(--gold);
    margin-right: 15px;
    min-width: 20px;
}

.offer-modal-description {
    margin-bottom: 30px;
    line-height: 1.8;
    color: var(--onyx);
    max-height: 300px;
    overflow-y: auto;
    padding: 15px;
    background: var(--light-bg);
    border-radius: 8px;
    border-left: 4px solid var(--gold);
}

.offer-modal-description h4 {
    color: var(--brown);
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.offer-modal-description p {
    line-height: 1.6;
    color: var(--onyx);
    white-space: pre-line;
}

/* Scroll personalizado para la descripción */
.offer-modal-description::-webkit-scrollbar {
    width: 6px;
}

.offer-modal-description::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.offer-modal-description::-webkit-scrollbar-thumb {
    background: var(--gold);
    border-radius: 3px;
}

.offer-modal-description::-webkit-scrollbar-thumb:hover {
    background: var(--gold-dark);
}

.offer-modal-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.offer-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 11;
    transition: all 0.3s ease;
}

.offer-modal-close:hover {
    background: var(--gold);
    transform: rotate(90deg);
}

/* Estilos para el menú de compartir */
.share-container {
    position: relative;
    display: inline-block;
}

.share-menu {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    padding: 10px;
    margin-bottom: 10px;
    display: none;
    flex-direction: column;
    min-width: 150px;
    z-index: 1000;
}

.share-menu.active {
    display: flex;
}

.share-option {
    display: flex;
    align-items: center;
    padding: 10px;
    text-decoration: none;
    color: var(--onyx);
    border-radius: 5px;
    transition: var(--transition);
    border: none;
    background: none;
    cursor: pointer;
    text-align: left;
}

.share-option:hover {
    background: #f5f5f5;
}

.share-option i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

.share-option.facebook i { color: #3b5998; }
.share-option.twitter i { color: #1da1f2; }
.share-option.linkedin i { color: #0077b5; }
.share-option.whatsapp i { color: #25d366; }
.share-option.email i { color: #ea4335; }
.share-option.copy-link i { color: var(--gold); }

/* Triángulo del menú */
.share-menu::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-top-color: white;
}

/* Estilos para modales de notificación personalizados */
.custom-notification .modal-container {
    max-width: 400px;
    text-align: center;
}

.custom-notification .modal-header {
    background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold) 100%);
    color: white;
    border-radius: 10px 10px 0 0;
    padding: 20px;
}

.custom-notification .modal-header h2 {
    color: white;
    margin: 0;
    font-size: 1.5rem;
}

.custom-notification .modal-body {
    padding: 30px 20px;
    font-size: 1.1rem;
    line-height: 1.6;
}

.custom-notification .modal-footer {
    padding: 0 20px 20px;
    display: flex;
    justify-content: center;
}

.custom-notification .modal-btn {
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
    color: white;
    padding: 12px 30px;
    border-radius: 30px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.custom-notification .modal-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(206, 159, 44, 0.4);
}

/* Modal de éxito */
.modal-success .modal-header {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
}

.modal-success .modal-btn {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
}

/* Modal de información */
.modal-info .modal-header {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
}

.modal-info .modal-btn {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
}

/* Responsive para el modal de ofertas */
@media (max-width: 768px) {
    .offer-modal .modal-container {
        width: 95%;
        height: auto;
        max-height: 90vh;
        overflow-y: auto;
    }

    .offer-modal-header {
        height: 200px;
    }

    .offer-modal-content {
        padding: 20px;
    }

    .offer-modal-title {
        font-size: 1.5rem;
    }

    .offer-modal-price {
        font-size: 1.5rem;
    }

    .offer-modal-meta {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .offer-modal-actions {
        flex-direction: column;
    }

    .offer-modal-description {
        max-height: 200px;
    }
}