/* ==========================================
   PANELES DE PRODUCTOS
   Reutilizando estilos del tema
   ========================================== */

.productos-panel {
    background: #fff;
    border-radius: 0;
    box-shadow: 0 1em 5em rgba(0, 0, 0, 0.05);
    margin-bottom: 3em;
    overflow: hidden;
    border: solid 1px rgba(144, 144, 144, 0.25);
}

/* Header del Panel */
.panel-header {
    background: linear-gradient(135deg, #3b7779 0%, #2d5d5f 100%);
    color: white;
    padding: 1.5em 2em;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-gratuito .panel-header {
    background: linear-gradient(135deg, #28a745 0%, #20863a 100%);
}

.panel-premium .panel-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.panel-bloqueado .panel-header {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
}

.panel-title {
    display: flex;
    align-items: center;
    gap: 0.5em;
}

.panel-icon {
    font-size: 1.5em;
}

.panel-title h3 {
    margin: 0;
    color: white;
    font-size: 1.3em;
}

.panel-count {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.3em 0.8em;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 600;
}

/* Body del Panel */
.panel-body {
    padding: 0;
}

/* Items de Producto */
.producto-item {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    padding: 1.5em 2em;
    border-bottom: 1px solid rgba(144, 144, 144, 0.1);
    transition: background-color 0.2s;
    gap: 2em;
}

.producto-item:last-child {
    border-bottom: none;
}

.producto-item:hover {
    background-color: rgba(59, 119, 121, 0.03);
}

.producto-main {
    flex: 1;
    min-width: 0;
}

.producto-info {
    display: flex;
    flex-direction: column;
    gap: 0.75em;
}

.producto-nombre {
    margin: 0;
    color: #3b7779;
    font-size: 1.25em;
    font-weight: 600;
}

.producto-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1em;
    align-items: center;
}

.meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.3em;
    font-size: 0.9em;
}

.meta-icon {
    font-size: 1em;
}

.categoria-badge {
    background: rgba(144, 144, 144, 0.1);
    padding: 0.2em 0.6em;
    border-radius: 6px;
    text-transform: uppercase;
    font-size: 0.85em;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.version-badge {
    background: #3b7779;
    color: white;
    padding: 0.2em 0.6em;
    border-radius: 6px;
    font-family: monospace;
    font-weight: 600;
}

.meta-date {
    color: #666;
}

.meta-price {
    color: #3b7779;
    font-weight: 600;
}

.producto-descripcion {
    color: #4f4f4f;
    line-height: 1.5;
    margin: 0;
}

.producto-requisitos {
    color: #6c6c6c;
    font-size: 0.9em;
}

/* Columna de Acciones - Usar botones del tema */
.producto-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5em;
    min-width: 200px;
}

.producto-actions .button {
    white-space: nowrap;
}

/* ==========================================
   MODALES
   ========================================== */

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10003;
    opacity: 0;
    transition: opacity 0.3s ease;
    overflow-y: auto;
    padding: 2em;
}

.modal-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.modal-content {
    background: white;
    border-radius: 0;
    max-width: 900px;
    width: 100%;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.modal-content.modal-small {
    max-width: 600px;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-header {
    padding: 2em;
    border-bottom: 2px solid rgba(59, 119, 121, 0.2);
    position: relative;
    flex-shrink: 0;
}

.modal-header h3 {
    margin: 0;
    color: #3b7779;
    font-size: 1.6em;
    padding-right: 2em;
}

.modal-close {
    position: absolute;
    top: 1.5em;
    right: 1.5em;
    background: none;
    border: none;
    font-size: 2em;
    color: #999;
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
    padding: 0;
    width: 1.2em;
    height: 1.2em;
}

.modal-close:hover {
    color: #3b7779;
}

.modal-body {
    padding: 2em;
    overflow-y: auto;
    flex: 1;
}

/* Versión Item en Modal */
.version-item {
    border: 1px solid rgba(144, 144, 144, 0.25);
    border-radius: 0;
    padding: 1.5em;
    margin-bottom: 1.5em;
    transition: box-shadow 0.2s;
}

.version-item:last-child {
    margin-bottom: 0;
}

.version-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.version-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1em;
    flex-wrap: wrap;
    gap: 1em;
}

.version-info {
    display: flex;
    align-items: center;
    gap: 1em;
    flex-wrap: wrap;
}

.version-number {
    font-size: 1.4em;
    font-weight: 600;
    color: #3b7779;
    font-family: monospace;
}

.version-date {
    color: #666;
    font-size: 0.9em;
}

.tag-actual {
    background: #709fb7;
    color: white;
    padding: 0.3em 0.8em;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
}

.version-notes {
    margin: 1em 0;
    line-height: 1.6;
    color: #303030;
}

.version-notes ul {
    list-style: disc;
    margin: 0.5em 0 0.5em 1.5em;
    padding-left: 1em;
}

.version-notes li {
    margin: 0.25em 0;
    padding-left: 0.5em;
}

/* Footer del Panel */
.panel-footer {
    padding: 1.5em 2em;
    background: rgba(144, 144, 144, 0.03);
    border-top: 1px solid rgba(144, 144, 144, 0.1);
}

.panel-footer .pagination {
    display: flex;
    justify-content: center;
    gap: 0.5em;
    flex-wrap: wrap;
}

/* Mensaje cuando no hay productos */
.no-productos-message {
    padding: 3em 2em;
    text-align: center;
    color: #6c6c6c;
}

/* ==========================================
   RESPONSIVE
   ========================================== */

@media screen and (max-width: 980px) {
    .panel-header {
        padding: 1.2em 1.5em;
    }
    
    .producto-item {
        padding: 1.2em 1.5em;
    }
}

@media screen and (max-width: 736px) {
    .productos-panel {
        border-radius: 0;
        margin-bottom: 2em;
    }
    
    .panel-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5em;
        padding: 1em 1.2em;
    }
    
    .panel-title h3 {
        font-size: 1.1em;
    }
    
    .panel-count {
        font-size: 0.85em;
    }
    
    .producto-item {
        flex-direction: column;
        gap: 1.5em;
        padding: 1.2em;
    }
    
    .producto-nombre {
        font-size: 1.1em;
    }
    
    .producto-meta {
        gap: 0.7em;
    }
    
    .producto-actions {
        min-width: 100%;
    }
    
    .producto-actions .button {
        width: 100%;
    }
    
    .modal-overlay {
        padding: 1em;
    }
    
    .modal-content {
        max-height: 90vh;
    }
    
    .modal-header,
    .modal-body {
        padding: 1.5em;
    }
    
    .modal-header h3 {
        font-size: 1.3em;
    }
    
    .version-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .version-number {
        font-size: 1.2em;
    }
    
    .panel-footer {
        padding: 1.2em;
    }
}

@media screen and (max-width: 480px) {
    .producto-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5em;
    }
}