/**
 * pack-styles.css
 * Estilos para sistema de Packs y Suscripciones
 */

/* =====================================================
   BARRA DE MEMBRESÍA EN HEADER
   ===================================================== */

.membresia-bar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 8px 0;
    text-align: center;
    font-size: 0.9rem;
}

.membresia-bar-content {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.membresia-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.membresia-item .icon {
    font-size: 1.1rem;
}

.membresia-item strong {
    color: #ffd700;
}

/* =====================================================
   BADGE GRATIS CON PACK
   ===================================================== */

.pack-gratis-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.85rem;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}

.badge-pack-gratis {
    display: inline-block;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 4px;
}

/* =====================================================
   BOTÓN PACK (verde para productos elegibles)
   ===================================================== */

.btn-pack {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    border: none !important;
    color: white !important;
    font-weight: 600;
}

.btn-pack:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

/* =====================================================
   INFO DE NO ELEGIBLE PARA PACK
   ===================================================== */

.pack-no-elegible-info {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    color: #92400e;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pack-no-elegible-info .icon {
    font-size: 1.2rem;
}

/* =====================================================
   INFO DEL PACK EN CARRITO
   ===================================================== */

.pack-info-carrito {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 16px 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.pack-info-icon {
    font-size: 2.5rem;
}

.pack-info-content {
    flex: 1;
}

.pack-info-content strong {
    font-size: 1.1rem;
    display: block;
    margin-bottom: 4px;
}

.pack-info-content p {
    margin: 0;
    opacity: 0.95;
    font-size: 0.9rem;
}

.pack-info-content .pack-usado {
    color: #ffd700;
    font-weight: 600;
}

/* =====================================================
   ITEM GRATIS CON PACK (en carrito y checkout)
   ===================================================== */

.item-pack-gratis {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%) !important;
    border: 2px solid #10b981 !important;
    position: relative;
}

.item-pack-gratis::before {
    content: '🎁';
    position: absolute;
    top: -10px;
    right: -10px;
    background: #10b981;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* =====================================================
   PRECIOS
   ===================================================== */

.precio-original-tachado {
    text-decoration: line-through;
    color: #9ca3af;
    font-size: 0.9rem;
    margin-right: 8px;
}

.precio-gratis {
    color: #10b981;
    font-weight: 700;
    font-size: 1.1rem;
}

/* =====================================================
   RESUMEN - AHORRO CON PACK
   ===================================================== */

.resumen-ahorro {
    background: #d1fae5;
    color: #065f46;
    padding: 12px 16px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 10px 0;
    font-weight: 600;
}

.resumen-ahorro .ahorro-valor {
    color: #10b981;
    font-size: 1.1rem;
}

/* =====================================================
   ADMIN - ESTADÍSTICAS DE PACKS
   ===================================================== */

.stats-grid-packs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card-pack {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid #e5e7eb;
}

.stat-card-pack .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 4px;
}

.stat-card-pack .stat-label {
    color: #6b7280;
    font-size: 0.9rem;
}

/* =====================================================
   ADMIN - TABS DE SUSCRIPCIÓN/PACKS
   ===================================================== */

.admin-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 30px;
    border-bottom: 2px solid #e5e7eb;
}

.admin-tab {
    padding: 12px 24px;
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.admin-tab:hover {
    color: #667eea;
}

.admin-tab.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.admin-tab-content {
    display: none;
}

.admin-tab-content.active {
    display: block;
}

/* =====================================================
   ADMIN - FORMULARIO DE CONFIGURACIÓN
   ===================================================== */

.config-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.form-section {
    background: #f9fafb;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #e5e7eb;
}

.form-section h4 {
    margin: 0 0 16px 0;
    color: #374151;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-row {
    margin-bottom: 16px;
}

.form-row:last-child {
    margin-bottom: 0;
}

.form-row label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #4b5563;
    font-size: 0.9rem;
}

.form-row input,
.form-row textarea,
.form-row select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: border-color 0.2s;
}

.form-row input:focus,
.form-row textarea:focus,
.form-row select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* =====================================================
   ADMIN - TOGGLE SWITCH
   ===================================================== */

.toggle-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toggle-switch {
    position: relative;
    width: 50px;
    height: 26px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #d1d5db;
    transition: 0.3s;
    border-radius: 26px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: #10b981;
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

.toggle-label {
    font-size: 0.9rem;
    color: #4b5563;
}

/* =====================================================
   ADMIN - TABLA DE PACKS
   ===================================================== */

.packs-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.packs-table th,
.packs-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.packs-table th {
    background: #f9fafb;
    font-weight: 600;
    color: #374151;
    font-size: 0.85rem;
    text-transform: uppercase;
}

.packs-table td {
    color: #4b5563;
}

.packs-table tr:hover {
    background: #f9fafb;
}

.badge-activo {
    display: inline-block;
    background: #d1fae5;
    color: #065f46;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-inactivo {
    display: inline-block;
    background: #fee2e2;
    color: #991b1b;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-oferta {
    display: inline-block;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* =====================================================
   ADMIN - ACCIONES DE TABLA
   ===================================================== */

.table-actions {
    display: flex;
    gap: 8px;
}

.btn-table-action {
    padding: 6px 10px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.btn-edit {
    background: #dbeafe;
    color: #1e40af;
}

.btn-edit:hover {
    background: #bfdbfe;
}

.btn-delete {
    background: #fee2e2;
    color: #991b1b;
}

.btn-delete:hover {
    background: #fecaca;
}

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

@media (max-width: 768px) {
    .membresia-bar-content {
        flex-direction: column;
        gap: 8px;
    }
    
    .pack-info-carrito {
        flex-direction: column;
        text-align: center;
    }
    
    .stats-grid-packs {
        grid-template-columns: 1fr 1fr;
    }
    
    .admin-tabs {
        flex-wrap: wrap;
    }
    
    .admin-tab {
        flex: 1;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .stats-grid-packs {
        grid-template-columns: 1fr;
    }
}
